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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/files/directory.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 directory_mojom; 5 library directory_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/file.mojom.dart' as file_mojom; 10 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom;
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 static const String serviceName = null; 1183 static const String serviceName = null;
1184 dynamic read([Function responseFactory = null]); 1184 dynamic read([Function responseFactory = null]);
1185 dynamic stat([Function responseFactory = null]); 1185 dynamic stat([Function responseFactory = null]);
1186 dynamic touch(types_mojom.TimespecOrNow atime,types_mojom.TimespecOrNow mtime, [Function responseFactory = null]); 1186 dynamic touch(types_mojom.TimespecOrNow atime,types_mojom.TimespecOrNow mtime, [Function responseFactory = null]);
1187 dynamic openFile(String path,Object file,int openFlags,[Function responseFacto ry = null]); 1187 dynamic openFile(String path,Object file,int openFlags,[Function responseFacto ry = null]);
1188 dynamic openDirectory(String path,Object directory,int openFlags,[Function res ponseFactory = null]); 1188 dynamic openDirectory(String path,Object directory,int openFlags,[Function res ponseFactory = null]);
1189 dynamic rename(String path,String newPath,[Function responseFactory = null]); 1189 dynamic rename(String path,String newPath,[Function responseFactory = null]);
1190 dynamic delete(String path,int deleteFlags,[Function responseFactory = null]); 1190 dynamic delete(String path,int deleteFlags,[Function responseFactory = null]);
1191 } 1191 }
1192 1192
1193 1193 class _DirectoryProxyControl
1194 class _DirectoryProxyControl extends bindings.ProxyMessageHandler 1194 extends bindings.ProxyMessageHandler
1195 implements bindings.ProxyControl { 1195 implements bindings.ProxyControl {
1196 _DirectoryProxyControl.fromEndpoint( 1196 _DirectoryProxyControl.fromEndpoint(
1197 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1197 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1198 1198
1199 _DirectoryProxyControl.fromHandle( 1199 _DirectoryProxyControl.fromHandle(
1200 core.MojoHandle handle) : super.fromHandle(handle); 1200 core.MojoHandle handle) : super.fromHandle(handle);
1201 1201
1202 _DirectoryProxyControl.unbound() : super.unbound(); 1202 _DirectoryProxyControl.unbound() : super.unbound();
1203 1203
1204 service_describer.ServiceDescription get serviceDescription => 1204 service_describer.ServiceDescription get serviceDescription =>
1205 new _DirectoryServiceDescription(); 1205 new _DirectoryServiceDescription();
1206 1206
1207 String get serviceName => Directory.serviceName; 1207 String get serviceName => Directory.serviceName;
1208 1208
1209 @override
1210 void handleResponse(bindings.ServiceMessage message) { 1209 void handleResponse(bindings.ServiceMessage message) {
1211 switch (message.header.type) { 1210 switch (message.header.type) {
1212 case _directoryMethodReadName: 1211 case _directoryMethodReadName:
1213 var r = DirectoryReadResponseParams.deserialize( 1212 var r = DirectoryReadResponseParams.deserialize(
1214 message.payload); 1213 message.payload);
1215 if (!message.header.hasRequestId) { 1214 if (!message.header.hasRequestId) {
1216 proxyError("Expected a message with a valid request Id."); 1215 proxyError("Expected a message with a valid request Id.");
1217 return; 1216 return;
1218 } 1217 }
1219 Completer c = completerMap[message.header.requestId]; 1218 Completer c = completerMap[message.header.requestId];
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 } 1355 }
1357 } 1356 }
1358 1357
1359 @override 1358 @override
1360 String toString() { 1359 String toString() {
1361 var superString = super.toString(); 1360 var superString = super.toString();
1362 return "_DirectoryProxyControl($superString)"; 1361 return "_DirectoryProxyControl($superString)";
1363 } 1362 }
1364 } 1363 }
1365 1364
1366 1365 class DirectoryProxy
1367 class DirectoryProxy extends bindings.Proxy 1366 extends bindings.Proxy
1368 implements Directory { 1367 implements Directory {
1369 DirectoryProxy.fromEndpoint( 1368 DirectoryProxy.fromEndpoint(
1370 core.MojoMessagePipeEndpoint endpoint) 1369 core.MojoMessagePipeEndpoint endpoint)
1371 : super(new _DirectoryProxyControl.fromEndpoint(endpoint)); 1370 : super(new _DirectoryProxyControl.fromEndpoint(endpoint));
1372 1371
1373 DirectoryProxy.fromHandle(core.MojoHandle handle) 1372 DirectoryProxy.fromHandle(core.MojoHandle handle)
1374 : super(new _DirectoryProxyControl.fromHandle(handle)); 1373 : super(new _DirectoryProxyControl.fromHandle(handle));
1375 1374
1376 DirectoryProxy.unbound() 1375 DirectoryProxy.unbound()
1377 : super(new _DirectoryProxyControl.unbound()); 1376 : super(new _DirectoryProxyControl.unbound());
1378 1377
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 params.path = path; 1452 params.path = path;
1454 params.deleteFlags = deleteFlags; 1453 params.deleteFlags = deleteFlags;
1455 return ctrl.sendMessageWithRequestId( 1454 return ctrl.sendMessageWithRequestId(
1456 params, 1455 params,
1457 _directoryMethodDeleteName, 1456 _directoryMethodDeleteName,
1458 -1, 1457 -1,
1459 bindings.MessageHeader.kMessageExpectsResponse); 1458 bindings.MessageHeader.kMessageExpectsResponse);
1460 } 1459 }
1461 } 1460 }
1462 1461
1463 1462 class _DirectoryStubControl
1464 class DirectoryStub extends bindings.Stub { 1463 extends bindings.StubMessageHandler
1464 implements bindings.StubControl<Directory> {
1465 Directory _impl; 1465 Directory _impl;
1466 1466
1467 DirectoryStub.fromEndpoint( 1467 _DirectoryStubControl.fromEndpoint(
1468 core.MojoMessagePipeEndpoint endpoint, [Directory impl]) 1468 core.MojoMessagePipeEndpoint endpoint, [Directory impl])
1469 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 1469 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
1470 _impl = impl; 1470 _impl = impl;
1471 } 1471 }
1472 1472
1473 DirectoryStub.fromHandle( 1473 _DirectoryStubControl.fromHandle(
1474 core.MojoHandle handle, [Directory impl]) 1474 core.MojoHandle handle, [Directory impl])
1475 : super.fromHandle(handle, autoBegin: impl != null) { 1475 : super.fromHandle(handle, autoBegin: impl != null) {
1476 _impl = impl; 1476 _impl = impl;
1477 } 1477 }
1478 1478
1479 DirectoryStub.unbound([this._impl]) : super.unbound(); 1479 _DirectoryStubControl.unbound([this._impl]) : super.unbound();
1480
1481 static DirectoryStub newFromEndpoint(
1482 core.MojoMessagePipeEndpoint endpoint) {
1483 assert(endpoint.setDescription("For DirectoryStub"));
1484 return new DirectoryStub.fromEndpoint(endpoint);
1485 }
1486 1480
1487 1481
1488 DirectoryReadResponseParams _directoryReadResponseParamsFactory(types_mojom.Er ror error, List<types_mojom.DirectoryEntry> directoryContents) { 1482 DirectoryReadResponseParams _directoryReadResponseParamsFactory(types_mojom.Er ror error, List<types_mojom.DirectoryEntry> directoryContents) {
1489 var result = new DirectoryReadResponseParams(); 1483 var result = new DirectoryReadResponseParams();
1490 result.error = error; 1484 result.error = error;
1491 result.directoryContents = directoryContents; 1485 result.directoryContents = directoryContents;
1492 return result; 1486 return result;
1493 } 1487 }
1494 DirectoryStatResponseParams _directoryStatResponseParamsFactory(types_mojom.Er ror error, types_mojom.FileInformation fileInformation) { 1488 DirectoryStatResponseParams _directoryStatResponseParamsFactory(types_mojom.Er ror error, types_mojom.FileInformation fileInformation) {
1495 var result = new DirectoryStatResponseParams(); 1489 var result = new DirectoryStatResponseParams();
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 } 1696 }
1703 1697
1704 @override 1698 @override
1705 void bind(core.MojoMessagePipeEndpoint endpoint) { 1699 void bind(core.MojoMessagePipeEndpoint endpoint) {
1706 super.bind(endpoint); 1700 super.bind(endpoint);
1707 if (!isOpen && (_impl != null)) { 1701 if (!isOpen && (_impl != null)) {
1708 beginHandlingEvents(); 1702 beginHandlingEvents();
1709 } 1703 }
1710 } 1704 }
1711 1705
1706 @override
1712 String toString() { 1707 String toString() {
1713 var superString = super.toString(); 1708 var superString = super.toString();
1714 return "DirectoryStub($superString)"; 1709 return "_DirectoryStubControl($superString)";
1715 } 1710 }
1716 1711
1717 int get version => 0; 1712 int get version => 0;
1718 1713
1719 static service_describer.ServiceDescription _cachedServiceDescription; 1714 static service_describer.ServiceDescription _cachedServiceDescription;
1720 static service_describer.ServiceDescription get serviceDescription { 1715 static service_describer.ServiceDescription get serviceDescription {
1721 if (_cachedServiceDescription == null) { 1716 if (_cachedServiceDescription == null) {
1722 _cachedServiceDescription = new _DirectoryServiceDescription(); 1717 _cachedServiceDescription = new _DirectoryServiceDescription();
1723 } 1718 }
1724 return _cachedServiceDescription; 1719 return _cachedServiceDescription;
1725 } 1720 }
1726 } 1721 }
1727 1722
1723 class DirectoryStub
1724 extends bindings.Stub<Directory>
1725 implements Directory {
1726 DirectoryStub.fromEndpoint(
1727 core.MojoMessagePipeEndpoint endpoint, [Directory impl])
1728 : super(new _DirectoryStubControl.fromEndpoint(endpoint, impl));
1729
1730 DirectoryStub.fromHandle(
1731 core.MojoHandle handle, [Directory impl])
1732 : super(new _DirectoryStubControl.fromHandle(handle, impl));
1733
1734 DirectoryStub.unbound([Directory impl])
1735 : super(new _DirectoryStubControl.unbound(impl));
1736
1737 static DirectoryStub newFromEndpoint(
1738 core.MojoMessagePipeEndpoint endpoint) {
1739 assert(endpoint.setDescription("For DirectoryStub"));
1740 return new DirectoryStub.fromEndpoint(endpoint);
1741 }
1742
1743 static service_describer.ServiceDescription get serviceDescription =>
1744 _DirectoryStubControl.serviceDescription;
1745
1746
1747 dynamic read([Function responseFactory = null]) {
1748 return impl.read(responseFactory);
1749 }
1750 dynamic stat([Function responseFactory = null]) {
1751 return impl.stat(responseFactory);
1752 }
1753 dynamic touch(types_mojom.TimespecOrNow atime,types_mojom.TimespecOrNow mtime, [Function responseFactory = null]) {
1754 return impl.touch(atime,mtime,responseFactory);
1755 }
1756 dynamic openFile(String path,Object file,int openFlags,[Function responseFacto ry = null]) {
1757 return impl.openFile(path,file,openFlags,responseFactory);
1758 }
1759 dynamic openDirectory(String path,Object directory,int openFlags,[Function res ponseFactory = null]) {
1760 return impl.openDirectory(path,directory,openFlags,responseFactory);
1761 }
1762 dynamic rename(String path,String newPath,[Function responseFactory = null]) {
1763 return impl.rename(path,newPath,responseFactory);
1764 }
1765 dynamic delete(String path,int deleteFlags,[Function responseFactory = null]) {
1766 return impl.delete(path,deleteFlags,responseFactory);
1767 }
1768 }
1769
1728 1770
1729 1771
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698