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

Unified Diff: content/browser/service_worker/service_worker_service_impl.h

Issue 2118243002: [proof-of-concept] SW thread independent of the main thread Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/service_worker/service_worker_service_impl.h
diff --git a/content/browser/service_worker/service_worker_service_impl.h b/content/browser/service_worker/service_worker_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..3d10fde77952112e3772d096c1c8f754d69e1bf4
--- /dev/null
+++ b/content/browser/service_worker/service_worker_service_impl.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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_SERVICE_WORKER_SERVICE_WORKER_SERVICE_IMPL_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SERVICE_IMPL_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "third_party/WebKit/public/platform/modules/serviceworker/service_worker.mojom.h"
+
+namespace content {
+class ServiceWorkerContextCore;
+
+class ServiceWorkerServiceImpl : public blink::mojom::ServiceWorkerService {
+ public:
+ ServiceWorkerServiceImpl(base::WeakPtr<ServiceWorkerContextCore> context,
+ blink::mojom::ServiceWorkerServiceRequest request);
+ ~ServiceWorkerServiceImpl() override;
+
+ void ReplaceContext(base::WeakPtr<ServiceWorkerContextCore> context);
+
+ private:
+ void WorkerStarted(int32_t embedded_worker_id) override;
+
+ // Called when an error is detected on binding_.
+ void OnConnectionError();
+
+ base::WeakPtr<ServiceWorkerContextCore> context_;
+ mojo::Binding<blink::mojom::ServiceWorkerService> binding_;
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerServiceImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SERVICE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698