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

Unified Diff: third_party/mojo/src/mojo/public/python/mojo_application/service_provider_impl.py

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use run_renderer_in_process() Created 5 years, 10 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: third_party/mojo/src/mojo/public/python/mojo_application/service_provider_impl.py
diff --git a/third_party/mojo/src/mojo/public/python/mojo_application/service_provider_impl.py b/third_party/mojo/src/mojo/public/python/mojo_application/service_provider_impl.py
new file mode 100644
index 0000000000000000000000000000000000000000..0166c766d37e5f99655e5a3cf1b07d8d331ea730
--- /dev/null
+++ b/third_party/mojo/src/mojo/public/python/mojo_application/service_provider_impl.py
@@ -0,0 +1,24 @@
+# Copyright 2015 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.
+
+"""Python implementation of the ServiceProvider interface."""
+
+import logging
+
+import service_provider_mojom
+
+class ServiceProviderImpl(service_provider_mojom.ServiceProvider):
+ def __init__(self, provider):
+ self._provider = provider
+ self._name_to_service_connector = {}
+
+ def AddService(self, service_class):
+ self._name_to_service_connector[service_class.manager.name] = service_class
+
+ def ConnectToService(self, interface_name, pipe):
+ if interface_name in self._name_to_service_connector:
+ service = self._name_to_service_connector[interface_name]
+ service.manager.Bind(service(), pipe)
+ else:
+ logging.error("Unable to find service " + interface_name)

Powered by Google App Engine
This is Rietveld 408576698