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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/native_viewport_event_dispatcher.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library native_viewport_event_dispatcher_mojom; 5 library native_viewport_event_dispatcher_mojom;
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:mojo/bindings.dart' as bindings; 7 import 'package:mojo/bindings.dart' as bindings;
8 import 'package:mojo/core.dart' as core; 8 import 'package:mojo/core.dart' as core;
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
10 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo m; 10 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo m;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 dynamic getAllTypeDefinitions([Function responseFactory]) => 153 dynamic getAllTypeDefinitions([Function responseFactory]) =>
154 responseFactory(null); 154 responseFactory(null);
155 } 155 }
156 156
157 abstract class NativeViewportEventDispatcher { 157 abstract class NativeViewportEventDispatcher {
158 static const String serviceName = "mojo::NativeViewportEventDispatcher"; 158 static const String serviceName = "mojo::NativeViewportEventDispatcher";
159 dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = nul l]); 159 dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = nul l]);
160 } 160 }
161 161
162 162 class _NativeViewportEventDispatcherProxyControl
163 class _NativeViewportEventDispatcherProxyControl extends bindings.ProxyMessageHa ndler 163 extends bindings.ProxyMessageHandler
164 implements bindings.ProxyControl { 164 implements bindings.ProxyControl {
165 _NativeViewportEventDispatcherProxyControl.fromEndpoint( 165 _NativeViewportEventDispatcherProxyControl.fromEndpoint(
166 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 166 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
167 167
168 _NativeViewportEventDispatcherProxyControl.fromHandle( 168 _NativeViewportEventDispatcherProxyControl.fromHandle(
169 core.MojoHandle handle) : super.fromHandle(handle); 169 core.MojoHandle handle) : super.fromHandle(handle);
170 170
171 _NativeViewportEventDispatcherProxyControl.unbound() : super.unbound(); 171 _NativeViewportEventDispatcherProxyControl.unbound() : super.unbound();
172 172
173 service_describer.ServiceDescription get serviceDescription => 173 service_describer.ServiceDescription get serviceDescription =>
174 new _NativeViewportEventDispatcherServiceDescription(); 174 new _NativeViewportEventDispatcherServiceDescription();
175 175
176 String get serviceName => NativeViewportEventDispatcher.serviceName; 176 String get serviceName => NativeViewportEventDispatcher.serviceName;
177 177
178 @override
179 void handleResponse(bindings.ServiceMessage message) { 178 void handleResponse(bindings.ServiceMessage message) {
180 switch (message.header.type) { 179 switch (message.header.type) {
181 case _nativeViewportEventDispatcherMethodOnEventName: 180 case _nativeViewportEventDispatcherMethodOnEventName:
182 var r = NativeViewportEventDispatcherOnEventResponseParams.deserialize( 181 var r = NativeViewportEventDispatcherOnEventResponseParams.deserialize(
183 message.payload); 182 message.payload);
184 if (!message.header.hasRequestId) { 183 if (!message.header.hasRequestId) {
185 proxyError("Expected a message with a valid request Id."); 184 proxyError("Expected a message with a valid request Id.");
186 return; 185 return;
187 } 186 }
188 Completer c = completerMap[message.header.requestId]; 187 Completer c = completerMap[message.header.requestId];
(...skipping 16 matching lines...) Expand all
205 } 204 }
206 } 205 }
207 206
208 @override 207 @override
209 String toString() { 208 String toString() {
210 var superString = super.toString(); 209 var superString = super.toString();
211 return "_NativeViewportEventDispatcherProxyControl($superString)"; 210 return "_NativeViewportEventDispatcherProxyControl($superString)";
212 } 211 }
213 } 212 }
214 213
215 214 class NativeViewportEventDispatcherProxy
216 class NativeViewportEventDispatcherProxy extends bindings.Proxy 215 extends bindings.Proxy
217 implements NativeViewportEventDispatcher { 216 implements NativeViewportEventDispatcher {
218 NativeViewportEventDispatcherProxy.fromEndpoint( 217 NativeViewportEventDispatcherProxy.fromEndpoint(
219 core.MojoMessagePipeEndpoint endpoint) 218 core.MojoMessagePipeEndpoint endpoint)
220 : super(new _NativeViewportEventDispatcherProxyControl.fromEndpoint(endpoi nt)); 219 : super(new _NativeViewportEventDispatcherProxyControl.fromEndpoint(endpoi nt));
221 220
222 NativeViewportEventDispatcherProxy.fromHandle(core.MojoHandle handle) 221 NativeViewportEventDispatcherProxy.fromHandle(core.MojoHandle handle)
223 : super(new _NativeViewportEventDispatcherProxyControl.fromHandle(handle)) ; 222 : super(new _NativeViewportEventDispatcherProxyControl.fromHandle(handle)) ;
224 223
225 NativeViewportEventDispatcherProxy.unbound() 224 NativeViewportEventDispatcherProxy.unbound()
226 : super(new _NativeViewportEventDispatcherProxyControl.unbound()); 225 : super(new _NativeViewportEventDispatcherProxyControl.unbound());
227 226
(...skipping 15 matching lines...) Expand all
243 var params = new _NativeViewportEventDispatcherOnEventParams(); 242 var params = new _NativeViewportEventDispatcherOnEventParams();
244 params.event = event; 243 params.event = event;
245 return ctrl.sendMessageWithRequestId( 244 return ctrl.sendMessageWithRequestId(
246 params, 245 params,
247 _nativeViewportEventDispatcherMethodOnEventName, 246 _nativeViewportEventDispatcherMethodOnEventName,
248 -1, 247 -1,
249 bindings.MessageHeader.kMessageExpectsResponse); 248 bindings.MessageHeader.kMessageExpectsResponse);
250 } 249 }
251 } 250 }
252 251
253 252 class _NativeViewportEventDispatcherStubControl
254 class NativeViewportEventDispatcherStub extends bindings.Stub { 253 extends bindings.StubMessageHandler
254 implements bindings.StubControl<NativeViewportEventDispatcher> {
255 NativeViewportEventDispatcher _impl; 255 NativeViewportEventDispatcher _impl;
256 256
257 NativeViewportEventDispatcherStub.fromEndpoint( 257 _NativeViewportEventDispatcherStubControl.fromEndpoint(
258 core.MojoMessagePipeEndpoint endpoint, [NativeViewportEventDispatcher impl ]) 258 core.MojoMessagePipeEndpoint endpoint, [NativeViewportEventDispatcher impl ])
259 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 259 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
260 _impl = impl; 260 _impl = impl;
261 } 261 }
262 262
263 NativeViewportEventDispatcherStub.fromHandle( 263 _NativeViewportEventDispatcherStubControl.fromHandle(
264 core.MojoHandle handle, [NativeViewportEventDispatcher impl]) 264 core.MojoHandle handle, [NativeViewportEventDispatcher impl])
265 : super.fromHandle(handle, autoBegin: impl != null) { 265 : super.fromHandle(handle, autoBegin: impl != null) {
266 _impl = impl; 266 _impl = impl;
267 } 267 }
268 268
269 NativeViewportEventDispatcherStub.unbound([this._impl]) : super.unbound(); 269 _NativeViewportEventDispatcherStubControl.unbound([this._impl]) : super.unboun d();
270
271 static NativeViewportEventDispatcherStub newFromEndpoint(
272 core.MojoMessagePipeEndpoint endpoint) {
273 assert(endpoint.setDescription("For NativeViewportEventDispatcherStub"));
274 return new NativeViewportEventDispatcherStub.fromEndpoint(endpoint);
275 }
276 270
277 271
278 NativeViewportEventDispatcherOnEventResponseParams _nativeViewportEventDispatc herOnEventResponseParamsFactory() { 272 NativeViewportEventDispatcherOnEventResponseParams _nativeViewportEventDispatc herOnEventResponseParamsFactory() {
279 var result = new NativeViewportEventDispatcherOnEventResponseParams(); 273 var result = new NativeViewportEventDispatcherOnEventResponseParams();
280 return result; 274 return result;
281 } 275 }
282 276
283 dynamic handleMessage(bindings.ServiceMessage message) { 277 dynamic handleMessage(bindings.ServiceMessage message) {
284 if (bindings.ControlMessageHandler.isControlMessage(message)) { 278 if (bindings.ControlMessageHandler.isControlMessage(message)) {
285 return bindings.ControlMessageHandler.handleMessage(this, 279 return bindings.ControlMessageHandler.handleMessage(this,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 325 }
332 326
333 @override 327 @override
334 void bind(core.MojoMessagePipeEndpoint endpoint) { 328 void bind(core.MojoMessagePipeEndpoint endpoint) {
335 super.bind(endpoint); 329 super.bind(endpoint);
336 if (!isOpen && (_impl != null)) { 330 if (!isOpen && (_impl != null)) {
337 beginHandlingEvents(); 331 beginHandlingEvents();
338 } 332 }
339 } 333 }
340 334
335 @override
341 String toString() { 336 String toString() {
342 var superString = super.toString(); 337 var superString = super.toString();
343 return "NativeViewportEventDispatcherStub($superString)"; 338 return "_NativeViewportEventDispatcherStubControl($superString)";
344 } 339 }
345 340
346 int get version => 0; 341 int get version => 0;
347 342
348 static service_describer.ServiceDescription _cachedServiceDescription; 343 static service_describer.ServiceDescription _cachedServiceDescription;
349 static service_describer.ServiceDescription get serviceDescription { 344 static service_describer.ServiceDescription get serviceDescription {
350 if (_cachedServiceDescription == null) { 345 if (_cachedServiceDescription == null) {
351 _cachedServiceDescription = new _NativeViewportEventDispatcherServiceDescr iption(); 346 _cachedServiceDescription = new _NativeViewportEventDispatcherServiceDescr iption();
352 } 347 }
353 return _cachedServiceDescription; 348 return _cachedServiceDescription;
354 } 349 }
355 } 350 }
356 351
352 class NativeViewportEventDispatcherStub
353 extends bindings.Stub<NativeViewportEventDispatcher>
354 implements NativeViewportEventDispatcher {
355 NativeViewportEventDispatcherStub.fromEndpoint(
356 core.MojoMessagePipeEndpoint endpoint, [NativeViewportEventDispatcher impl ])
357 : super(new _NativeViewportEventDispatcherStubControl.fromEndpoint(endpoin t, impl));
358
359 NativeViewportEventDispatcherStub.fromHandle(
360 core.MojoHandle handle, [NativeViewportEventDispatcher impl])
361 : super(new _NativeViewportEventDispatcherStubControl.fromHandle(handle, i mpl));
362
363 NativeViewportEventDispatcherStub.unbound([NativeViewportEventDispatcher impl] )
364 : super(new _NativeViewportEventDispatcherStubControl.unbound(impl));
365
366 static NativeViewportEventDispatcherStub newFromEndpoint(
367 core.MojoMessagePipeEndpoint endpoint) {
368 assert(endpoint.setDescription("For NativeViewportEventDispatcherStub"));
369 return new NativeViewportEventDispatcherStub.fromEndpoint(endpoint);
370 }
371
372 static service_describer.ServiceDescription get serviceDescription =>
373 _NativeViewportEventDispatcherStubControl.serviceDescription;
374
375
376 dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = nul l]) {
377 return impl.onEvent(event,responseFactory);
378 }
379 }
380
357 381
358 382
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698