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

Unified Diff: mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.dart

Issue 1964193002: Dart: Refactors Proxies (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address comments 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 side-by-side diff with in-line comments
Download patch
Index: mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.dart
index db683eb6f19a6958389dbe4a67b385e510047891..077297d634d92fa1a2e8e9cfda7068cf580dde18 100644
--- a/mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/mojo/timelines.mojom.dart
@@ -343,24 +343,22 @@ abstract class TimelineConsumer {
}
-class _TimelineConsumerProxyImpl extends bindings.Proxy {
- _TimelineConsumerProxyImpl.fromEndpoint(
+class _TimelineConsumerProxyControl extends bindings.ProxyMessageHandler
+ implements bindings.ProxyControl {
+ _TimelineConsumerProxyControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
- _TimelineConsumerProxyImpl.fromHandle(core.MojoHandle handle) :
- super.fromHandle(handle);
+ _TimelineConsumerProxyControl.fromHandle(
+ core.MojoHandle handle) : super.fromHandle(handle);
- _TimelineConsumerProxyImpl.unbound() : super.unbound();
-
- static _TimelineConsumerProxyImpl newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For _TimelineConsumerProxyImpl"));
- return new _TimelineConsumerProxyImpl.fromEndpoint(endpoint);
- }
+ _TimelineConsumerProxyControl.unbound() : super.unbound();
service_describer.ServiceDescription get serviceDescription =>
- new _TimelineConsumerServiceDescription();
+ new _TimelineConsumerServiceDescription();
+
+ String get serviceName => TimelineConsumer.serviceName;
+ @override
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
case _timelineConsumerMethodSetTimelineTransformName:
@@ -390,55 +388,30 @@ class _TimelineConsumerProxyImpl extends bindings.Proxy {
}
}
+ @override
String toString() {
var superString = super.toString();
- return "_TimelineConsumerProxyImpl($superString)";
+ return "_TimelineConsumerProxyControl($superString)";
}
}
-class _TimelineConsumerProxyCalls implements TimelineConsumer {
- _TimelineConsumerProxyImpl _proxyImpl;
-
- _TimelineConsumerProxyCalls(this._proxyImpl);
- dynamic setTimelineTransform(int subjectTime,int referenceDelta,int subjectDelta,int effectiveReferenceTime,int effectiveSubjectTime,[Function responseFactory = null]) {
- var params = new _TimelineConsumerSetTimelineTransformParams();
- params.subjectTime = subjectTime;
- params.referenceDelta = referenceDelta;
- params.subjectDelta = subjectDelta;
- params.effectiveReferenceTime = effectiveReferenceTime;
- params.effectiveSubjectTime = effectiveSubjectTime;
- return _proxyImpl.sendMessageWithRequestId(
- params,
- _timelineConsumerMethodSetTimelineTransformName,
- -1,
- bindings.MessageHeader.kMessageExpectsResponse);
- }
-}
-
-
-class TimelineConsumerProxy implements bindings.ProxyBase {
- final bindings.Proxy impl;
- TimelineConsumer ptr;
-
- TimelineConsumerProxy(_TimelineConsumerProxyImpl proxyImpl) :
- impl = proxyImpl,
- ptr = new _TimelineConsumerProxyCalls(proxyImpl);
-
+class TimelineConsumerProxy extends bindings.Proxy
+ implements TimelineConsumer {
TimelineConsumerProxy.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) :
- impl = new _TimelineConsumerProxyImpl.fromEndpoint(endpoint) {
- ptr = new _TimelineConsumerProxyCalls(impl);
- }
+ core.MojoMessagePipeEndpoint endpoint)
+ : super(new _TimelineConsumerProxyControl.fromEndpoint(endpoint));
- TimelineConsumerProxy.fromHandle(core.MojoHandle handle) :
- impl = new _TimelineConsumerProxyImpl.fromHandle(handle) {
- ptr = new _TimelineConsumerProxyCalls(impl);
- }
+ TimelineConsumerProxy.fromHandle(core.MojoHandle handle)
+ : super(new _TimelineConsumerProxyControl.fromHandle(handle));
- TimelineConsumerProxy.unbound() :
- impl = new _TimelineConsumerProxyImpl.unbound() {
- ptr = new _TimelineConsumerProxyCalls(impl);
+ TimelineConsumerProxy.unbound()
+ : super(new _TimelineConsumerProxyControl.unbound());
+
+ static TimelineConsumerProxy newFromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint) {
+ assert(endpoint.setDescription("For TimelineConsumerProxy"));
+ return new TimelineConsumerProxy.fromEndpoint(endpoint);
}
factory TimelineConsumerProxy.connectToService(
@@ -448,30 +421,19 @@ class TimelineConsumerProxy implements bindings.ProxyBase {
return p;
}
- static TimelineConsumerProxy newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For TimelineConsumerProxy"));
- return new TimelineConsumerProxy.fromEndpoint(endpoint);
- }
-
- String get serviceName => TimelineConsumer.serviceName;
-
- Future close({bool immediate: false}) => impl.close(immediate: immediate);
-
- Future responseOrError(Future f) => impl.responseOrError(f);
-
- Future get errorFuture => impl.errorFuture;
-
- int get version => impl.version;
- Future<int> queryVersion() => impl.queryVersion();
-
- void requireVersion(int requiredVersion) {
- impl.requireVersion(requiredVersion);
- }
-
- String toString() {
- return "TimelineConsumerProxy($impl)";
+ dynamic setTimelineTransform(int subjectTime,int referenceDelta,int subjectDelta,int effectiveReferenceTime,int effectiveSubjectTime,[Function responseFactory = null]) {
+ var params = new _TimelineConsumerSetTimelineTransformParams();
+ params.subjectTime = subjectTime;
+ params.referenceDelta = referenceDelta;
+ params.subjectDelta = subjectDelta;
+ params.effectiveReferenceTime = effectiveReferenceTime;
+ params.effectiveSubjectTime = effectiveSubjectTime;
+ return ctrl.sendMessageWithRequestId(
+ params,
+ _timelineConsumerMethodSetTimelineTransformName,
+ -1,
+ bindings.MessageHeader.kMessageExpectsResponse);
}
}

Powered by Google App Engine
This is Rietveld 408576698