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

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

Issue 2777063008: Connect BackgroundFetch to the OfflineItemCollection
Patch Set: Added BackgroundFetchClientProxy to proxy calls to and from the Context. 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_context.h
diff --git a/content/browser/background_fetch/background_fetch_context.h b/content/browser/background_fetch/background_fetch_context.h
index 41c9e7fd739a5f00c4b8e7e99f540f94458749ea..92249c1bf7f1a704bbb5007f5141a797b08ec418 100644
--- a/content/browser/background_fetch/background_fetch_context.h
+++ b/content/browser/background_fetch/background_fetch_context.h
@@ -16,6 +16,7 @@
namespace content {
+class BackgroundFetchClientProxy;
class BackgroundFetchDataManager;
class BackgroundFetchJobController;
struct BackgroundFetchOptions;
@@ -52,6 +53,18 @@ class CONTENT_EXPORT BackgroundFetchContext
const BackgroundFetchOptions& options,
const blink::mojom::BackgroundFetchService::FetchCallback& callback);
+ // Cancels the Background Fetch for the |registration_id| and triggers the
+ // 'backgroundfetchabort' to be sent to the associated service worker.
Peter Beverloo 2017/03/31 01:32:23 +event
harkness 2017/03/31 10:11:44 Done.
+ 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);
+
private:
friend class base::DeleteHelper<BackgroundFetchContext>;
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
@@ -91,6 +104,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