| Index: sky/framework/embedder.dart
|
| diff --git a/sky/framework/embedder.dart b/sky/framework/embedder.dart
|
| index 90046be8aefb5ff609e23a25886842ce526354bf..8b2385d71fde1c0c284e0a694ccd9f432164c57e 100644
|
| --- a/sky/framework/embedder.dart
|
| +++ b/sky/framework/embedder.dart
|
| @@ -12,14 +12,26 @@ import "package:mojo/public/interfaces/application/shell.mojom.dart";
|
| final _EmbedderImpl embedder = new _EmbedderImpl();
|
|
|
| class _EmbedderImpl {
|
| - static final ShellProxy shell = new ShellProxy.fromHandle(
|
| + ApplicationConnection _connection;
|
| +
|
| + final ShellProxy shell = new ShellProxy.fromHandle(
|
| new core.MojoHandle(internals.takeShellProxyHandle()));
|
|
|
| - static final ApplicationConnection connection = new ApplicationConnection(
|
| - new ServiceProviderStub.fromHandle(
|
| - new core.MojoHandle(internals.takeServicesProvidedToEmbedder())),
|
| - new ServiceProviderProxy.fromHandle(
|
| - new core.MojoHandle(internals.takeServicesProvidedByEmbedder())));
|
| + ApplicationConnection get connection {
|
| + if (_connection == null) {
|
| + 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;
|
| + );
|
| + }
|
| + return _connection;
|
| + }
|
|
|
| ApplicationConnection connectToApplication(String url) {
|
| var proxy = new ServiceProviderProxy.unbound();
|
|
|