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..b9e9e5f3df980ac82b9c298ac408f929529e8498 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' 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); |
+ |
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); |
}; |