| 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 library application_connector_mojom; | 5 library application_connector_mojom; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
| 10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 11 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; | 13 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; |
| 12 | 14 |
| 13 | 15 |
| 14 | 16 |
| 15 class _ApplicationConnectorConnectToApplicationParams extends bindings.Struct { | 17 class _ApplicationConnectorConnectToApplicationParams extends bindings.Struct { |
| 16 static const List<bindings.StructDataHeader> kVersions = const [ | 18 static const List<bindings.StructDataHeader> kVersions = const [ |
| 17 const bindings.StructDataHeader(32, 0) | 19 const bindings.StructDataHeader(32, 0) |
| 18 ]; | 20 ]; |
| 19 String applicationUrl = null; | 21 String applicationUrl = null; |
| 20 Object services = null; | 22 Object services = null; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 "exposedServices: $exposedServices" ")"; | 89 "exposedServices: $exposedServices" ")"; |
| 88 } | 90 } |
| 89 | 91 |
| 90 Map toJson() { | 92 Map toJson() { |
| 91 throw new bindings.MojoCodecError( | 93 throw new bindings.MojoCodecError( |
| 92 'Object containing handles cannot be encoded to JSON.'); | 94 'Object containing handles cannot be encoded to JSON.'); |
| 93 } | 95 } |
| 94 } | 96 } |
| 95 | 97 |
| 96 | 98 |
| 99 |
| 100 |
| 97 class _ApplicationConnectorDuplicateParams extends bindings.Struct { | 101 class _ApplicationConnectorDuplicateParams extends bindings.Struct { |
| 98 static const List<bindings.StructDataHeader> kVersions = const [ | 102 static const List<bindings.StructDataHeader> kVersions = const [ |
| 99 const bindings.StructDataHeader(16, 0) | 103 const bindings.StructDataHeader(16, 0) |
| 100 ]; | 104 ]; |
| 101 Object applicationConnectorRequest = null; | 105 Object applicationConnectorRequest = null; |
| 102 | 106 |
| 103 _ApplicationConnectorDuplicateParams() : super(kVersions.last.size); | 107 _ApplicationConnectorDuplicateParams() : super(kVersions.last.size); |
| 104 | 108 |
| 105 static _ApplicationConnectorDuplicateParams deserialize(bindings.Message messa
ge) { | 109 static _ApplicationConnectorDuplicateParams deserialize(bindings.Message messa
ge) { |
| 106 var decoder = new bindings.Decoder(message); | 110 var decoder = new bindings.Decoder(message); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return "_ApplicationConnectorDuplicateParams(" | 156 return "_ApplicationConnectorDuplicateParams(" |
| 153 "applicationConnectorRequest: $applicationConnectorRequest" ")"; | 157 "applicationConnectorRequest: $applicationConnectorRequest" ")"; |
| 154 } | 158 } |
| 155 | 159 |
| 156 Map toJson() { | 160 Map toJson() { |
| 157 throw new bindings.MojoCodecError( | 161 throw new bindings.MojoCodecError( |
| 158 'Object containing handles cannot be encoded to JSON.'); | 162 'Object containing handles cannot be encoded to JSON.'); |
| 159 } | 163 } |
| 160 } | 164 } |
| 161 | 165 |
| 166 |
| 167 |
| 168 |
| 162 const int _ApplicationConnector_connectToApplicationName = 0; | 169 const int _ApplicationConnector_connectToApplicationName = 0; |
| 163 const int _ApplicationConnector_duplicateName = 1; | 170 const int _ApplicationConnector_duplicateName = 1; |
| 164 | 171 |
| 172 |
| 173 |
| 174 class _ApplicationConnectorServiceDescription implements service_describer.Servi
ceDescription { |
| 175 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 176 |
| 177 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 178 |
| 179 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 180 } |
| 181 |
| 165 abstract class ApplicationConnector { | 182 abstract class ApplicationConnector { |
| 166 static const String serviceName = null; | 183 static const String serviceName = null; |
| 167 void connectToApplication(String applicationUrl, Object services, Object expos
edServices); | 184 void connectToApplication(String applicationUrl, Object services, Object expos
edServices); |
| 168 void duplicate(Object applicationConnectorRequest); | 185 void duplicate(Object applicationConnectorRequest); |
| 169 } | 186 } |
| 170 | 187 |
| 171 | 188 |
| 172 class _ApplicationConnectorProxyImpl extends bindings.Proxy { | 189 class _ApplicationConnectorProxyImpl extends bindings.Proxy { |
| 173 _ApplicationConnectorProxyImpl.fromEndpoint( | 190 _ApplicationConnectorProxyImpl.fromEndpoint( |
| 174 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 191 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 175 | 192 |
| 176 _ApplicationConnectorProxyImpl.fromHandle(core.MojoHandle handle) : | 193 _ApplicationConnectorProxyImpl.fromHandle(core.MojoHandle handle) : |
| 177 super.fromHandle(handle); | 194 super.fromHandle(handle); |
| 178 | 195 |
| 179 _ApplicationConnectorProxyImpl.unbound() : super.unbound(); | 196 _ApplicationConnectorProxyImpl.unbound() : super.unbound(); |
| 180 | 197 |
| 181 static _ApplicationConnectorProxyImpl newFromEndpoint( | 198 static _ApplicationConnectorProxyImpl newFromEndpoint( |
| 182 core.MojoMessagePipeEndpoint endpoint) { | 199 core.MojoMessagePipeEndpoint endpoint) { |
| 183 assert(endpoint.setDescription("For _ApplicationConnectorProxyImpl")); | 200 assert(endpoint.setDescription("For _ApplicationConnectorProxyImpl")); |
| 184 return new _ApplicationConnectorProxyImpl.fromEndpoint(endpoint); | 201 return new _ApplicationConnectorProxyImpl.fromEndpoint(endpoint); |
| 185 } | 202 } |
| 186 | 203 |
| 204 service_describer.ServiceDescription get serviceDescription => |
| 205 new _ApplicationConnectorServiceDescription(); |
| 206 |
| 187 void handleResponse(bindings.ServiceMessage message) { | 207 void handleResponse(bindings.ServiceMessage message) { |
| 188 switch (message.header.type) { | 208 switch (message.header.type) { |
| 189 default: | 209 default: |
| 190 proxyError("Unexpected message type: ${message.header.type}"); | 210 proxyError("Unexpected message type: ${message.header.type}"); |
| 191 close(immediate: true); | 211 close(immediate: true); |
| 192 break; | 212 break; |
| 193 } | 213 } |
| 194 } | 214 } |
| 195 | 215 |
| 196 String toString() { | 216 String toString() { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 assert(_impl == null); | 356 assert(_impl == null); |
| 337 _impl = d; | 357 _impl = d; |
| 338 } | 358 } |
| 339 | 359 |
| 340 String toString() { | 360 String toString() { |
| 341 var superString = super.toString(); | 361 var superString = super.toString(); |
| 342 return "ApplicationConnectorStub($superString)"; | 362 return "ApplicationConnectorStub($superString)"; |
| 343 } | 363 } |
| 344 | 364 |
| 345 int get version => 0; | 365 int get version => 0; |
| 366 |
| 367 service_describer.ServiceDescription get serviceDescription => |
| 368 new _ApplicationConnectorServiceDescription(); |
| 346 } | 369 } |
| 347 | 370 |
| 348 | 371 |
| 372 |
| OLD | NEW |