Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: content/browser/background_fetch/background_fetch_job_data.cc

Issue 2727253002: Added DownloadItem::Observer to JobController. (Closed)
Patch Set: Added TODO Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/background_fetch/background_fetch_job_data.h" 5 #include "content/browser/background_fetch/background_fetch_job_data.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/browser/background_fetch/background_fetch_job_info.h" 8 #include "content/browser/background_fetch/background_fetch_job_info.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 bool BackgroundFetchJobData::IsComplete() const { 48 bool BackgroundFetchJobData::IsComplete() const {
49 return ((next_request_info_ == request_infos_.size()) && 49 return ((next_request_info_ == request_infos_.size()) &&
50 request_info_index_.empty()); 50 request_info_index_.empty());
51 } 51 }
52 52
53 bool BackgroundFetchJobData::HasRequestsRemaining() const { 53 bool BackgroundFetchJobData::HasRequestsRemaining() const {
54 return next_request_info_ != request_infos_.size(); 54 return next_request_info_ != request_infos_.size();
55 } 55 }
56 56
57 void BackgroundFetchJobData::SetRequestDownloadGuid(
58 const std::string& request_guid,
59 const std::string& download_guid) {
60 auto index_iter = request_info_index_.find(request_guid);
61 DCHECK(index_iter != request_info_index_.end());
62 request_infos_[index_iter->second].set_download_guid(download_guid);
63 }
57 } // namespace content 64 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698