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

Unified Diff: third_party/mojo/src/mojo/public/dart/src/service_provider.dart

Issue 883843002: Update mojo sdk to rev 126532ce21c5c3c55a1e1693731411cb60169efd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 11 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/dart/src/service_provider.dart
diff --git a/third_party/mojo/src/mojo/public/dart/src/service_provider.dart b/third_party/mojo/src/mojo/public/dart/src/service_provider.dart
new file mode 100644
index 0000000000000000000000000000000000000000..deac6bc79f43e57f6c151f8bc09b40fa88c7524f
--- /dev/null
+++ b/third_party/mojo/src/mojo/public/dart/src/service_provider.dart
@@ -0,0 +1,39 @@
+// Copyright 2014 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.
+
+part of application;
+
+typedef core.Listener ListenerFactory(core.MojoMessagePipeEndpoint endpoint);
+
+class ServiceProvider extends service_provider.ServiceProvider {
+ ListenerFactory factory;
+
+ service_provider.ServiceProviderProxy _proxy;
+
+ ServiceProvider(
+ service_provider.ServiceProviderStub services,
+ [service_provider.ServiceProviderProxy exposedServices = null])
+ : _proxy = exposedServices,
+ super.fromStub(services) {
+ delegate = this;
+ }
+
+ connectToService(String interfaceName, core.MojoMessagePipeEndpoint pipe) =>
+ factory(pipe).listen();
+
+ requestService(String name, bindings.Proxy clientImpl) {
+ assert(_proxy != null);
+ assert(!clientImpl.isBound);
+ var pipe = new core.MojoMessagePipe();
+ clientImpl.bind(pipe.endpoints[0]);
+ _proxy.connectToService(name, pipe.endpoints[1]);
+ }
+
+ close() {
+ if (_proxy != null) {
+ _proxy.close();
+ _proxy = null;
+ }
+ }
+}
« no previous file with comments | « third_party/mojo/src/mojo/public/dart/src/proxy.dart ('k') | third_party/mojo/src/mojo/public/dart/src/stub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698