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

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

Issue 2777063008: Connect BackgroundFetch to the OfflineItemCollection
Patch Set: Fixed incognito check and added tests 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..0d9ed555e63d25999f792e2882e0a1425015c199 100644
--- a/content/browser/background_fetch/background_fetch_context.h
+++ b/content/browser/background_fetch/background_fetch_context.h
@@ -25,6 +25,7 @@ class Origin;
namespace content {
+class BackgroundFetchClientProxy;
class BackgroundFetchDataManager;
class BackgroundFetchEventDispatcher;
class BackgroundFetchJobController;
@@ -68,6 +69,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 +151,9 @@ 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_;
+
DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext);
};

Powered by Google App Engine
This is Rietveld 408576698