OLD | NEW |
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 Loading... |
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 |
OLD | NEW |