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

Unified Diff: mojo/dart/packages/mojo_services/lib/mojo/ui/view_token.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 side-by-side diff with in-line comments
Download patch
Index: mojo/dart/packages/mojo_services/lib/mojo/ui/view_token.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/ui/view_token.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/ui/view_token.mojom.dart
index 125ef8f7c68600495e763137ffb73a3ee6b5e146..c327087da6457dea5769d20b1533c60d317995b6 100644
--- a/mojo/dart/packages/mojo_services/lib/mojo/ui/view_token.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/mojo/ui/view_token.mojom.dart
@@ -230,9 +230,9 @@ abstract class ViewOwner {
dynamic getToken([Function responseFactory = null]);
}
-
-class _ViewOwnerProxyControl extends bindings.ProxyMessageHandler
- implements bindings.ProxyControl {
+class _ViewOwnerProxyControl
+ extends bindings.ProxyMessageHandler
+ implements bindings.ProxyControl {
_ViewOwnerProxyControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
@@ -246,7 +246,6 @@ class _ViewOwnerProxyControl extends bindings.ProxyMessageHandler
String get serviceName => ViewOwner.serviceName;
- @override
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
case _viewOwnerMethodGetTokenName:
@@ -283,9 +282,9 @@ class _ViewOwnerProxyControl extends bindings.ProxyMessageHandler
}
}
-
-class ViewOwnerProxy extends bindings.Proxy
- implements ViewOwner {
+class ViewOwnerProxy
+ extends bindings.Proxy
+ implements ViewOwner {
ViewOwnerProxy.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint)
: super(new _ViewOwnerProxyControl.fromEndpoint(endpoint));
@@ -320,29 +319,24 @@ class ViewOwnerProxy extends bindings.Proxy
}
}
-
-class ViewOwnerStub extends bindings.Stub {
+class _ViewOwnerStubControl
+ extends bindings.StubMessageHandler
+ implements bindings.StubControl<ViewOwner> {
ViewOwner _impl;
- ViewOwnerStub.fromEndpoint(
+ _ViewOwnerStubControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint, [ViewOwner impl])
: super.fromEndpoint(endpoint, autoBegin: impl != null) {
_impl = impl;
}
- ViewOwnerStub.fromHandle(
+ _ViewOwnerStubControl.fromHandle(
core.MojoHandle handle, [ViewOwner impl])
: super.fromHandle(handle, autoBegin: impl != null) {
_impl = impl;
}
- ViewOwnerStub.unbound([this._impl]) : super.unbound();
-
- static ViewOwnerStub newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For ViewOwnerStub"));
- return new ViewOwnerStub.fromEndpoint(endpoint);
- }
+ _ViewOwnerStubControl.unbound([this._impl]) : super.unbound();
ViewOwnerGetTokenResponseParams _viewOwnerGetTokenResponseParamsFactory(ViewToken token) {
@@ -407,9 +401,10 @@ class ViewOwnerStub extends bindings.Stub {
}
}
+ @override
String toString() {
var superString = super.toString();
- return "ViewOwnerStub($superString)";
+ return "_ViewOwnerStubControl($superString)";
}
int get version => 0;
@@ -423,5 +418,34 @@ class ViewOwnerStub extends bindings.Stub {
}
}
+class ViewOwnerStub
+ extends bindings.Stub<ViewOwner>
+ implements ViewOwner {
+ ViewOwnerStub.fromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint, [ViewOwner impl])
+ : super(new _ViewOwnerStubControl.fromEndpoint(endpoint, impl));
+
+ ViewOwnerStub.fromHandle(
+ core.MojoHandle handle, [ViewOwner impl])
+ : super(new _ViewOwnerStubControl.fromHandle(handle, impl));
+
+ ViewOwnerStub.unbound([ViewOwner impl])
+ : super(new _ViewOwnerStubControl.unbound(impl));
+
+ static ViewOwnerStub newFromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint) {
+ assert(endpoint.setDescription("For ViewOwnerStub"));
+ return new ViewOwnerStub.fromEndpoint(endpoint);
+ }
+
+ static service_describer.ServiceDescription get serviceDescription =>
+ _ViewOwnerStubControl.serviceDescription;
+
+
+ dynamic getToken([Function responseFactory = null]) {
+ return impl.getToken(responseFactory);
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698