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

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

Issue 2777183002: Hook up the other Background Fetch Mojo methods with the system (Closed)
Patch Set: Hook up the other Background Fetch Mojo methods with the system 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 ba641829f22245bc85e4e5aed18625e906f956e9..5d4fdcc7f006abfde28b6c958df77fa485ed549b 100644
--- a/content/browser/background_fetch/background_fetch_job_controller.h
+++ b/content/browser/background_fetch/background_fetch_job_controller.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/browser/background_fetch/background_fetch_registration_id.h"
+#include "content/common/background_fetch/background_fetch_types.h"
#include "content/common/content_export.h"
#include "content/public/browser/download_item.h"
@@ -30,10 +31,12 @@ class CONTENT_EXPORT BackgroundFetchJobController
: public DownloadItem::Observer {
public:
using CompletedCallback =
- base::OnceCallback<void(const BackgroundFetchRegistrationId&)>;
+ base::OnceCallback<void(const BackgroundFetchRegistrationId&,
+ bool /* aborted_by_developer */)>;
BackgroundFetchJobController(
const BackgroundFetchRegistrationId& registration_id,
+ const BackgroundFetchOptions& options,
BrowserContext* browser_context,
StoragePartition* storage_partition,
BackgroundFetchDataManager* data_manager,
@@ -44,9 +47,24 @@ class CONTENT_EXPORT BackgroundFetchJobController
// progress or completed from a previous chromium instance.
void StartProcessing();
+ // Updates the representation of this Background Fetch in the user interface
+ // to match the given |title|.
+ void UpdateUI(const std::string& title);
+
+ // Immediately aborts this Background Fetch by request of the developer.
+ void Abort();
+
// Called by the BackgroundFetchContext when the system is shutting down.
void Shutdown();
+ // Returns the registration id for which this job is fetching data.
+ const BackgroundFetchRegistrationId& registration_id() const {
+ return registration_id_;
+ }
+
+ // Returns the options with which this job is fetching data.
+ const BackgroundFetchOptions& options() const { return options_; }
+
private:
// DownloadItem::Observer methods.
void OnDownloadUpdated(DownloadItem* item) override;
@@ -63,6 +81,9 @@ class CONTENT_EXPORT BackgroundFetchJobController
// The registration id on behalf of which this controller is fetching data.
BackgroundFetchRegistrationId registration_id_;
+ // Options for the represented background fetch registration.
+ BackgroundFetchOptions options_;
+
// TODO(peter): Deprecated, remove in favor of |registration_id|.
std::string job_guid_;

Powered by Google App Engine
This is Rietveld 408576698