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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.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 library timelines_mojom; 5 library timelines_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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 dynamic getAllTypeDefinitions([Function responseFactory]) => 335 dynamic getAllTypeDefinitions([Function responseFactory]) =>
336 responseFactory(null); 336 responseFactory(null);
337 } 337 }
338 338
339 abstract class TimelineConsumer { 339 abstract class TimelineConsumer {
340 static const String serviceName = null; 340 static const String serviceName = null;
341 dynamic setTimelineTransform(int subjectTime,int referenceDelta,int subjectDel ta,int effectiveReferenceTime,int effectiveSubjectTime,[Function responseFactory = null]); 341 dynamic setTimelineTransform(int subjectTime,int referenceDelta,int subjectDel ta,int effectiveReferenceTime,int effectiveSubjectTime,[Function responseFactory = null]);
342 static const int kUnspecifiedTime = 9223372036854775807; 342 static const int kUnspecifiedTime = 9223372036854775807;
343 } 343 }
344 344
345 345 class _TimelineConsumerProxyControl
346 class _TimelineConsumerProxyControl extends bindings.ProxyMessageHandler 346 extends bindings.ProxyMessageHandler
347 implements bindings.ProxyControl { 347 implements bindings.ProxyControl {
348 _TimelineConsumerProxyControl.fromEndpoint( 348 _TimelineConsumerProxyControl.fromEndpoint(
349 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 349 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
350 350
351 _TimelineConsumerProxyControl.fromHandle( 351 _TimelineConsumerProxyControl.fromHandle(
352 core.MojoHandle handle) : super.fromHandle(handle); 352 core.MojoHandle handle) : super.fromHandle(handle);
353 353
354 _TimelineConsumerProxyControl.unbound() : super.unbound(); 354 _TimelineConsumerProxyControl.unbound() : super.unbound();
355 355
356 service_describer.ServiceDescription get serviceDescription => 356 service_describer.ServiceDescription get serviceDescription =>
357 new _TimelineConsumerServiceDescription(); 357 new _TimelineConsumerServiceDescription();
358 358
359 String get serviceName => TimelineConsumer.serviceName; 359 String get serviceName => TimelineConsumer.serviceName;
360 360
361 @override
362 void handleResponse(bindings.ServiceMessage message) { 361 void handleResponse(bindings.ServiceMessage message) {
363 switch (message.header.type) { 362 switch (message.header.type) {
364 case _timelineConsumerMethodSetTimelineTransformName: 363 case _timelineConsumerMethodSetTimelineTransformName:
365 var r = TimelineConsumerSetTimelineTransformResponseParams.deserialize( 364 var r = TimelineConsumerSetTimelineTransformResponseParams.deserialize(
366 message.payload); 365 message.payload);
367 if (!message.header.hasRequestId) { 366 if (!message.header.hasRequestId) {
368 proxyError("Expected a message with a valid request Id."); 367 proxyError("Expected a message with a valid request Id.");
369 return; 368 return;
370 } 369 }
371 Completer c = completerMap[message.header.requestId]; 370 Completer c = completerMap[message.header.requestId];
(...skipping 16 matching lines...) Expand all
388 } 387 }
389 } 388 }
390 389
391 @override 390 @override
392 String toString() { 391 String toString() {
393 var superString = super.toString(); 392 var superString = super.toString();
394 return "_TimelineConsumerProxyControl($superString)"; 393 return "_TimelineConsumerProxyControl($superString)";
395 } 394 }
396 } 395 }
397 396
398 397 class TimelineConsumerProxy
399 class TimelineConsumerProxy extends bindings.Proxy 398 extends bindings.Proxy
400 implements TimelineConsumer { 399 implements TimelineConsumer {
401 TimelineConsumerProxy.fromEndpoint( 400 TimelineConsumerProxy.fromEndpoint(
402 core.MojoMessagePipeEndpoint endpoint) 401 core.MojoMessagePipeEndpoint endpoint)
403 : super(new _TimelineConsumerProxyControl.fromEndpoint(endpoint)); 402 : super(new _TimelineConsumerProxyControl.fromEndpoint(endpoint));
404 403
405 TimelineConsumerProxy.fromHandle(core.MojoHandle handle) 404 TimelineConsumerProxy.fromHandle(core.MojoHandle handle)
406 : super(new _TimelineConsumerProxyControl.fromHandle(handle)); 405 : super(new _TimelineConsumerProxyControl.fromHandle(handle));
407 406
408 TimelineConsumerProxy.unbound() 407 TimelineConsumerProxy.unbound()
409 : super(new _TimelineConsumerProxyControl.unbound()); 408 : super(new _TimelineConsumerProxyControl.unbound());
410 409
(...skipping 19 matching lines...) Expand all
430 params.effectiveReferenceTime = effectiveReferenceTime; 429 params.effectiveReferenceTime = effectiveReferenceTime;
431 params.effectiveSubjectTime = effectiveSubjectTime; 430 params.effectiveSubjectTime = effectiveSubjectTime;
432 return ctrl.sendMessageWithRequestId( 431 return ctrl.sendMessageWithRequestId(
433 params, 432 params,
434 _timelineConsumerMethodSetTimelineTransformName, 433 _timelineConsumerMethodSetTimelineTransformName,
435 -1, 434 -1,
436 bindings.MessageHeader.kMessageExpectsResponse); 435 bindings.MessageHeader.kMessageExpectsResponse);
437 } 436 }
438 } 437 }
439 438
440 439 class _TimelineConsumerStubControl
441 class TimelineConsumerStub extends bindings.Stub { 440 extends bindings.StubMessageHandler
441 implements bindings.StubControl<TimelineConsumer> {
442 TimelineConsumer _impl; 442 TimelineConsumer _impl;
443 443
444 TimelineConsumerStub.fromEndpoint( 444 _TimelineConsumerStubControl.fromEndpoint(
445 core.MojoMessagePipeEndpoint endpoint, [TimelineConsumer impl]) 445 core.MojoMessagePipeEndpoint endpoint, [TimelineConsumer impl])
446 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 446 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
447 _impl = impl; 447 _impl = impl;
448 } 448 }
449 449
450 TimelineConsumerStub.fromHandle( 450 _TimelineConsumerStubControl.fromHandle(
451 core.MojoHandle handle, [TimelineConsumer impl]) 451 core.MojoHandle handle, [TimelineConsumer impl])
452 : super.fromHandle(handle, autoBegin: impl != null) { 452 : super.fromHandle(handle, autoBegin: impl != null) {
453 _impl = impl; 453 _impl = impl;
454 } 454 }
455 455
456 TimelineConsumerStub.unbound([this._impl]) : super.unbound(); 456 _TimelineConsumerStubControl.unbound([this._impl]) : super.unbound();
457
458 static TimelineConsumerStub newFromEndpoint(
459 core.MojoMessagePipeEndpoint endpoint) {
460 assert(endpoint.setDescription("For TimelineConsumerStub"));
461 return new TimelineConsumerStub.fromEndpoint(endpoint);
462 }
463 457
464 458
465 TimelineConsumerSetTimelineTransformResponseParams _timelineConsumerSetTimelin eTransformResponseParamsFactory(bool completed) { 459 TimelineConsumerSetTimelineTransformResponseParams _timelineConsumerSetTimelin eTransformResponseParamsFactory(bool completed) {
466 var result = new TimelineConsumerSetTimelineTransformResponseParams(); 460 var result = new TimelineConsumerSetTimelineTransformResponseParams();
467 result.completed = completed; 461 result.completed = completed;
468 return result; 462 return result;
469 } 463 }
470 464
471 dynamic handleMessage(bindings.ServiceMessage message) { 465 dynamic handleMessage(bindings.ServiceMessage message) {
472 if (bindings.ControlMessageHandler.isControlMessage(message)) { 466 if (bindings.ControlMessageHandler.isControlMessage(message)) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 } 513 }
520 514
521 @override 515 @override
522 void bind(core.MojoMessagePipeEndpoint endpoint) { 516 void bind(core.MojoMessagePipeEndpoint endpoint) {
523 super.bind(endpoint); 517 super.bind(endpoint);
524 if (!isOpen && (_impl != null)) { 518 if (!isOpen && (_impl != null)) {
525 beginHandlingEvents(); 519 beginHandlingEvents();
526 } 520 }
527 } 521 }
528 522
523 @override
529 String toString() { 524 String toString() {
530 var superString = super.toString(); 525 var superString = super.toString();
531 return "TimelineConsumerStub($superString)"; 526 return "_TimelineConsumerStubControl($superString)";
532 } 527 }
533 528
534 int get version => 0; 529 int get version => 0;
535 530
536 static service_describer.ServiceDescription _cachedServiceDescription; 531 static service_describer.ServiceDescription _cachedServiceDescription;
537 static service_describer.ServiceDescription get serviceDescription { 532 static service_describer.ServiceDescription get serviceDescription {
538 if (_cachedServiceDescription == null) { 533 if (_cachedServiceDescription == null) {
539 _cachedServiceDescription = new _TimelineConsumerServiceDescription(); 534 _cachedServiceDescription = new _TimelineConsumerServiceDescription();
540 } 535 }
541 return _cachedServiceDescription; 536 return _cachedServiceDescription;
542 } 537 }
543 } 538 }
544 539
540 class TimelineConsumerStub
541 extends bindings.Stub<TimelineConsumer>
542 implements TimelineConsumer {
543 TimelineConsumerStub.fromEndpoint(
544 core.MojoMessagePipeEndpoint endpoint, [TimelineConsumer impl])
545 : super(new _TimelineConsumerStubControl.fromEndpoint(endpoint, impl));
546
547 TimelineConsumerStub.fromHandle(
548 core.MojoHandle handle, [TimelineConsumer impl])
549 : super(new _TimelineConsumerStubControl.fromHandle(handle, impl));
550
551 TimelineConsumerStub.unbound([TimelineConsumer impl])
552 : super(new _TimelineConsumerStubControl.unbound(impl));
553
554 static TimelineConsumerStub newFromEndpoint(
555 core.MojoMessagePipeEndpoint endpoint) {
556 assert(endpoint.setDescription("For TimelineConsumerStub"));
557 return new TimelineConsumerStub.fromEndpoint(endpoint);
558 }
559
560 static service_describer.ServiceDescription get serviceDescription =>
561 _TimelineConsumerStubControl.serviceDescription;
562
563
564 dynamic setTimelineTransform(int subjectTime,int referenceDelta,int subjectDel ta,int effectiveReferenceTime,int effectiveSubjectTime,[Function responseFactory = null]) {
565 return impl.setTimelineTransform(subjectTime,referenceDelta,subjectDelta,eff ectiveReferenceTime,effectiveSubjectTime,responseFactory);
566 }
567 }
568
545 569
546 570
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698