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

Side by Side Diff: mojo/public/dart/src/application.dart

Issue 919883002: Allow sky apps to be consumers of mojo services (Closed) Base URL: https://github.com/eseidel/skydart.git@master
Patch Set: cr comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/bindings2/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 part of application; 5 part of application;
6 6
7 class _ApplicationImpl extends application_mojom.Application { 7 class _ApplicationImpl extends application_mojom.Application {
8 shell_mojom.ShellProxy shell; 8 shell_mojom.ShellProxy shell;
9 Application _application; 9 Application _application;
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 _serviceProviders = []; 61 _serviceProviders = [];
62 _applicationImpl = new _ApplicationImpl(this, endpoint); 62 _applicationImpl = new _ApplicationImpl(this, endpoint);
63 } 63 }
64 64
65 Application.fromHandle(core.MojoHandle appHandle) { 65 Application.fromHandle(core.MojoHandle appHandle) {
66 _proxies = []; 66 _proxies = [];
67 _serviceProviders = []; 67 _serviceProviders = [];
68 _applicationImpl = new _ApplicationImpl.fromHandle(this, appHandle); 68 _applicationImpl = new _ApplicationImpl.fromHandle(this, appHandle);
69 } 69 }
70 70
71 // TODO(skydart): This is a temporary fix to allow sky application to consume
72 // mojo services. Do not use for any other purpose.
73 void initializeFromShellProxy(shell_mojom.ShellProxy shellProxy,
74 List<String> args) {
75 _applicationImpl.initialize(shellProxy, args);
76 }
77
71 void initialize(List<String> args) {} 78 void initialize(List<String> args) {}
72 79
73 void connectToService(String url, bindings.Proxy proxy) { 80 void connectToService(String url, bindings.Proxy proxy) {
74 assert(!proxy.isBound); 81 assert(!proxy.isBound);
75 var endpoint = _connectToServiceHelper(url, proxy.name); 82 var endpoint = _connectToServiceHelper(url, proxy.name);
76 proxy.bind(endpoint); 83 proxy.bind(endpoint);
77 } 84 }
78 85
79 void requestQuit() {} 86 void requestQuit() {}
80 87
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 var applicationEndpoint = applicationPipe.endpoints[1]; 119 var applicationEndpoint = applicationPipe.endpoints[1];
113 var serviceProviderProxy = 120 var serviceProviderProxy =
114 new service_provider.ServiceProviderProxy.unbound(); 121 new service_provider.ServiceProviderProxy.unbound();
115 _applicationImpl.shell.connectToApplication( 122 _applicationImpl.shell.connectToApplication(
116 url, serviceProviderProxy, null); 123 url, serviceProviderProxy, null);
117 serviceProviderProxy.connectToService(service, applicationEndpoint); 124 serviceProviderProxy.connectToService(service, applicationEndpoint);
118 _proxies.add(serviceProviderProxy); 125 _proxies.add(serviceProviderProxy);
119 return proxyEndpoint; 126 return proxyEndpoint;
120 } 127 }
121 } 128 }
OLDNEW
« no previous file with comments | « no previous file | sky/engine/bindings2/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698