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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.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_for_test_only/lib/imported/sample_import.mojom.dart
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
index 0c962c5d89066a93a10440e5cfb6606f6b00088e..bd716d03a8b958a744fcfc7693f7467fea42d816 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
@@ -361,24 +361,22 @@ abstract class ImportedInterface {
}
-class _ImportedInterfaceProxyImpl extends bindings.Proxy {
- _ImportedInterfaceProxyImpl.fromEndpoint(
+class _ImportedInterfaceProxyControl extends bindings.ProxyMessageHandler
+ implements bindings.ProxyControl {
+ _ImportedInterfaceProxyControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
- _ImportedInterfaceProxyImpl.fromHandle(core.MojoHandle handle) :
- super.fromHandle(handle);
+ _ImportedInterfaceProxyControl.fromHandle(
+ core.MojoHandle handle) : super.fromHandle(handle);
- _ImportedInterfaceProxyImpl.unbound() : super.unbound();
-
- static _ImportedInterfaceProxyImpl newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For _ImportedInterfaceProxyImpl"));
- return new _ImportedInterfaceProxyImpl.fromEndpoint(endpoint);
- }
+ _ImportedInterfaceProxyControl.unbound() : super.unbound();
service_describer.ServiceDescription get serviceDescription =>
- new _ImportedInterfaceServiceDescription();
+ new _ImportedInterfaceServiceDescription();
+
+ String get serviceName => ImportedInterface.serviceName;
+ @override
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
default:
@@ -388,50 +386,30 @@ class _ImportedInterfaceProxyImpl extends bindings.Proxy {
}
}
+ @override
String toString() {
var superString = super.toString();
- return "_ImportedInterfaceProxyImpl($superString)";
+ return "_ImportedInterfaceProxyControl($superString)";
}
}
-class _ImportedInterfaceProxyCalls implements ImportedInterface {
- _ImportedInterfaceProxyImpl _proxyImpl;
-
- _ImportedInterfaceProxyCalls(this._proxyImpl);
- void doSomething() {
- if (!_proxyImpl.isBound) {
- _proxyImpl.proxyError("The Proxy is closed.");
- return;
- }
- var params = new _ImportedInterfaceDoSomethingParams();
- _proxyImpl.sendMessage(params, _importedInterfaceMethodDoSomethingName);
- }
-}
-
-
-class ImportedInterfaceProxy implements bindings.ProxyBase {
- final bindings.Proxy impl;
- ImportedInterface ptr;
-
- ImportedInterfaceProxy(_ImportedInterfaceProxyImpl proxyImpl) :
- impl = proxyImpl,
- ptr = new _ImportedInterfaceProxyCalls(proxyImpl);
-
+class ImportedInterfaceProxy extends bindings.Proxy
+ implements ImportedInterface {
ImportedInterfaceProxy.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) :
- impl = new _ImportedInterfaceProxyImpl.fromEndpoint(endpoint) {
- ptr = new _ImportedInterfaceProxyCalls(impl);
- }
+ core.MojoMessagePipeEndpoint endpoint)
+ : super(new _ImportedInterfaceProxyControl.fromEndpoint(endpoint));
- ImportedInterfaceProxy.fromHandle(core.MojoHandle handle) :
- impl = new _ImportedInterfaceProxyImpl.fromHandle(handle) {
- ptr = new _ImportedInterfaceProxyCalls(impl);
- }
+ ImportedInterfaceProxy.fromHandle(core.MojoHandle handle)
+ : super(new _ImportedInterfaceProxyControl.fromHandle(handle));
- ImportedInterfaceProxy.unbound() :
- impl = new _ImportedInterfaceProxyImpl.unbound() {
- ptr = new _ImportedInterfaceProxyCalls(impl);
+ ImportedInterfaceProxy.unbound()
+ : super(new _ImportedInterfaceProxyControl.unbound());
+
+ static ImportedInterfaceProxy newFromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint) {
+ assert(endpoint.setDescription("For ImportedInterfaceProxy"));
+ return new ImportedInterfaceProxy.fromEndpoint(endpoint);
}
factory ImportedInterfaceProxy.connectToService(
@@ -441,30 +419,15 @@ class ImportedInterfaceProxy implements bindings.ProxyBase {
return p;
}
- static ImportedInterfaceProxy newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For ImportedInterfaceProxy"));
- return new ImportedInterfaceProxy.fromEndpoint(endpoint);
- }
-
- String get serviceName => ImportedInterface.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 "ImportedInterfaceProxy($impl)";
+ void doSomething() {
+ if (!ctrl.isBound) {
+ ctrl.proxyError("The Proxy is closed.");
+ return;
+ }
+ var params = new _ImportedInterfaceDoSomethingParams();
+ ctrl.sendMessage(params,
+ _importedInterfaceMethodDoSomethingName);
}
}
@@ -562,7 +525,7 @@ mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() {
// serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of
// a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this
// file. The string contains the base64 encoding of the gzip-compressed bytes.
- var serializedRuntimeTypeInfo = "H4sIAAAJbogC/8yYzW7TQBCA10kLKU2LEf1vARcKBBBxjxWnViUiERWK2hxSLv2LIUb1D7YjwRvwGDwKj9Mjx95gHc9ie7yb2ChxutJoY+84u/PtzHi8KyRoMvTb0OP7rC+hHusRKfyfaSoVuF2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P//jmet5PgXAAA=";
// Deserialize RuntimeTypeInfo
var bytes = BASE64.decode(serializedRuntimeTypeInfo);

Powered by Google App Engine
This is Rietveld 408576698