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

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

Issue 1998433002: Dart: Adds Interface and InterfaceRequest interfaces. (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/native_viewport_event_dispatcher.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/native_viewport_event_dispatcher.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/native_viewport_event_dispatcher.mojom.dart
index fd65f52969a9d6fe1d100866e82fe0e7a6684a09..e9d94ac326e98d348a17e60d13b2770b56677c19 100644
--- a/mojo/dart/packages/mojo_services/lib/mojo/native_viewport_event_dispatcher.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/mojo/native_viewport_event_dispatcher.mojom.dart
@@ -156,12 +156,50 @@ class _NativeViewportEventDispatcherServiceDescription implements service_descri
abstract class NativeViewportEventDispatcher {
static const String serviceName = "mojo::NativeViewportEventDispatcher";
+
+ static service_describer.ServiceDescription _cachedServiceDescription;
+ static service_describer.ServiceDescription get serviceDescription {
+ if (_cachedServiceDescription == null) {
+ _cachedServiceDescription = new _NativeViewportEventDispatcherServiceDescription();
+ }
+ return _cachedServiceDescription;
+ }
+
+ static NativeViewportEventDispatcherProxy connectToService(
+ bindings.ServiceConnector s, String url, [String serviceName]) {
+ NativeViewportEventDispatcherProxy p = new NativeViewportEventDispatcherProxy.unbound();
+ String name = serviceName ?? NativeViewportEventDispatcher.serviceName;
+ if ((name == null) || name.isEmpty) {
+ throw new core.MojoApiError(
+ "If an interface has no ServiceName, then one must be provided.");
+ }
+ s.connectToService(url, p, name);
+ return p;
+ }
dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = null]);
}
+abstract class NativeViewportEventDispatcherInterface
+ implements bindings.MojoInterface<NativeViewportEventDispatcher>,
+ NativeViewportEventDispatcher {
+ factory NativeViewportEventDispatcherInterface([NativeViewportEventDispatcher impl]) =>
+ new NativeViewportEventDispatcherStub.unbound(impl);
+ factory NativeViewportEventDispatcherInterface.fromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint,
+ [NativeViewportEventDispatcher impl]) =>
+ new NativeViewportEventDispatcherStub.fromEndpoint(endpoint, impl);
+}
+
+abstract class NativeViewportEventDispatcherInterfaceRequest
+ implements bindings.MojoInterface<NativeViewportEventDispatcher>,
+ NativeViewportEventDispatcher {
+ factory NativeViewportEventDispatcherInterfaceRequest() =>
+ new NativeViewportEventDispatcherProxy.unbound();
+}
+
class _NativeViewportEventDispatcherProxyControl
extends bindings.ProxyMessageHandler
- implements bindings.ProxyControl {
+ implements bindings.ProxyControl<NativeViewportEventDispatcher> {
_NativeViewportEventDispatcherProxyControl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
@@ -170,9 +208,6 @@ class _NativeViewportEventDispatcherProxyControl
_NativeViewportEventDispatcherProxyControl.unbound() : super.unbound();
- service_describer.ServiceDescription get serviceDescription =>
- new _NativeViewportEventDispatcherServiceDescription();
-
String get serviceName => NativeViewportEventDispatcher.serviceName;
void handleResponse(bindings.ServiceMessage message) {
@@ -204,6 +239,11 @@ class _NativeViewportEventDispatcherProxyControl
}
}
+ NativeViewportEventDispatcher get impl => null;
+ set impl(NativeViewportEventDispatcher _) {
+ throw new core.MojoApiError("The impl of a Proxy cannot be set.");
+ }
+
@override
String toString() {
var superString = super.toString();
@@ -212,8 +252,10 @@ class _NativeViewportEventDispatcherProxyControl
}
class NativeViewportEventDispatcherProxy
- extends bindings.Proxy
- implements NativeViewportEventDispatcher {
+ extends bindings.Proxy<NativeViewportEventDispatcher>
+ implements NativeViewportEventDispatcher,
+ NativeViewportEventDispatcherInterface,
+ NativeViewportEventDispatcherInterfaceRequest {
NativeViewportEventDispatcherProxy.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint)
: super(new _NativeViewportEventDispatcherProxyControl.fromEndpoint(endpoint));
@@ -230,13 +272,6 @@ class NativeViewportEventDispatcherProxy
return new NativeViewportEventDispatcherProxy.fromEndpoint(endpoint);
}
- factory NativeViewportEventDispatcherProxy.connectToService(
- bindings.ServiceConnector s, String url, [String serviceName]) {
- NativeViewportEventDispatcherProxy p = new NativeViewportEventDispatcherProxy.unbound();
- s.connectToService(url, p, serviceName);
- return p;
- }
-
dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = null]) {
var params = new _NativeViewportEventDispatcherOnEventParams();
@@ -268,6 +303,8 @@ class _NativeViewportEventDispatcherStubControl
_NativeViewportEventDispatcherStubControl.unbound([this._impl]) : super.unbound();
+ String get serviceName => NativeViewportEventDispatcher.serviceName;
+
NativeViewportEventDispatcherOnEventResponseParams _nativeViewportEventDispatcherOnEventResponseParamsFactory() {
var result = new NativeViewportEventDispatcherOnEventResponseParams();
@@ -339,19 +376,16 @@ class _NativeViewportEventDispatcherStubControl
}
int get version => 0;
-
- static service_describer.ServiceDescription _cachedServiceDescription;
- static service_describer.ServiceDescription get serviceDescription {
- if (_cachedServiceDescription == null) {
- _cachedServiceDescription = new _NativeViewportEventDispatcherServiceDescription();
- }
- return _cachedServiceDescription;
- }
}
class NativeViewportEventDispatcherStub
extends bindings.Stub<NativeViewportEventDispatcher>
- implements NativeViewportEventDispatcher {
+ implements NativeViewportEventDispatcher,
+ NativeViewportEventDispatcherInterface,
+ NativeViewportEventDispatcherInterfaceRequest {
+ NativeViewportEventDispatcherStub.unbound([NativeViewportEventDispatcher impl])
+ : super(new _NativeViewportEventDispatcherStubControl.unbound(impl));
+
NativeViewportEventDispatcherStub.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint, [NativeViewportEventDispatcher impl])
: super(new _NativeViewportEventDispatcherStubControl.fromEndpoint(endpoint, impl));
@@ -360,18 +394,12 @@ class NativeViewportEventDispatcherStub
core.MojoHandle handle, [NativeViewportEventDispatcher impl])
: super(new _NativeViewportEventDispatcherStubControl.fromHandle(handle, impl));
- NativeViewportEventDispatcherStub.unbound([NativeViewportEventDispatcher impl])
- : super(new _NativeViewportEventDispatcherStubControl.unbound(impl));
-
static NativeViewportEventDispatcherStub newFromEndpoint(
core.MojoMessagePipeEndpoint endpoint) {
assert(endpoint.setDescription("For NativeViewportEventDispatcherStub"));
return new NativeViewportEventDispatcherStub.fromEndpoint(endpoint);
}
- static service_describer.ServiceDescription get serviceDescription =>
- _NativeViewportEventDispatcherStubControl.serviceDescription;
-
dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = null]) {
return impl.onEvent(event,responseFactory);

Powered by Google App Engine
This is Rietveld 408576698