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

Unified Diff: content/browser/service_worker/service_worker_global_scope_host_impl.cc

Issue 2168513004: [DO NOT COMMIT] ServiceWorker: First touch of mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove an unnecessary file Created 4 years, 5 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_global_scope_host_impl.cc
diff --git a/content/browser/service_worker/service_worker_global_scope_host_impl.cc b/content/browser/service_worker/service_worker_global_scope_host_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..064e9a483533709f19733eb71422cc69a560645c
--- /dev/null
+++ b/content/browser/service_worker/service_worker_global_scope_host_impl.cc
@@ -0,0 +1,40 @@
+// 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.
+
+#include "content/browser/service_worker/service_worker_global_scope_host_impl.h"
+
+#include <utility>
+#include "content/browser/service_worker/service_worker_version.h"
+
+
+namespace content {
+
+// static
+void ServiceWorkerGlobalScopeHostImpl::Create(
+ base::WeakPtr<ServiceWorkerVersion> version,
+ blink::mojom::ServiceWorkerGlobalScopeHostRequest request) {
+ new ServiceWorkerGlobalScopeHostImpl(version, std::move(request));
+}
+
+
+ServiceWorkerGlobalScopeHostImpl::ServiceWorkerGlobalScopeHostImpl(
+ base::WeakPtr<ServiceWorkerVersion> version,
+ blink::mojom::ServiceWorkerGlobalScopeHostRequest request)
+ : version_(version),
+ binding_(this, std::move(request)) { }
+
+ServiceWorkerGlobalScopeHostImpl::~ServiceWorkerGlobalScopeHostImpl() { }
+
+void ServiceWorkerGlobalScopeHostImpl::SetClient(
+ blink::mojom::ServiceWorkerGlobalScopeClientPtr client) {
+ if (version_)
+ version_->AddMojoService(std::move(client), true);
+}
+void ServiceWorkerGlobalScopeHostImpl::DidHandleSimpleEvent(
+ int request_id, ServiceWorkerStatusCode status) {
+ LOG(ERROR) << "DidHandleSimpleEvent(" << request_id << "," << status << ")";
+ if (version_)
+ version_->OnSimpleEventResponse(request_id, status);
+}
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698