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

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

Issue 2745243002: Implement a Mojo service for Background Fetch (Closed)
Patch Set: rebase + comments v2 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_service_impl.h
diff --git a/content/browser/background_fetch/background_fetch_service_impl.h b/content/browser/background_fetch/background_fetch_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..ffc29862fdae9404bebaa6f8dd3167dc47b1ede5
--- /dev/null
+++ b/content/browser/background_fetch/background_fetch_service_impl.h
@@ -0,0 +1,54 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_
+#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_
+
+#include <string>
+#include <utility>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom.h"
+
+namespace content {
+
+class BackgroundFetchContext;
+class ServiceWorkerContextWrapper;
+
+class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService {
+ public:
+ BackgroundFetchServiceImpl(
+ scoped_refptr<BackgroundFetchContext> background_fetch_context,
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context);
+ ~BackgroundFetchServiceImpl() override;
+
+ static void Create(
+ scoped_refptr<BackgroundFetchContext> background_fetch_context,
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
+ blink::mojom::BackgroundFetchServiceRequest request);
+
+ // blink::mojom::BackgroundFetchService implementation.
+ void UpdateUI(int64_t service_worker_registration_id,
+ const std::string& tag,
+ const std::string& title,
+ const UpdateUICallback& callback) override;
+ void Abort(int64_t service_worker_registration_id,
+ const std::string& tag) override;
+ void GetRegistration(int64_t service_worker_registration_id,
+ const std::string& tag,
+ const GetRegistrationCallback& callback) override;
+ void GetTags(int64_t service_worker_registration_id,
+ const GetTagsCallback& callback) override;
+
+ private:
+ scoped_refptr<BackgroundFetchContext> background_fetch_context_;
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_
« no previous file with comments | « content/browser/background_fetch/DEPS ('k') | content/browser/background_fetch/background_fetch_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698