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

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

Issue 2745243002: Implement a Mojo service for Background Fetch (Closed)
Patch Set: Implement a Mojo service for Background Fetch 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..6b8e2525ab23a24fe9fa2812d2b43b86de51c34b
--- /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 "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;
+
+// Implementation of the Mojo Background Fetch service. Will receive requests
+// and callers from Blink, which implements the Background Fetch JavaScript API.
harkness 2017/03/14 11:55:47 nit: and calls? or just remove? Not sure what this
Peter Beverloo 2017/03/14 15:17:21 Fair enough. Realistically I'm not holding my brea
+class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService {
+ public:
+ BackgroundFetchServiceImpl(
+ BackgroundFetchContext* background_fetch_context,
+ ServiceWorkerContextWrapper* service_worker_context);
+ ~BackgroundFetchServiceImpl() override;
+
+ static void Create(BackgroundFetchContext* background_fetch_context,
+ 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_

Powered by Google App Engine
This is Rietveld 408576698