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

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

Issue 2777063008: Connect BackgroundFetch to the OfflineItemCollection
Patch Set: Add GetVisualsForItem support Created 3 years, 8 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_context.h
diff --git a/content/browser/background_fetch/background_fetch_context.h b/content/browser/background_fetch/background_fetch_context.h
index 66df7e17334923b8695ddcf291707db54fbed061..183cd3352c4209a1b2d4315a2a53a5f4d6543185 100644
--- a/content/browser/background_fetch/background_fetch_context.h
+++ b/content/browser/background_fetch/background_fetch_context.h
@@ -25,6 +25,8 @@ class Origin;
namespace content {
+class BackgroundFetchClient;
+class BackgroundFetchClientProxy;
class BackgroundFetchDataManager;
class BackgroundFetchEventDispatcher;
class BackgroundFetchJobController;
@@ -68,6 +70,21 @@ class CONTENT_EXPORT BackgroundFetchContext
const BackgroundFetchOptions& options,
const blink::mojom::BackgroundFetchService::FetchCallback& callback);
+ // Cleans up all Background Fetch operations whether in progress or completed.
+ void CleanupAllTasks();
+
+ // Cancels the Background Fetch for the |registration_id| and triggers the
+ // 'backgroundfetchabort' event to be sent to the associated service worker.
+ void CancelFetch(const BackgroundFetchRegistrationId& registration_id);
+
+ // Pauses the Background Fetch for the |registration_id|. If the fetch was
+ // already paused, this has no effect.
+ void PauseFetch(const BackgroundFetchRegistrationId& registration_id);
+
+ // Resumes the previously paused Background Fetch for the |registration_id|.
+ // If the fetch was not paused, this has no effect.
+ void ResumeFetch(const BackgroundFetchRegistrationId& registration_id);
+
// Returns a vector with the tags of the active fetches for the given |origin|
// and |service_worker_registration_id|.
std::vector<std::string> GetActiveTagsForServiceWorkerRegistration(
@@ -135,6 +152,12 @@ class CONTENT_EXPORT BackgroundFetchContext
std::unique_ptr<BackgroundFetchJobController>>
active_fetches_;
+ // The proxy will dispatch BackgroundFetchClient calls to the UI thread.
+ std::unique_ptr<BackgroundFetchClientProxy> client_proxy_;
+
+ // The client is owned by the browser_context.
+ BackgroundFetchClient* background_fetch_client_;
Peter Beverloo 2017/04/18 23:12:08 We only use this in the constructor - can remove i
harkness 2017/04/19 09:03:41 Done.
+
DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext);
};

Powered by Google App Engine
This is Rietveld 408576698