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

Unified Diff: mojo/dart/packages/mojo_services/lib/mojo/cookie_store.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/cookie_store.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart
index 9aa64cefebfbe3b79d3b20d193ad39bdf17f1cc6..d6db717d27a610472f75331161a73a92426793c3 100644
--- a/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart
@@ -331,9 +331,9 @@ abstract class CookieStore {
dynamic set(String url,String cookie,[Function responseFactory = null]);
}
-
-class _CookieStoreProxyControl extends bindings.ProxyMessageHandler
- implements bindings.ProxyControl {
+class _CookieStoreProxyControl
+ extends bindings.ProxyMessageHandler
+ implements bindings.ProxyControl {
_CookieStoreProxyControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
@@ -347,7 +347,6 @@ class _CookieStoreProxyControl extends bindings.ProxyMessageHandler
String get serviceName => CookieStore.serviceName;
- @override
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
case _cookieStoreMethodGetName:
@@ -404,9 +403,9 @@ class _CookieStoreProxyControl extends bindings.ProxyMessageHandler
}
}
-
-class CookieStoreProxy extends bindings.Proxy
- implements CookieStore {
+class CookieStoreProxy
+ extends bindings.Proxy
+ implements CookieStore {
CookieStoreProxy.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint)
: super(new _CookieStoreProxyControl.fromEndpoint(endpoint));
@@ -452,29 +451,24 @@ class CookieStoreProxy extends bindings.Proxy
}
}
-
-class CookieStoreStub extends bindings.Stub {
+class _CookieStoreStubControl
+ extends bindings.StubMessageHandler
+ implements bindings.StubControl<CookieStore> {
CookieStore _impl;
- CookieStoreStub.fromEndpoint(
+ _CookieStoreStubControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint, [CookieStore impl])
: super.fromEndpoint(endpoint, autoBegin: impl != null) {
_impl = impl;
}
- CookieStoreStub.fromHandle(
+ _CookieStoreStubControl.fromHandle(
core.MojoHandle handle, [CookieStore impl])
: super.fromHandle(handle, autoBegin: impl != null) {
_impl = impl;
}
- CookieStoreStub.unbound([this._impl]) : super.unbound();
-
- static CookieStoreStub newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For CookieStoreStub"));
- return new CookieStoreStub.fromEndpoint(endpoint);
- }
+ _CookieStoreStubControl.unbound([this._impl]) : super.unbound();
CookieStoreGetResponseParams _cookieStoreGetResponseParamsFactory(String cookies) {
@@ -568,9 +562,10 @@ class CookieStoreStub extends bindings.Stub {
}
}
+ @override
String toString() {
var superString = super.toString();
- return "CookieStoreStub($superString)";
+ return "_CookieStoreStubControl($superString)";
}
int get version => 0;
@@ -584,5 +579,37 @@ class CookieStoreStub extends bindings.Stub {
}
}
+class CookieStoreStub
+ extends bindings.Stub<CookieStore>
+ implements CookieStore {
+ CookieStoreStub.fromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint, [CookieStore impl])
+ : super(new _CookieStoreStubControl.fromEndpoint(endpoint, impl));
+
+ CookieStoreStub.fromHandle(
+ core.MojoHandle handle, [CookieStore impl])
+ : super(new _CookieStoreStubControl.fromHandle(handle, impl));
+
+ CookieStoreStub.unbound([CookieStore impl])
+ : super(new _CookieStoreStubControl.unbound(impl));
+
+ static CookieStoreStub newFromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint) {
+ assert(endpoint.setDescription("For CookieStoreStub"));
+ return new CookieStoreStub.fromEndpoint(endpoint);
+ }
+
+ static service_describer.ServiceDescription get serviceDescription =>
+ _CookieStoreStubControl.serviceDescription;
+
+
+ dynamic get(String url,[Function responseFactory = null]) {
+ return impl.get(url,responseFactory);
+ }
+ dynamic set(String url,String cookie,[Function responseFactory = null]) {
+ return impl.set(url,cookie,responseFactory);
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698