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

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

Issue 2777063008: Connect BackgroundFetch to the OfflineItemCollection
Patch Set: 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..48ef9625d00fc7d8c1da99052a75ece70aaf0120 100644
--- a/content/browser/background_fetch/background_fetch_context.h
+++ b/content/browser/background_fetch/background_fetch_context.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
+#include "content/public/browser/background_fetch_delegate.h"
#include "content/public/browser/browser_thread.h"
#include "third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom.h"
@@ -30,7 +31,8 @@ class StoragePartitionImpl;
// Background Fetch requests function similar to normal fetches except that
// they are persistent across Chromium or service worker shutdown.
class CONTENT_EXPORT BackgroundFetchContext
- : public base::RefCountedThreadSafe<BackgroundFetchContext,
+ : public BackgroundFetchDelegate,
+ public base::RefCountedThreadSafe<BackgroundFetchContext,
BrowserThread::DeleteOnUIThread> {
public:
// The BackgroundFetchContext will watch the ServiceWorkerContextWrapper so
@@ -52,13 +54,18 @@ class CONTENT_EXPORT BackgroundFetchContext
const BackgroundFetchOptions& options,
const blink::mojom::BackgroundFetchService::FetchCallback& callback);
+ // BackgroundFetchDelegate method overrides;
Peter Beverloo 2017/03/29 14:32:12 nit: s/method overrides;/implementation:/ (They'r
harkness 2017/03/30 12:42:35 Done.
+ void CancelDownload(const std::string& id) override;
+ void PauseDownload(const std::string& id) override;
+ void ResumeDownload(const std::string& id) override;
Peter Beverloo 2017/03/29 14:32:12 nit: could we s/id/serialized_registration_id/ to
harkness 2017/03/30 12:42:35 Done.
+
private:
friend class base::DeleteHelper<BackgroundFetchContext>;
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
friend class base::RefCountedThreadSafe<BackgroundFetchContext,
BrowserThread::DeleteOnUIThread>;
- ~BackgroundFetchContext();
+ ~BackgroundFetchContext() override;
// Shuts down the active Job Controllers on the IO thread.
void ShutdownOnIO();

Powered by Google App Engine
This is Rietveld 408576698