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

Unified Diff: content/renderer/mojo/blink_service_registry_impl.cc

Issue 1830883002: Add blink::ServiceRegistry and expose it from LocalFrame and Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/renderer/mojo/blink_service_registry_impl.cc
diff --git a/content/renderer/mojo/blink_service_registry_impl.cc b/content/renderer/mojo/blink_service_registry_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..66e3835132a83d7319443eb79682ec819deb2b1f
--- /dev/null
+++ b/content/renderer/mojo/blink_service_registry_impl.cc
@@ -0,0 +1,29 @@
+// 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/renderer/mojo/blink_service_registry_impl.h"
+
+#include <utility>
+
+#include "content/common/mojo/service_registry_impl.h"
+
+namespace content {
+
+BlinkServiceRegistryImpl::BlinkServiceRegistryImpl(
+ content::ServiceRegistry* service_registry)
+ : service_registry_(
+ static_cast<ServiceRegistryImpl*>(service_registry)->GetWeakPtr()) {}
dcheng 2016/03/31 05:34:26 Why not just take a ServiceRegistryImpl?
Sam McNally 2016/03/31 09:26:27 Changed it to take a WeakPtr<ServiceRegistry> inst
+
+BlinkServiceRegistryImpl::~BlinkServiceRegistryImpl() = default;
+
+void BlinkServiceRegistryImpl::connectToRemoteService(
+ const char* name,
+ mojo::ScopedMessagePipeHandle handle) {
+ if (!service_registry_)
+ return;
+
+ service_registry_->ConnectToRemoteService(name, std::move(handle));
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698