| Index: mojo/public/dart/src/application.dart
|
| diff --git a/mojo/public/dart/src/application.dart b/mojo/public/dart/src/application.dart
|
| index 4be554df1bee1800fdcaaa4981e5e607a6a2ee12..8fb1af2b2c735917cf1caea07739266cb9d98128 100644
|
| --- a/mojo/public/dart/src/application.dart
|
| +++ b/mojo/public/dart/src/application.dart
|
| @@ -4,37 +4,45 @@
|
|
|
| part of application;
|
|
|
| -class _ApplicationImpl extends application_mojom.Application {
|
| +class _ApplicationImpl implements application_mojom.Application {
|
| + application_mojom.ApplicationStub _stub;
|
| shell_mojom.ShellProxy shell;
|
| Application _application;
|
|
|
| - _ApplicationImpl(
|
| - Application application, core.MojoMessagePipeEndpoint endpoint)
|
| - : _application = application, super(endpoint) {
|
| - super.delegate = this;
|
| + _ApplicationImpl(Application application,
|
| + core.MojoMessagePipeEndpoint endpoint) {
|
| + _application = application;
|
| + _stub = new application_mojom.ApplicationStub.fromEndpoint(endpoint)
|
| + ..delegate = this
|
| + ..listen();
|
| }
|
|
|
| - _ApplicationImpl.fromHandle(Application application, core.MojoHandle handle)
|
| - : _application = application, super.fromHandle(handle) {
|
| - super.delegate = this;
|
| + _ApplicationImpl.fromHandle(Application application, core.MojoHandle handle) {
|
| + _application = application;
|
| + _stub = new application_mojom.ApplicationStub.fromHandle(handle)
|
| + ..delegate = this
|
| + ..listen();
|
| }
|
|
|
| - void initialize(
|
| - shell_mojom.ShellProxy shellProxy, List<String> args, String url) {
|
| + void initialize(bindings.Proxy shellProxy, List<String> args, String url) {
|
| assert(shell == null);
|
| - shell = shellProxy;
|
| + shell = new shell_mojom.ShellProxy(shellProxy);
|
| _application.initialize(args, url);
|
| }
|
|
|
| - void acceptConnection(
|
| - String requestorUrl,
|
| - ServiceProviderStub services,
|
| - ServiceProviderProxy exposedServices) =>
|
| - _application._acceptConnection(requestorUrl, services, exposedServices);
|
| + void acceptConnection(String requestorUrl,
|
| + ServiceProviderStub services,
|
| + bindings.Proxy exposedServices) {
|
| + var serviceProviderProxy = exposedServices == null
|
| + ? null : new ServiceProviderProxy(exposedServices);
|
| + _application._acceptConnection(
|
| + requestorUrl, services, serviceProviderProxy);
|
| + }
|
|
|
| void requestQuit() => _application._requestQuitAndClose();
|
|
|
| - void close({bool nodefer: false}) => shell.close();
|
| + void close({bool nodefer: false}) =>
|
| + shell_mojom.ShellProxyClose(shell);
|
| }
|
|
|
| // TODO(zra): Better documentation and examples.
|
| @@ -62,14 +70,16 @@ abstract class Application {
|
| // mojo services. Do not use for any other purpose.
|
| void initializeFromShellProxy(shell_mojom.ShellProxy shellProxy,
|
| List<String> args, String url) {
|
| - _applicationImpl.initialize(shellProxy, args, url);
|
| + _applicationImpl.initialize(
|
| + shell_mojom.ShellGetProxyImpl(shellProxy), args, url);
|
| }
|
|
|
| // Returns a connection to the app at |url|.
|
| ApplicationConnection connectToApplication(String url) {
|
| var proxy = new ServiceProviderProxy.unbound();
|
| var stub = new ServiceProviderStub.unbound();
|
| - _applicationImpl.shell.connectToApplication(url, proxy, stub);
|
| + _applicationImpl.shell.connectToApplication(
|
| + url, ServiceProviderRequest(proxy), stub);
|
| var connection = new ApplicationConnection(stub, proxy);
|
| _applicationConnections.add(connection);
|
| return connection;
|
| @@ -81,8 +91,6 @@ abstract class Application {
|
|
|
| void requestQuit() {}
|
|
|
| - listen() => _applicationImpl.listen();
|
| -
|
| void _requestQuitAndClose() {
|
| requestQuit();
|
| close();
|
|
|