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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 close(); | 88 close(); |
89 } | 89 } |
90 | 90 |
91 void close() { | 91 void close() { |
92 assert(_applicationImpl != null); | 92 assert(_applicationImpl != null); |
93 _applicationConnections.forEach((c) => c.close()); | 93 _applicationConnections.forEach((c) => c.close()); |
94 _applicationConnections.clear(); | 94 _applicationConnections.clear(); |
95 _applicationImpl.close(); | 95 _applicationImpl.close(); |
96 } | 96 } |
97 | 97 |
| 98 // This method closes all the application connections. Used during apptesting. |
| 99 resetConnections() { |
| 100 assert(_applicationImpl != null); |
| 101 _applicationConnections.forEach((c) => c.close()); |
| 102 _applicationConnections.clear(); |
| 103 } |
| 104 |
98 void _acceptConnection(String requestorUrl, ServiceProviderStub services, | 105 void _acceptConnection(String requestorUrl, ServiceProviderStub services, |
99 ServiceProviderProxy exposedServices) { | 106 ServiceProviderProxy exposedServices) { |
100 var connection = new ApplicationConnection(services, exposedServices); | 107 var connection = new ApplicationConnection(services, exposedServices); |
101 _applicationConnections.add(connection); | 108 _applicationConnections.add(connection); |
102 acceptConnection(requestorUrl, connection); | 109 acceptConnection(requestorUrl, connection); |
103 } | 110 } |
104 | 111 |
105 // Override this method to provide services on |connection|. | 112 // Override this method to provide services on |connection|. |
106 // If you provide at least one service or set fallbackServiceProvider, | 113 // If you provide at least one service or set fallbackServiceProvider, |
107 // then you must invoke connection.listen(). | 114 // then you must invoke connection.listen(). |
108 void acceptConnection(String requestorUrl, ApplicationConnection connection) { | 115 void acceptConnection(String requestorUrl, ApplicationConnection connection) { |
109 } | 116 } |
110 } | 117 } |
OLD | NEW |