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

Unified Diff: sky/framework/embedder.dart

Issue 958673002: Added ServiceRegistry interface (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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: sky/framework/embedder.dart
diff --git a/sky/framework/embedder.dart b/sky/framework/embedder.dart
index dd1eaf0aa86b4ebbadd525168bf8249e31c4a998..f4a8ec902604bb6e17e3e0dcdbb1ad93bd3900c2 100644
--- a/sky/framework/embedder.dart
+++ b/sky/framework/embedder.dart
@@ -8,27 +8,26 @@ import "mojo:bindings" as bindings;
import "mojo:core" as core;
import "package:mojo/public/interfaces/application/service_provider.mojom.dart";
import "package:mojo/public/interfaces/application/shell.mojom.dart";
+import "package:sky/services/service_registry/service_registry.mojom.dart";
final _EmbedderImpl embedder = new _EmbedderImpl();
class _EmbedderImpl {
ApplicationConnection _connection;
+ ServiceRegistry _serviceRegistry;
final ShellProxy shell = new ShellProxy.fromHandle(
new core.MojoHandle(internals.takeShellProxyHandle()));
ApplicationConnection get connection {
if (_connection == null) {
- var stubHandle = new core.MojoHandle(
- internals.takeServicesProvidedToEmbedder());
- var proxyHandle = new core.MojoHandle(
- internals.takeServicesProvidedByEmbedder());
+ var stubHandle =
+ new core.MojoHandle(internals.takeServicesProvidedToEmbedder());
+ var proxyHandle =
+ new core.MojoHandle(internals.takeServicesProvidedByEmbedder());
_connection = new ApplicationConection(
- stubHandle.isValid ? ServiceProviderStub.fromHandle(stubHandle)
- : null;
- proxyHandle.isValid ? ServiceProviderProxy.fromHandle(proxyHandle)
- : null;
- );
+ stubHandle.isValid ? ServiceProviderStub.fromHandle(stubHandle) : null,
+ proxyHandle.isValid ? ServiceProviderProxy.fromHandle(proxyHandle) : null);
}
return _connection;
}
@@ -48,5 +47,14 @@ class _EmbedderImpl {
appSp.connectToService(proxy.name, pipe.endpoints[1]);
appSp.close();
}
+
+ ServiceRegistryProxy get serviceRegistry {
+ if (_serviceRegistry == null) {
+ _serviceRegistry = new ServiceRegistryProxy.fromHandle(
+ new core.MojoHandle(internals.takeServiceRegistry()));
+ }
+ return _serviceRegistry;
+ }
}
+

Powered by Google App Engine
This is Rietveld 408576698