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

Side by Side Diff: mojo/dart/packages/mojo/lib/src/application.dart

Issue 1983453002: Dart: Refactor Stubs (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 7 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
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 implements application_mojom.Application { 7 class _ApplicationImpl implements application_mojom.Application {
8 application_mojom.ApplicationStub _stub; 8 application_mojom.ApplicationStub _stub;
9 shell_mojom.ShellProxy shell; 9 shell_mojom.ShellProxy shell;
10 Application _application; 10 Application _application;
11 11
12 _ApplicationImpl( 12 _ApplicationImpl(
13 Application application, core.MojoMessagePipeEndpoint endpoint) { 13 Application application, core.MojoMessagePipeEndpoint endpoint) {
14 _application = application; 14 _application = application;
15 _stub = new application_mojom.ApplicationStub.fromEndpoint(endpoint, this); 15 _stub = new application_mojom.ApplicationStub.fromEndpoint(endpoint, this);
16 _stub.onError = ((_) => close()); 16 _stub.ctrl.onError = ((_) => close());
17 } 17 }
18 18
19 _ApplicationImpl.fromHandle(Application application, core.MojoHandle handle) { 19 _ApplicationImpl.fromHandle(Application application, core.MojoHandle handle) {
20 _application = application; 20 _application = application;
21 _stub = new application_mojom.ApplicationStub.fromHandle(handle, this); 21 _stub = new application_mojom.ApplicationStub.fromHandle(handle, this);
22 _stub.onError = ((_) => close()); 22 _stub.ctrl.onError = ((_) => close());
23 } 23 }
24 24
25 _ApplicationImpl.fromStub(Application application, 25 _ApplicationImpl.fromStub(Application application,
26 application_mojom.ApplicationStub applicationStub) { 26 application_mojom.ApplicationStub applicationStub) {
27 _application = application; 27 _application = application;
28 _stub = applicationStub; 28 _stub = applicationStub;
29 _stub.impl = this; 29 _stub.impl = this;
30 _stub.onError = ((_) => close()); 30 _stub.ctrl.onError = ((_) => close());
31 } 31 }
32 32
33 set onError(core.ErrorHandler f) { 33 set onError(core.ErrorHandler f) {
34 _stub.onError = f; 34 _stub.ctrl.onError = f;
35 } 35 }
36 36
37 void initialize( 37 void initialize(
38 bindings.Proxy shellProxy, List<String> args, String url) { 38 bindings.Proxy shellProxy, List<String> args, String url) {
39 assert(shell == null); 39 assert(shell == null);
40 shell = shellProxy; 40 shell = shellProxy;
41 _application.initialize(args, url); 41 _application.initialize(args, url);
42 } 42 }
43 43
44 @override 44 @override
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 ServiceProviderProxy exposedServices, String resolvedUrl) { 140 ServiceProviderProxy exposedServices, String resolvedUrl) {
141 var connection = new ApplicationConnection(services, exposedServices); 141 var connection = new ApplicationConnection(services, exposedServices);
142 _applicationConnections.add(connection); 142 _applicationConnections.add(connection);
143 acceptConnection(requestorUrl, resolvedUrl, connection); 143 acceptConnection(requestorUrl, resolvedUrl, connection);
144 } 144 }
145 145
146 // Override this method to provide services on |connection|. 146 // Override this method to provide services on |connection|.
147 void acceptConnection(String requestorUrl, String resolvedUrl, 147 void acceptConnection(String requestorUrl, String resolvedUrl,
148 ApplicationConnection connection) {} 148 ApplicationConnection connection) {}
149 } 149 }
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/lib/mojo/shell.mojom.dart ('k') | mojo/dart/packages/mojo/lib/src/application_connection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698