Chromium Code Reviews| Index: content/browser/background_fetch/background_fetch_job_controller.h |
| diff --git a/content/browser/background_fetch/background_fetch_job_controller.h b/content/browser/background_fetch/background_fetch_job_controller.h |
| index b53501824990fedfd00c626eec4555497fe911c9..0279e3d17b564e795e445829076a0c60ead38931 100644 |
| --- a/content/browser/background_fetch/background_fetch_job_controller.h |
| +++ b/content/browser/background_fetch/background_fetch_job_controller.h |
| @@ -9,6 +9,7 @@ |
| #include <string> |
| #include <unordered_map> |
| +#include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| #include "content/common/content_export.h" |
| @@ -27,11 +28,13 @@ class StoragePartition; |
| class CONTENT_EXPORT BackgroundFetchJobController |
| : public DownloadItem::Observer { |
| public: |
| - BackgroundFetchJobController( |
| - const std::string& job_guid, |
| - BrowserContext* browser_context, |
| - StoragePartition* storage_partition, |
| - std::unique_ptr<BackgroundFetchJobData> job_data); |
| + using JobCompleteCallback = base::Callback<void()>; |
|
Peter Beverloo
2017/03/15 16:53:38
base::OnceClosure. Can also drop the typedef that
harkness
2017/03/16 11:41:09
I had hesitated on this based on the discussions a
|
| + |
| + BackgroundFetchJobController(const std::string& job_guid, |
| + BrowserContext* browser_context, |
| + StoragePartition* storage_partition, |
| + std::unique_ptr<BackgroundFetchJobData> job_data, |
| + const JobCompleteCallback& callback); |
|
Peter Beverloo
2017/03/15 16:53:38
nit: drop const& if you can use OnceClosure and st
Peter Beverloo
2017/03/15 16:53:38
nit: completed_callback?
harkness
2017/03/16 11:41:09
Done.
harkness
2017/03/16 11:41:09
Done.
|
| ~BackgroundFetchJobController() override; |
| // Start processing on a batch of requests. Some of these may already be in |
| @@ -67,6 +70,9 @@ class CONTENT_EXPORT BackgroundFetchJobController |
| // The JobData which talks to the DataManager for this job_guid. |
| std::unique_ptr<BackgroundFetchJobData> job_data_; |
| + // Callback for when all fetches have been completed. |
| + JobCompleteCallback callback_; |
| + |
| // Map from the GUID assigned by the DownloadManager to the request_guid. |
| std::unordered_map<std::string, std::string> download_guid_map_; |