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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/files/file.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 file_mojom; 5 library file_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/files/types.mojom.dart' as types_mojom; 10 import 'package:mojo_services/mojo/files/types.mojom.dart' as types_mojom;
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 dynamic seek(int offset,types_mojom.Whence whence,[Function responseFactory = null]); 2354 dynamic seek(int offset,types_mojom.Whence whence,[Function responseFactory = null]);
2355 dynamic stat([Function responseFactory = null]); 2355 dynamic stat([Function responseFactory = null]);
2356 dynamic truncate(int size,[Function responseFactory = null]); 2356 dynamic truncate(int size,[Function responseFactory = null]);
2357 dynamic touch(types_mojom.TimespecOrNow atime,types_mojom.TimespecOrNow mtime, [Function responseFactory = null]); 2357 dynamic touch(types_mojom.TimespecOrNow atime,types_mojom.TimespecOrNow mtime, [Function responseFactory = null]);
2358 dynamic dup(Object file,[Function responseFactory = null]); 2358 dynamic dup(Object file,[Function responseFactory = null]);
2359 dynamic reopen(Object file,int openFlags,[Function responseFactory = null]); 2359 dynamic reopen(Object file,int openFlags,[Function responseFactory = null]);
2360 dynamic asBuffer([Function responseFactory = null]); 2360 dynamic asBuffer([Function responseFactory = null]);
2361 dynamic ioctl(int request,List<int> inValues,[Function responseFactory = null] ); 2361 dynamic ioctl(int request,List<int> inValues,[Function responseFactory = null] );
2362 } 2362 }
2363 2363
2364 2364 class _FileProxyControl
2365 class _FileProxyControl extends bindings.ProxyMessageHandler 2365 extends bindings.ProxyMessageHandler
2366 implements bindings.ProxyControl { 2366 implements bindings.ProxyControl {
2367 _FileProxyControl.fromEndpoint( 2367 _FileProxyControl.fromEndpoint(
2368 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 2368 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
2369 2369
2370 _FileProxyControl.fromHandle( 2370 _FileProxyControl.fromHandle(
2371 core.MojoHandle handle) : super.fromHandle(handle); 2371 core.MojoHandle handle) : super.fromHandle(handle);
2372 2372
2373 _FileProxyControl.unbound() : super.unbound(); 2373 _FileProxyControl.unbound() : super.unbound();
2374 2374
2375 service_describer.ServiceDescription get serviceDescription => 2375 service_describer.ServiceDescription get serviceDescription =>
2376 new _FileServiceDescription(); 2376 new _FileServiceDescription();
2377 2377
2378 String get serviceName => File.serviceName; 2378 String get serviceName => File.serviceName;
2379 2379
2380 @override
2381 void handleResponse(bindings.ServiceMessage message) { 2380 void handleResponse(bindings.ServiceMessage message) {
2382 switch (message.header.type) { 2381 switch (message.header.type) {
2383 case _fileMethodCloseName: 2382 case _fileMethodCloseName:
2384 var r = FileCloseResponseParams.deserialize( 2383 var r = FileCloseResponseParams.deserialize(
2385 message.payload); 2384 message.payload);
2386 if (!message.header.hasRequestId) { 2385 if (!message.header.hasRequestId) {
2387 proxyError("Expected a message with a valid request Id."); 2386 proxyError("Expected a message with a valid request Id.");
2388 return; 2387 return;
2389 } 2388 }
2390 Completer c = completerMap[message.header.requestId]; 2389 Completer c = completerMap[message.header.requestId];
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 } 2666 }
2668 } 2667 }
2669 2668
2670 @override 2669 @override
2671 String toString() { 2670 String toString() {
2672 var superString = super.toString(); 2671 var superString = super.toString();
2673 return "_FileProxyControl($superString)"; 2672 return "_FileProxyControl($superString)";
2674 } 2673 }
2675 } 2674 }
2676 2675
2677 2676 class FileProxy
2678 class FileProxy extends bindings.Proxy 2677 extends bindings.Proxy
2679 implements File { 2678 implements File {
2680 FileProxy.fromEndpoint( 2679 FileProxy.fromEndpoint(
2681 core.MojoMessagePipeEndpoint endpoint) 2680 core.MojoMessagePipeEndpoint endpoint)
2682 : super(new _FileProxyControl.fromEndpoint(endpoint)); 2681 : super(new _FileProxyControl.fromEndpoint(endpoint));
2683 2682
2684 FileProxy.fromHandle(core.MojoHandle handle) 2683 FileProxy.fromHandle(core.MojoHandle handle)
2685 : super(new _FileProxyControl.fromHandle(handle)); 2684 : super(new _FileProxyControl.fromHandle(handle));
2686 2685
2687 FileProxy.unbound() 2686 FileProxy.unbound()
2688 : super(new _FileProxyControl.unbound()); 2687 : super(new _FileProxyControl.unbound());
2689 2688
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 params.request = request; 2830 params.request = request;
2832 params.inValues = inValues; 2831 params.inValues = inValues;
2833 return ctrl.sendMessageWithRequestId( 2832 return ctrl.sendMessageWithRequestId(
2834 params, 2833 params,
2835 _fileMethodIoctlName, 2834 _fileMethodIoctlName,
2836 -1, 2835 -1,
2837 bindings.MessageHeader.kMessageExpectsResponse); 2836 bindings.MessageHeader.kMessageExpectsResponse);
2838 } 2837 }
2839 } 2838 }
2840 2839
2841 2840 class _FileStubControl
2842 class FileStub extends bindings.Stub { 2841 extends bindings.StubMessageHandler
2842 implements bindings.StubControl<File> {
2843 File _impl; 2843 File _impl;
2844 2844
2845 FileStub.fromEndpoint( 2845 _FileStubControl.fromEndpoint(
2846 core.MojoMessagePipeEndpoint endpoint, [File impl]) 2846 core.MojoMessagePipeEndpoint endpoint, [File impl])
2847 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 2847 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
2848 _impl = impl; 2848 _impl = impl;
2849 } 2849 }
2850 2850
2851 FileStub.fromHandle( 2851 _FileStubControl.fromHandle(
2852 core.MojoHandle handle, [File impl]) 2852 core.MojoHandle handle, [File impl])
2853 : super.fromHandle(handle, autoBegin: impl != null) { 2853 : super.fromHandle(handle, autoBegin: impl != null) {
2854 _impl = impl; 2854 _impl = impl;
2855 } 2855 }
2856 2856
2857 FileStub.unbound([this._impl]) : super.unbound(); 2857 _FileStubControl.unbound([this._impl]) : super.unbound();
2858
2859 static FileStub newFromEndpoint(
2860 core.MojoMessagePipeEndpoint endpoint) {
2861 assert(endpoint.setDescription("For FileStub"));
2862 return new FileStub.fromEndpoint(endpoint);
2863 }
2864 2858
2865 2859
2866 FileCloseResponseParams _fileCloseResponseParamsFactory(types_mojom.Error err) { 2860 FileCloseResponseParams _fileCloseResponseParamsFactory(types_mojom.Error err) {
2867 var result = new FileCloseResponseParams(); 2861 var result = new FileCloseResponseParams();
2868 result.err = err; 2862 result.err = err;
2869 return result; 2863 return result;
2870 } 2864 }
2871 FileReadResponseParams _fileReadResponseParamsFactory(types_mojom.Error error, List<int> bytesRead) { 2865 FileReadResponseParams _fileReadResponseParamsFactory(types_mojom.Error error, List<int> bytesRead) {
2872 var result = new FileReadResponseParams(); 2866 var result = new FileReadResponseParams();
2873 result.error = error; 2867 result.error = error;
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3270 } 3264 }
3271 3265
3272 @override 3266 @override
3273 void bind(core.MojoMessagePipeEndpoint endpoint) { 3267 void bind(core.MojoMessagePipeEndpoint endpoint) {
3274 super.bind(endpoint); 3268 super.bind(endpoint);
3275 if (!isOpen && (_impl != null)) { 3269 if (!isOpen && (_impl != null)) {
3276 beginHandlingEvents(); 3270 beginHandlingEvents();
3277 } 3271 }
3278 } 3272 }
3279 3273
3274 @override
3280 String toString() { 3275 String toString() {
3281 var superString = super.toString(); 3276 var superString = super.toString();
3282 return "FileStub($superString)"; 3277 return "_FileStubControl($superString)";
3283 } 3278 }
3284 3279
3285 int get version => 0; 3280 int get version => 0;
3286 3281
3287 static service_describer.ServiceDescription _cachedServiceDescription; 3282 static service_describer.ServiceDescription _cachedServiceDescription;
3288 static service_describer.ServiceDescription get serviceDescription { 3283 static service_describer.ServiceDescription get serviceDescription {
3289 if (_cachedServiceDescription == null) { 3284 if (_cachedServiceDescription == null) {
3290 _cachedServiceDescription = new _FileServiceDescription(); 3285 _cachedServiceDescription = new _FileServiceDescription();
3291 } 3286 }
3292 return _cachedServiceDescription; 3287 return _cachedServiceDescription;
3293 } 3288 }
3294 } 3289 }
3295 3290
3291 class FileStub
3292 extends bindings.Stub<File>
3293 implements File {
3294 FileStub.fromEndpoint(
3295 core.MojoMessagePipeEndpoint endpoint, [File impl])
3296 : super(new _FileStubControl.fromEndpoint(endpoint, impl));
3297
3298 FileStub.fromHandle(
3299 core.MojoHandle handle, [File impl])
3300 : super(new _FileStubControl.fromHandle(handle, impl));
3301
3302 FileStub.unbound([File impl])
3303 : super(new _FileStubControl.unbound(impl));
3304
3305 static FileStub newFromEndpoint(
3306 core.MojoMessagePipeEndpoint endpoint) {
3307 assert(endpoint.setDescription("For FileStub"));
3308 return new FileStub.fromEndpoint(endpoint);
3309 }
3310
3311 static service_describer.ServiceDescription get serviceDescription =>
3312 _FileStubControl.serviceDescription;
3313
3314
3315 dynamic close_([Function responseFactory = null]) {
3316 return impl.close_(responseFactory);
3317 }
3318 dynamic read(int numBytesToRead,int offset,types_mojom.Whence whence,[Function responseFactory = null]) {
3319 return impl.read(numBytesToRead,offset,whence,responseFactory);
3320 }
3321 dynamic write(List<int> bytesToWrite,int offset,types_mojom.Whence whence,[Fun ction responseFactory = null]) {
3322 return impl.write(bytesToWrite,offset,whence,responseFactory);
3323 }
3324 dynamic readToStream(core.MojoDataPipeProducer source,int offset,types_mojom.W hence whence,int numBytesToRead,[Function responseFactory = null]) {
3325 return impl.readToStream(source,offset,whence,numBytesToRead,responseFactory );
3326 }
3327 dynamic writeFromStream(core.MojoDataPipeConsumer sink,int offset,types_mojom. Whence whence,[Function responseFactory = null]) {
3328 return impl.writeFromStream(sink,offset,whence,responseFactory);
3329 }
3330 dynamic tell([Function responseFactory = null]) {
3331 return impl.tell(responseFactory);
3332 }
3333 dynamic seek(int offset,types_mojom.Whence whence,[Function responseFactory = null]) {
3334 return impl.seek(offset,whence,responseFactory);
3335 }
3336 dynamic stat([Function responseFactory = null]) {
3337 return impl.stat(responseFactory);
3338 }
3339 dynamic truncate(int size,[Function responseFactory = null]) {
3340 return impl.truncate(size,responseFactory);
3341 }
3342 dynamic touch(types_mojom.TimespecOrNow atime,types_mojom.TimespecOrNow mtime, [Function responseFactory = null]) {
3343 return impl.touch(atime,mtime,responseFactory);
3344 }
3345 dynamic dup(Object file,[Function responseFactory = null]) {
3346 return impl.dup(file,responseFactory);
3347 }
3348 dynamic reopen(Object file,int openFlags,[Function responseFactory = null]) {
3349 return impl.reopen(file,openFlags,responseFactory);
3350 }
3351 dynamic asBuffer([Function responseFactory = null]) {
3352 return impl.asBuffer(responseFactory);
3353 }
3354 dynamic ioctl(int request,List<int> inValues,[Function responseFactory = null] ) {
3355 return impl.ioctl(request,inValues,responseFactory);
3356 }
3357 }
3358
3296 3359
3297 3360
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698