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

Unified Diff: content/browser/background_fetch/background_fetch_job_controller.h

Issue 2753583002: Add the JobComplete callback and error/interrupt information (Closed)
Patch Set: added argument name 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 side-by-side diff with in-line comments
Download patch
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..90ef6fb3b6a6b11e763403ec96d597026d375ba7 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,11 @@ 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);
+ BackgroundFetchJobController(const std::string& job_guid,
+ BrowserContext* browser_context,
+ StoragePartition* storage_partition,
+ std::unique_ptr<BackgroundFetchJobData> job_data,
+ base::OnceClosure completed_closure);
~BackgroundFetchJobController() override;
// Start processing on a batch of requests. Some of these may already be in
@@ -67,6 +68,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.
+ base::OnceClosure completed_closure_;
+
// Map from the GUID assigned by the DownloadManager to the request_guid.
std::unordered_map<std::string, std::string> download_guid_map_;

Powered by Google App Engine
This is Rietveld 408576698