Chromium Code Reviews| OLD | NEW |
|---|---|
| 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; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 ..listen(); | 24 ..listen(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void initialize(bindings.ProxyBase shellProxy, List<String> args, | 27 void initialize(bindings.ProxyBase shellProxy, List<String> args, |
| 28 String url) { | 28 String url) { |
| 29 assert(shell == null); | 29 assert(shell == null); |
| 30 shell = shellProxy; | 30 shell = shellProxy; |
| 31 _application.initialize(args, url); | 31 _application.initialize(args, url); |
| 32 } | 32 } |
| 33 | 33 |
| 34 @override | |
| 34 void acceptConnection(String requestorUrl, ServiceProviderStub services, | 35 void acceptConnection(String requestorUrl, ServiceProviderStub services, |
| 35 bindings.ProxyBase exposedServices, String requested_url) => | 36 bindings.ProxyBase exposedServices, String resolvedUrl) => |
|
sky
2015/03/03 22:48:54
I'm not particularly thrilled about resolvedUrl, b
| |
| 36 _application._acceptConnection(requestorUrl, services, exposedServices); | 37 _application._acceptConnection(requestorUrl, services, exposedServices, |
| 38 resolvedUrl); | |
| 37 | 39 |
| 40 @override | |
| 38 void requestQuit() => _application._requestQuitAndClose(); | 41 void requestQuit() => _application._requestQuitAndClose(); |
| 39 | 42 |
| 40 void close({bool nodefer: false}) => shell.close(); | 43 void close({bool nodefer: false}) => shell.close(); |
| 41 } | 44 } |
| 42 | 45 |
| 43 // TODO(zra): Better documentation and examples. | 46 // TODO(zra): Better documentation and examples. |
| 44 // To implement, do the following: | 47 // To implement, do the following: |
| 45 // - Optionally override initialize() to process command-line args. | 48 // - Optionally override initialize() to process command-line args. |
| 46 // - Optionally override acceptConnection() if services are to be provided. | 49 // - Optionally override acceptConnection() if services are to be provided. |
| 47 // - Optionally override close() to clean up application resources. | 50 // - Optionally override close() to clean up application resources. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 } | 92 } |
| 90 | 93 |
| 91 void close() { | 94 void close() { |
| 92 assert(_applicationImpl != null); | 95 assert(_applicationImpl != null); |
| 93 _applicationConnections.forEach((c) => c.close()); | 96 _applicationConnections.forEach((c) => c.close()); |
| 94 _applicationConnections.clear(); | 97 _applicationConnections.clear(); |
| 95 _applicationImpl.close(); | 98 _applicationImpl.close(); |
| 96 } | 99 } |
| 97 | 100 |
| 98 void _acceptConnection(String requestorUrl, ServiceProviderStub services, | 101 void _acceptConnection(String requestorUrl, ServiceProviderStub services, |
| 99 ServiceProviderProxy exposedServices) { | 102 ServiceProviderProxy exposedServices, String resolvedUrl) { |
| 100 var connection = new ApplicationConnection(services, exposedServices); | 103 var connection = new ApplicationConnection(services, exposedServices); |
| 101 _applicationConnections.add(connection); | 104 _applicationConnections.add(connection); |
| 102 acceptConnection(requestorUrl, connection); | 105 acceptConnection(requestorUrl, resolvedUrl, connection); |
| 103 } | 106 } |
| 104 | 107 |
| 105 // Override this method to provide services on |connection|. | 108 // Override this method to provide services on |connection|. |
| 106 // If you provide at least one service or set fallbackServiceProvider, | 109 // If you provide at least one service or set fallbackServiceProvider, |
| 107 // then you must invoke connection.listen(). | 110 // then you must invoke connection.listen(). |
| 108 void acceptConnection(String requestorUrl, ApplicationConnection connection) { | 111 void acceptConnection(String requestorUrl, String resolvedUrl, |
| 112 ApplicationConnection connection) { | |
| 109 } | 113 } |
| 110 } | 114 } |
| OLD | NEW |