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 f1dc0f484bb835beafe59645146b260eeda2e9a4..6a099c754885fc8f7ff5a6eb852a81a96d87a5f9 100644 |
| --- a/content/browser/background_fetch/background_fetch_job_controller.h |
| +++ b/content/browser/background_fetch/background_fetch_job_controller.h |
| @@ -5,16 +5,16 @@ |
| #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ |
| #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_CONTROLLER_H_ |
| +#include <memory> |
| #include <string> |
| -#include <unordered_map> |
| -#include <vector> |
| -#include "content/browser/background_fetch/background_fetch_data_manager.h" |
| -#include "content/browser/background_fetch/background_fetch_request_info.h" |
| +#include "base/macros.h" |
| #include "content/common/content_export.h" |
| namespace content { |
| +class BackgroundFetchJobData; |
| +class BackgroundFetchRequestInfo; |
| class BrowserContext; |
| class StoragePartition; |
| @@ -24,18 +24,21 @@ class StoragePartition; |
| // TODO(harkness): The JobController should also observe downloads. |
| class CONTENT_EXPORT BackgroundFetchJobController { |
| public: |
| - BackgroundFetchJobController(BrowserContext* browser_context, |
| - StoragePartition* storage_partition); |
| + BackgroundFetchJobController(const std::string& job_guid, |
| + BrowserContext* browser_context, |
| + StoragePartition* storage_partition, |
| + BackgroundFetchJobData* job_data); |
|
Peter Beverloo
2017/03/08 14:27:04
nit: pass as std::unique_ptr<>
harkness
2017/03/09 13:33:25
Done.
|
| ~BackgroundFetchJobController(); |
| // Start processing on a batch of requests. Some of these may already be in |
| // progress or completed from a previous chromium instance. |
| - void ProcessJob(const std::string& job_guid, |
| - BackgroundFetchJobData* job_data); |
| + void StartProcessing(); |
| + |
| + // Called by the BackgroundFetchContext when the system is shutting down. |
| + void Shutdown(); |
| private: |
| - void ProcessRequest(const std::string& job_guid, |
| - const BackgroundFetchRequestInfo& request); |
| + void ProcessRequest(const BackgroundFetchRequestInfo& request); |
| // Pointer to the browser context. The BackgroundFetchJobController is owned |
| // by the BrowserContext via the StoragePartition. |
| @@ -45,9 +48,8 @@ class CONTENT_EXPORT BackgroundFetchJobController { |
| // (through a sequence of other classes). |
| StoragePartition* storage_partition_; |
| - // The fetch_map holds any requests which have been sent to the |
| - // DownloadManager indexed by the job_guid. |
| - std::unordered_map<std::string, BackgroundFetchRequestInfo> fetch_map_; |
| + // The JobData which talks to the DataManager for this job_guid. |
| + std::unique_ptr<BackgroundFetchJobData> job_data_; |
| DISALLOW_COPY_AND_ASSIGN(BackgroundFetchJobController); |
| }; |