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 view_token_mojom; | 5 library view_token_mojom; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
10 | 10 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 dynamic getAllTypeDefinitions([Function responseFactory]) => | 224 dynamic getAllTypeDefinitions([Function responseFactory]) => |
225 responseFactory(null); | 225 responseFactory(null); |
226 } | 226 } |
227 | 227 |
228 abstract class ViewOwner { | 228 abstract class ViewOwner { |
229 static const String serviceName = null; | 229 static const String serviceName = null; |
230 dynamic getToken([Function responseFactory = null]); | 230 dynamic getToken([Function responseFactory = null]); |
231 } | 231 } |
232 | 232 |
233 | 233 class _ViewOwnerProxyControl |
234 class _ViewOwnerProxyControl extends bindings.ProxyMessageHandler | 234 extends bindings.ProxyMessageHandler |
235 implements bindings.ProxyControl { | 235 implements bindings.ProxyControl { |
236 _ViewOwnerProxyControl.fromEndpoint( | 236 _ViewOwnerProxyControl.fromEndpoint( |
237 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 237 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
238 | 238 |
239 _ViewOwnerProxyControl.fromHandle( | 239 _ViewOwnerProxyControl.fromHandle( |
240 core.MojoHandle handle) : super.fromHandle(handle); | 240 core.MojoHandle handle) : super.fromHandle(handle); |
241 | 241 |
242 _ViewOwnerProxyControl.unbound() : super.unbound(); | 242 _ViewOwnerProxyControl.unbound() : super.unbound(); |
243 | 243 |
244 service_describer.ServiceDescription get serviceDescription => | 244 service_describer.ServiceDescription get serviceDescription => |
245 new _ViewOwnerServiceDescription(); | 245 new _ViewOwnerServiceDescription(); |
246 | 246 |
247 String get serviceName => ViewOwner.serviceName; | 247 String get serviceName => ViewOwner.serviceName; |
248 | 248 |
249 @override | |
250 void handleResponse(bindings.ServiceMessage message) { | 249 void handleResponse(bindings.ServiceMessage message) { |
251 switch (message.header.type) { | 250 switch (message.header.type) { |
252 case _viewOwnerMethodGetTokenName: | 251 case _viewOwnerMethodGetTokenName: |
253 var r = ViewOwnerGetTokenResponseParams.deserialize( | 252 var r = ViewOwnerGetTokenResponseParams.deserialize( |
254 message.payload); | 253 message.payload); |
255 if (!message.header.hasRequestId) { | 254 if (!message.header.hasRequestId) { |
256 proxyError("Expected a message with a valid request Id."); | 255 proxyError("Expected a message with a valid request Id."); |
257 return; | 256 return; |
258 } | 257 } |
259 Completer c = completerMap[message.header.requestId]; | 258 Completer c = completerMap[message.header.requestId]; |
(...skipping 16 matching lines...) Expand all Loading... |
276 } | 275 } |
277 } | 276 } |
278 | 277 |
279 @override | 278 @override |
280 String toString() { | 279 String toString() { |
281 var superString = super.toString(); | 280 var superString = super.toString(); |
282 return "_ViewOwnerProxyControl($superString)"; | 281 return "_ViewOwnerProxyControl($superString)"; |
283 } | 282 } |
284 } | 283 } |
285 | 284 |
286 | 285 class ViewOwnerProxy |
287 class ViewOwnerProxy extends bindings.Proxy | 286 extends bindings.Proxy |
288 implements ViewOwner { | 287 implements ViewOwner { |
289 ViewOwnerProxy.fromEndpoint( | 288 ViewOwnerProxy.fromEndpoint( |
290 core.MojoMessagePipeEndpoint endpoint) | 289 core.MojoMessagePipeEndpoint endpoint) |
291 : super(new _ViewOwnerProxyControl.fromEndpoint(endpoint)); | 290 : super(new _ViewOwnerProxyControl.fromEndpoint(endpoint)); |
292 | 291 |
293 ViewOwnerProxy.fromHandle(core.MojoHandle handle) | 292 ViewOwnerProxy.fromHandle(core.MojoHandle handle) |
294 : super(new _ViewOwnerProxyControl.fromHandle(handle)); | 293 : super(new _ViewOwnerProxyControl.fromHandle(handle)); |
295 | 294 |
296 ViewOwnerProxy.unbound() | 295 ViewOwnerProxy.unbound() |
297 : super(new _ViewOwnerProxyControl.unbound()); | 296 : super(new _ViewOwnerProxyControl.unbound()); |
298 | 297 |
(...skipping 14 matching lines...) Expand all Loading... |
313 dynamic getToken([Function responseFactory = null]) { | 312 dynamic getToken([Function responseFactory = null]) { |
314 var params = new _ViewOwnerGetTokenParams(); | 313 var params = new _ViewOwnerGetTokenParams(); |
315 return ctrl.sendMessageWithRequestId( | 314 return ctrl.sendMessageWithRequestId( |
316 params, | 315 params, |
317 _viewOwnerMethodGetTokenName, | 316 _viewOwnerMethodGetTokenName, |
318 -1, | 317 -1, |
319 bindings.MessageHeader.kMessageExpectsResponse); | 318 bindings.MessageHeader.kMessageExpectsResponse); |
320 } | 319 } |
321 } | 320 } |
322 | 321 |
323 | 322 class _ViewOwnerStubControl |
324 class ViewOwnerStub extends bindings.Stub { | 323 extends bindings.StubMessageHandler |
| 324 implements bindings.StubControl<ViewOwner> { |
325 ViewOwner _impl; | 325 ViewOwner _impl; |
326 | 326 |
327 ViewOwnerStub.fromEndpoint( | 327 _ViewOwnerStubControl.fromEndpoint( |
328 core.MojoMessagePipeEndpoint endpoint, [ViewOwner impl]) | 328 core.MojoMessagePipeEndpoint endpoint, [ViewOwner impl]) |
329 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 329 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
330 _impl = impl; | 330 _impl = impl; |
331 } | 331 } |
332 | 332 |
333 ViewOwnerStub.fromHandle( | 333 _ViewOwnerStubControl.fromHandle( |
334 core.MojoHandle handle, [ViewOwner impl]) | 334 core.MojoHandle handle, [ViewOwner impl]) |
335 : super.fromHandle(handle, autoBegin: impl != null) { | 335 : super.fromHandle(handle, autoBegin: impl != null) { |
336 _impl = impl; | 336 _impl = impl; |
337 } | 337 } |
338 | 338 |
339 ViewOwnerStub.unbound([this._impl]) : super.unbound(); | 339 _ViewOwnerStubControl.unbound([this._impl]) : super.unbound(); |
340 | |
341 static ViewOwnerStub newFromEndpoint( | |
342 core.MojoMessagePipeEndpoint endpoint) { | |
343 assert(endpoint.setDescription("For ViewOwnerStub")); | |
344 return new ViewOwnerStub.fromEndpoint(endpoint); | |
345 } | |
346 | 340 |
347 | 341 |
348 ViewOwnerGetTokenResponseParams _viewOwnerGetTokenResponseParamsFactory(ViewTo
ken token) { | 342 ViewOwnerGetTokenResponseParams _viewOwnerGetTokenResponseParamsFactory(ViewTo
ken token) { |
349 var result = new ViewOwnerGetTokenResponseParams(); | 343 var result = new ViewOwnerGetTokenResponseParams(); |
350 result.token = token; | 344 result.token = token; |
351 return result; | 345 return result; |
352 } | 346 } |
353 | 347 |
354 dynamic handleMessage(bindings.ServiceMessage message) { | 348 dynamic handleMessage(bindings.ServiceMessage message) { |
355 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 349 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } | 394 } |
401 | 395 |
402 @override | 396 @override |
403 void bind(core.MojoMessagePipeEndpoint endpoint) { | 397 void bind(core.MojoMessagePipeEndpoint endpoint) { |
404 super.bind(endpoint); | 398 super.bind(endpoint); |
405 if (!isOpen && (_impl != null)) { | 399 if (!isOpen && (_impl != null)) { |
406 beginHandlingEvents(); | 400 beginHandlingEvents(); |
407 } | 401 } |
408 } | 402 } |
409 | 403 |
| 404 @override |
410 String toString() { | 405 String toString() { |
411 var superString = super.toString(); | 406 var superString = super.toString(); |
412 return "ViewOwnerStub($superString)"; | 407 return "_ViewOwnerStubControl($superString)"; |
413 } | 408 } |
414 | 409 |
415 int get version => 0; | 410 int get version => 0; |
416 | 411 |
417 static service_describer.ServiceDescription _cachedServiceDescription; | 412 static service_describer.ServiceDescription _cachedServiceDescription; |
418 static service_describer.ServiceDescription get serviceDescription { | 413 static service_describer.ServiceDescription get serviceDescription { |
419 if (_cachedServiceDescription == null) { | 414 if (_cachedServiceDescription == null) { |
420 _cachedServiceDescription = new _ViewOwnerServiceDescription(); | 415 _cachedServiceDescription = new _ViewOwnerServiceDescription(); |
421 } | 416 } |
422 return _cachedServiceDescription; | 417 return _cachedServiceDescription; |
423 } | 418 } |
424 } | 419 } |
425 | 420 |
| 421 class ViewOwnerStub |
| 422 extends bindings.Stub<ViewOwner> |
| 423 implements ViewOwner { |
| 424 ViewOwnerStub.fromEndpoint( |
| 425 core.MojoMessagePipeEndpoint endpoint, [ViewOwner impl]) |
| 426 : super(new _ViewOwnerStubControl.fromEndpoint(endpoint, impl)); |
| 427 |
| 428 ViewOwnerStub.fromHandle( |
| 429 core.MojoHandle handle, [ViewOwner impl]) |
| 430 : super(new _ViewOwnerStubControl.fromHandle(handle, impl)); |
| 431 |
| 432 ViewOwnerStub.unbound([ViewOwner impl]) |
| 433 : super(new _ViewOwnerStubControl.unbound(impl)); |
| 434 |
| 435 static ViewOwnerStub newFromEndpoint( |
| 436 core.MojoMessagePipeEndpoint endpoint) { |
| 437 assert(endpoint.setDescription("For ViewOwnerStub")); |
| 438 return new ViewOwnerStub.fromEndpoint(endpoint); |
| 439 } |
| 440 |
| 441 static service_describer.ServiceDescription get serviceDescription => |
| 442 _ViewOwnerStubControl.serviceDescription; |
| 443 |
| 444 |
| 445 dynamic getToken([Function responseFactory = null]) { |
| 446 return impl.getToken(responseFactory); |
| 447 } |
| 448 } |
| 449 |
426 | 450 |
427 | 451 |
OLD | NEW |