OLD | NEW |
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 sample_factory_mojom; | 5 library sample_factory_mojom; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:typed_data'; | 10 import 'dart:typed_data'; |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1095 dynamic getAllTypeDefinitions([Function responseFactory]) => |
1096 responseFactory(getAllMojomTypeDefinitions()); | 1096 responseFactory(getAllMojomTypeDefinitions()); |
1097 } | 1097 } |
1098 | 1098 |
1099 abstract class NamedObject { | 1099 abstract class NamedObject { |
1100 static const String serviceName = "sample::NamedObject"; | 1100 static const String serviceName = "sample::NamedObject"; |
1101 void setName(String name); | 1101 void setName(String name); |
1102 dynamic getName([Function responseFactory = null]); | 1102 dynamic getName([Function responseFactory = null]); |
1103 } | 1103 } |
1104 | 1104 |
1105 | 1105 class _NamedObjectProxyControl |
1106 class _NamedObjectProxyControl extends bindings.ProxyMessageHandler | 1106 extends bindings.ProxyMessageHandler |
1107 implements bindings.ProxyControl { | 1107 implements bindings.ProxyControl { |
1108 _NamedObjectProxyControl.fromEndpoint( | 1108 _NamedObjectProxyControl.fromEndpoint( |
1109 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1109 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1110 | 1110 |
1111 _NamedObjectProxyControl.fromHandle( | 1111 _NamedObjectProxyControl.fromHandle( |
1112 core.MojoHandle handle) : super.fromHandle(handle); | 1112 core.MojoHandle handle) : super.fromHandle(handle); |
1113 | 1113 |
1114 _NamedObjectProxyControl.unbound() : super.unbound(); | 1114 _NamedObjectProxyControl.unbound() : super.unbound(); |
1115 | 1115 |
1116 service_describer.ServiceDescription get serviceDescription => | 1116 service_describer.ServiceDescription get serviceDescription => |
1117 new _NamedObjectServiceDescription(); | 1117 new _NamedObjectServiceDescription(); |
1118 | 1118 |
1119 String get serviceName => NamedObject.serviceName; | 1119 String get serviceName => NamedObject.serviceName; |
1120 | 1120 |
1121 @override | |
1122 void handleResponse(bindings.ServiceMessage message) { | 1121 void handleResponse(bindings.ServiceMessage message) { |
1123 switch (message.header.type) { | 1122 switch (message.header.type) { |
1124 case _namedObjectMethodGetNameName: | 1123 case _namedObjectMethodGetNameName: |
1125 var r = NamedObjectGetNameResponseParams.deserialize( | 1124 var r = NamedObjectGetNameResponseParams.deserialize( |
1126 message.payload); | 1125 message.payload); |
1127 if (!message.header.hasRequestId) { | 1126 if (!message.header.hasRequestId) { |
1128 proxyError("Expected a message with a valid request Id."); | 1127 proxyError("Expected a message with a valid request Id."); |
1129 return; | 1128 return; |
1130 } | 1129 } |
1131 Completer c = completerMap[message.header.requestId]; | 1130 Completer c = completerMap[message.header.requestId]; |
(...skipping 16 matching lines...) Expand all Loading... |
1148 } | 1147 } |
1149 } | 1148 } |
1150 | 1149 |
1151 @override | 1150 @override |
1152 String toString() { | 1151 String toString() { |
1153 var superString = super.toString(); | 1152 var superString = super.toString(); |
1154 return "_NamedObjectProxyControl($superString)"; | 1153 return "_NamedObjectProxyControl($superString)"; |
1155 } | 1154 } |
1156 } | 1155 } |
1157 | 1156 |
1158 | 1157 class NamedObjectProxy |
1159 class NamedObjectProxy extends bindings.Proxy | 1158 extends bindings.Proxy |
1160 implements NamedObject { | 1159 implements NamedObject { |
1161 NamedObjectProxy.fromEndpoint( | 1160 NamedObjectProxy.fromEndpoint( |
1162 core.MojoMessagePipeEndpoint endpoint) | 1161 core.MojoMessagePipeEndpoint endpoint) |
1163 : super(new _NamedObjectProxyControl.fromEndpoint(endpoint)); | 1162 : super(new _NamedObjectProxyControl.fromEndpoint(endpoint)); |
1164 | 1163 |
1165 NamedObjectProxy.fromHandle(core.MojoHandle handle) | 1164 NamedObjectProxy.fromHandle(core.MojoHandle handle) |
1166 : super(new _NamedObjectProxyControl.fromHandle(handle)); | 1165 : super(new _NamedObjectProxyControl.fromHandle(handle)); |
1167 | 1166 |
1168 NamedObjectProxy.unbound() | 1167 NamedObjectProxy.unbound() |
1169 : super(new _NamedObjectProxyControl.unbound()); | 1168 : super(new _NamedObjectProxyControl.unbound()); |
1170 | 1169 |
(...skipping 24 matching lines...) Expand all Loading... |
1195 dynamic getName([Function responseFactory = null]) { | 1194 dynamic getName([Function responseFactory = null]) { |
1196 var params = new _NamedObjectGetNameParams(); | 1195 var params = new _NamedObjectGetNameParams(); |
1197 return ctrl.sendMessageWithRequestId( | 1196 return ctrl.sendMessageWithRequestId( |
1198 params, | 1197 params, |
1199 _namedObjectMethodGetNameName, | 1198 _namedObjectMethodGetNameName, |
1200 -1, | 1199 -1, |
1201 bindings.MessageHeader.kMessageExpectsResponse); | 1200 bindings.MessageHeader.kMessageExpectsResponse); |
1202 } | 1201 } |
1203 } | 1202 } |
1204 | 1203 |
1205 | 1204 class _NamedObjectStubControl |
1206 class NamedObjectStub extends bindings.Stub { | 1205 extends bindings.StubMessageHandler |
| 1206 implements bindings.StubControl<NamedObject> { |
1207 NamedObject _impl; | 1207 NamedObject _impl; |
1208 | 1208 |
1209 NamedObjectStub.fromEndpoint( | 1209 _NamedObjectStubControl.fromEndpoint( |
1210 core.MojoMessagePipeEndpoint endpoint, [NamedObject impl]) | 1210 core.MojoMessagePipeEndpoint endpoint, [NamedObject impl]) |
1211 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1211 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
1212 _impl = impl; | 1212 _impl = impl; |
1213 } | 1213 } |
1214 | 1214 |
1215 NamedObjectStub.fromHandle( | 1215 _NamedObjectStubControl.fromHandle( |
1216 core.MojoHandle handle, [NamedObject impl]) | 1216 core.MojoHandle handle, [NamedObject impl]) |
1217 : super.fromHandle(handle, autoBegin: impl != null) { | 1217 : super.fromHandle(handle, autoBegin: impl != null) { |
1218 _impl = impl; | 1218 _impl = impl; |
1219 } | 1219 } |
1220 | 1220 |
1221 NamedObjectStub.unbound([this._impl]) : super.unbound(); | 1221 _NamedObjectStubControl.unbound([this._impl]) : super.unbound(); |
1222 | |
1223 static NamedObjectStub newFromEndpoint( | |
1224 core.MojoMessagePipeEndpoint endpoint) { | |
1225 assert(endpoint.setDescription("For NamedObjectStub")); | |
1226 return new NamedObjectStub.fromEndpoint(endpoint); | |
1227 } | |
1228 | 1222 |
1229 | 1223 |
1230 NamedObjectGetNameResponseParams _namedObjectGetNameResponseParamsFactory(Stri
ng name) { | 1224 NamedObjectGetNameResponseParams _namedObjectGetNameResponseParamsFactory(Stri
ng name) { |
1231 var result = new NamedObjectGetNameResponseParams(); | 1225 var result = new NamedObjectGetNameResponseParams(); |
1232 result.name = name; | 1226 result.name = name; |
1233 return result; | 1227 return result; |
1234 } | 1228 } |
1235 | 1229 |
1236 dynamic handleMessage(bindings.ServiceMessage message) { | 1230 dynamic handleMessage(bindings.ServiceMessage message) { |
1237 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1231 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 } | 1281 } |
1288 | 1282 |
1289 @override | 1283 @override |
1290 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1284 void bind(core.MojoMessagePipeEndpoint endpoint) { |
1291 super.bind(endpoint); | 1285 super.bind(endpoint); |
1292 if (!isOpen && (_impl != null)) { | 1286 if (!isOpen && (_impl != null)) { |
1293 beginHandlingEvents(); | 1287 beginHandlingEvents(); |
1294 } | 1288 } |
1295 } | 1289 } |
1296 | 1290 |
| 1291 @override |
1297 String toString() { | 1292 String toString() { |
1298 var superString = super.toString(); | 1293 var superString = super.toString(); |
1299 return "NamedObjectStub($superString)"; | 1294 return "_NamedObjectStubControl($superString)"; |
1300 } | 1295 } |
1301 | 1296 |
1302 int get version => 0; | 1297 int get version => 0; |
1303 | 1298 |
1304 static service_describer.ServiceDescription _cachedServiceDescription; | 1299 static service_describer.ServiceDescription _cachedServiceDescription; |
1305 static service_describer.ServiceDescription get serviceDescription { | 1300 static service_describer.ServiceDescription get serviceDescription { |
1306 if (_cachedServiceDescription == null) { | 1301 if (_cachedServiceDescription == null) { |
1307 _cachedServiceDescription = new _NamedObjectServiceDescription(); | 1302 _cachedServiceDescription = new _NamedObjectServiceDescription(); |
1308 } | 1303 } |
1309 return _cachedServiceDescription; | 1304 return _cachedServiceDescription; |
1310 } | 1305 } |
1311 } | 1306 } |
1312 | 1307 |
| 1308 class NamedObjectStub |
| 1309 extends bindings.Stub<NamedObject> |
| 1310 implements NamedObject { |
| 1311 NamedObjectStub.fromEndpoint( |
| 1312 core.MojoMessagePipeEndpoint endpoint, [NamedObject impl]) |
| 1313 : super(new _NamedObjectStubControl.fromEndpoint(endpoint, impl)); |
| 1314 |
| 1315 NamedObjectStub.fromHandle( |
| 1316 core.MojoHandle handle, [NamedObject impl]) |
| 1317 : super(new _NamedObjectStubControl.fromHandle(handle, impl)); |
| 1318 |
| 1319 NamedObjectStub.unbound([NamedObject impl]) |
| 1320 : super(new _NamedObjectStubControl.unbound(impl)); |
| 1321 |
| 1322 static NamedObjectStub newFromEndpoint( |
| 1323 core.MojoMessagePipeEndpoint endpoint) { |
| 1324 assert(endpoint.setDescription("For NamedObjectStub")); |
| 1325 return new NamedObjectStub.fromEndpoint(endpoint); |
| 1326 } |
| 1327 |
| 1328 static service_describer.ServiceDescription get serviceDescription => |
| 1329 _NamedObjectStubControl.serviceDescription; |
| 1330 |
| 1331 |
| 1332 void setName(String name) { |
| 1333 return impl.setName(name); |
| 1334 } |
| 1335 dynamic getName([Function responseFactory = null]) { |
| 1336 return impl.getName(responseFactory); |
| 1337 } |
| 1338 } |
| 1339 |
1313 const int _factoryMethodDoStuffName = 0; | 1340 const int _factoryMethodDoStuffName = 0; |
1314 const int _factoryMethodDoStuff2Name = 1; | 1341 const int _factoryMethodDoStuff2Name = 1; |
1315 const int _factoryMethodCreateNamedObjectName = 2; | 1342 const int _factoryMethodCreateNamedObjectName = 2; |
1316 const int _factoryMethodRequestImportedInterfaceName = 3; | 1343 const int _factoryMethodRequestImportedInterfaceName = 3; |
1317 const int _factoryMethodTakeImportedInterfaceName = 4; | 1344 const int _factoryMethodTakeImportedInterfaceName = 4; |
1318 | 1345 |
1319 class _FactoryServiceDescription implements service_describer.ServiceDescription
{ | 1346 class _FactoryServiceDescription implements service_describer.ServiceDescription
{ |
1320 dynamic getTopLevelInterface([Function responseFactory]) => | 1347 dynamic getTopLevelInterface([Function responseFactory]) => |
1321 responseFactory(null); | 1348 responseFactory(null); |
1322 | 1349 |
1323 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1350 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
1324 responseFactory(null); | 1351 responseFactory(null); |
1325 | 1352 |
1326 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1353 dynamic getAllTypeDefinitions([Function responseFactory]) => |
1327 responseFactory(null); | 1354 responseFactory(null); |
1328 } | 1355 } |
1329 | 1356 |
1330 abstract class Factory { | 1357 abstract class Factory { |
1331 static const String serviceName = null; | 1358 static const String serviceName = null; |
1332 dynamic doStuff(Request request,core.MojoMessagePipeEndpoint pipe,[Function re
sponseFactory = null]); | 1359 dynamic doStuff(Request request,core.MojoMessagePipeEndpoint pipe,[Function re
sponseFactory = null]); |
1333 dynamic doStuff2(core.MojoDataPipeConsumer pipe,[Function responseFactory = nu
ll]); | 1360 dynamic doStuff2(core.MojoDataPipeConsumer pipe,[Function responseFactory = nu
ll]); |
1334 void createNamedObject(Object obj); | 1361 void createNamedObject(Object obj); |
1335 dynamic requestImportedInterface(Object obj,[Function responseFactory = null])
; | 1362 dynamic requestImportedInterface(Object obj,[Function responseFactory = null])
; |
1336 dynamic takeImportedInterface(Object obj,[Function responseFactory = null]); | 1363 dynamic takeImportedInterface(Object obj,[Function responseFactory = null]); |
1337 } | 1364 } |
1338 | 1365 |
1339 | 1366 class _FactoryProxyControl |
1340 class _FactoryProxyControl extends bindings.ProxyMessageHandler | 1367 extends bindings.ProxyMessageHandler |
1341 implements bindings.ProxyControl { | 1368 implements bindings.ProxyControl { |
1342 _FactoryProxyControl.fromEndpoint( | 1369 _FactoryProxyControl.fromEndpoint( |
1343 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1370 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1344 | 1371 |
1345 _FactoryProxyControl.fromHandle( | 1372 _FactoryProxyControl.fromHandle( |
1346 core.MojoHandle handle) : super.fromHandle(handle); | 1373 core.MojoHandle handle) : super.fromHandle(handle); |
1347 | 1374 |
1348 _FactoryProxyControl.unbound() : super.unbound(); | 1375 _FactoryProxyControl.unbound() : super.unbound(); |
1349 | 1376 |
1350 service_describer.ServiceDescription get serviceDescription => | 1377 service_describer.ServiceDescription get serviceDescription => |
1351 new _FactoryServiceDescription(); | 1378 new _FactoryServiceDescription(); |
1352 | 1379 |
1353 String get serviceName => Factory.serviceName; | 1380 String get serviceName => Factory.serviceName; |
1354 | 1381 |
1355 @override | |
1356 void handleResponse(bindings.ServiceMessage message) { | 1382 void handleResponse(bindings.ServiceMessage message) { |
1357 switch (message.header.type) { | 1383 switch (message.header.type) { |
1358 case _factoryMethodDoStuffName: | 1384 case _factoryMethodDoStuffName: |
1359 var r = FactoryDoStuffResponseParams.deserialize( | 1385 var r = FactoryDoStuffResponseParams.deserialize( |
1360 message.payload); | 1386 message.payload); |
1361 if (!message.header.hasRequestId) { | 1387 if (!message.header.hasRequestId) { |
1362 proxyError("Expected a message with a valid request Id."); | 1388 proxyError("Expected a message with a valid request Id."); |
1363 return; | 1389 return; |
1364 } | 1390 } |
1365 Completer c = completerMap[message.header.requestId]; | 1391 Completer c = completerMap[message.header.requestId]; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 } | 1468 } |
1443 } | 1469 } |
1444 | 1470 |
1445 @override | 1471 @override |
1446 String toString() { | 1472 String toString() { |
1447 var superString = super.toString(); | 1473 var superString = super.toString(); |
1448 return "_FactoryProxyControl($superString)"; | 1474 return "_FactoryProxyControl($superString)"; |
1449 } | 1475 } |
1450 } | 1476 } |
1451 | 1477 |
1452 | 1478 class FactoryProxy |
1453 class FactoryProxy extends bindings.Proxy | 1479 extends bindings.Proxy |
1454 implements Factory { | 1480 implements Factory { |
1455 FactoryProxy.fromEndpoint( | 1481 FactoryProxy.fromEndpoint( |
1456 core.MojoMessagePipeEndpoint endpoint) | 1482 core.MojoMessagePipeEndpoint endpoint) |
1457 : super(new _FactoryProxyControl.fromEndpoint(endpoint)); | 1483 : super(new _FactoryProxyControl.fromEndpoint(endpoint)); |
1458 | 1484 |
1459 FactoryProxy.fromHandle(core.MojoHandle handle) | 1485 FactoryProxy.fromHandle(core.MojoHandle handle) |
1460 : super(new _FactoryProxyControl.fromHandle(handle)); | 1486 : super(new _FactoryProxyControl.fromHandle(handle)); |
1461 | 1487 |
1462 FactoryProxy.unbound() | 1488 FactoryProxy.unbound() |
1463 : super(new _FactoryProxyControl.unbound()); | 1489 : super(new _FactoryProxyControl.unbound()); |
1464 | 1490 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 var params = new _FactoryTakeImportedInterfaceParams(); | 1544 var params = new _FactoryTakeImportedInterfaceParams(); |
1519 params.obj = obj; | 1545 params.obj = obj; |
1520 return ctrl.sendMessageWithRequestId( | 1546 return ctrl.sendMessageWithRequestId( |
1521 params, | 1547 params, |
1522 _factoryMethodTakeImportedInterfaceName, | 1548 _factoryMethodTakeImportedInterfaceName, |
1523 -1, | 1549 -1, |
1524 bindings.MessageHeader.kMessageExpectsResponse); | 1550 bindings.MessageHeader.kMessageExpectsResponse); |
1525 } | 1551 } |
1526 } | 1552 } |
1527 | 1553 |
1528 | 1554 class _FactoryStubControl |
1529 class FactoryStub extends bindings.Stub { | 1555 extends bindings.StubMessageHandler |
| 1556 implements bindings.StubControl<Factory> { |
1530 Factory _impl; | 1557 Factory _impl; |
1531 | 1558 |
1532 FactoryStub.fromEndpoint( | 1559 _FactoryStubControl.fromEndpoint( |
1533 core.MojoMessagePipeEndpoint endpoint, [Factory impl]) | 1560 core.MojoMessagePipeEndpoint endpoint, [Factory impl]) |
1534 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1561 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
1535 _impl = impl; | 1562 _impl = impl; |
1536 } | 1563 } |
1537 | 1564 |
1538 FactoryStub.fromHandle( | 1565 _FactoryStubControl.fromHandle( |
1539 core.MojoHandle handle, [Factory impl]) | 1566 core.MojoHandle handle, [Factory impl]) |
1540 : super.fromHandle(handle, autoBegin: impl != null) { | 1567 : super.fromHandle(handle, autoBegin: impl != null) { |
1541 _impl = impl; | 1568 _impl = impl; |
1542 } | 1569 } |
1543 | 1570 |
1544 FactoryStub.unbound([this._impl]) : super.unbound(); | 1571 _FactoryStubControl.unbound([this._impl]) : super.unbound(); |
1545 | |
1546 static FactoryStub newFromEndpoint( | |
1547 core.MojoMessagePipeEndpoint endpoint) { | |
1548 assert(endpoint.setDescription("For FactoryStub")); | |
1549 return new FactoryStub.fromEndpoint(endpoint); | |
1550 } | |
1551 | 1572 |
1552 | 1573 |
1553 FactoryDoStuffResponseParams _factoryDoStuffResponseParamsFactory(Response res
ponse, String text) { | 1574 FactoryDoStuffResponseParams _factoryDoStuffResponseParamsFactory(Response res
ponse, String text) { |
1554 var result = new FactoryDoStuffResponseParams(); | 1575 var result = new FactoryDoStuffResponseParams(); |
1555 result.response = response; | 1576 result.response = response; |
1556 result.text = text; | 1577 result.text = text; |
1557 return result; | 1578 return result; |
1558 } | 1579 } |
1559 FactoryDoStuff2ResponseParams _factoryDoStuff2ResponseParamsFactory(String tex
t) { | 1580 FactoryDoStuff2ResponseParams _factoryDoStuff2ResponseParamsFactory(String tex
t) { |
1560 var result = new FactoryDoStuff2ResponseParams(); | 1581 var result = new FactoryDoStuff2ResponseParams(); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 } | 1715 } |
1695 | 1716 |
1696 @override | 1717 @override |
1697 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1718 void bind(core.MojoMessagePipeEndpoint endpoint) { |
1698 super.bind(endpoint); | 1719 super.bind(endpoint); |
1699 if (!isOpen && (_impl != null)) { | 1720 if (!isOpen && (_impl != null)) { |
1700 beginHandlingEvents(); | 1721 beginHandlingEvents(); |
1701 } | 1722 } |
1702 } | 1723 } |
1703 | 1724 |
| 1725 @override |
1704 String toString() { | 1726 String toString() { |
1705 var superString = super.toString(); | 1727 var superString = super.toString(); |
1706 return "FactoryStub($superString)"; | 1728 return "_FactoryStubControl($superString)"; |
1707 } | 1729 } |
1708 | 1730 |
1709 int get version => 0; | 1731 int get version => 0; |
1710 | 1732 |
1711 static service_describer.ServiceDescription _cachedServiceDescription; | 1733 static service_describer.ServiceDescription _cachedServiceDescription; |
1712 static service_describer.ServiceDescription get serviceDescription { | 1734 static service_describer.ServiceDescription get serviceDescription { |
1713 if (_cachedServiceDescription == null) { | 1735 if (_cachedServiceDescription == null) { |
1714 _cachedServiceDescription = new _FactoryServiceDescription(); | 1736 _cachedServiceDescription = new _FactoryServiceDescription(); |
1715 } | 1737 } |
1716 return _cachedServiceDescription; | 1738 return _cachedServiceDescription; |
1717 } | 1739 } |
1718 } | 1740 } |
1719 | 1741 |
| 1742 class FactoryStub |
| 1743 extends bindings.Stub<Factory> |
| 1744 implements Factory { |
| 1745 FactoryStub.fromEndpoint( |
| 1746 core.MojoMessagePipeEndpoint endpoint, [Factory impl]) |
| 1747 : super(new _FactoryStubControl.fromEndpoint(endpoint, impl)); |
| 1748 |
| 1749 FactoryStub.fromHandle( |
| 1750 core.MojoHandle handle, [Factory impl]) |
| 1751 : super(new _FactoryStubControl.fromHandle(handle, impl)); |
| 1752 |
| 1753 FactoryStub.unbound([Factory impl]) |
| 1754 : super(new _FactoryStubControl.unbound(impl)); |
| 1755 |
| 1756 static FactoryStub newFromEndpoint( |
| 1757 core.MojoMessagePipeEndpoint endpoint) { |
| 1758 assert(endpoint.setDescription("For FactoryStub")); |
| 1759 return new FactoryStub.fromEndpoint(endpoint); |
| 1760 } |
| 1761 |
| 1762 static service_describer.ServiceDescription get serviceDescription => |
| 1763 _FactoryStubControl.serviceDescription; |
| 1764 |
| 1765 |
| 1766 dynamic doStuff(Request request,core.MojoMessagePipeEndpoint pipe,[Function re
sponseFactory = null]) { |
| 1767 return impl.doStuff(request,pipe,responseFactory); |
| 1768 } |
| 1769 dynamic doStuff2(core.MojoDataPipeConsumer pipe,[Function responseFactory = nu
ll]) { |
| 1770 return impl.doStuff2(pipe,responseFactory); |
| 1771 } |
| 1772 void createNamedObject(Object obj) { |
| 1773 return impl.createNamedObject(obj); |
| 1774 } |
| 1775 dynamic requestImportedInterface(Object obj,[Function responseFactory = null])
{ |
| 1776 return impl.requestImportedInterface(obj,responseFactory); |
| 1777 } |
| 1778 dynamic takeImportedInterface(Object obj,[Function responseFactory = null]) { |
| 1779 return impl.takeImportedInterface(obj,responseFactory); |
| 1780 } |
| 1781 } |
| 1782 |
1720 | 1783 |
1721 mojom_types.RuntimeTypeInfo getRuntimeTypeInfo() => _runtimeTypeInfo ?? | 1784 mojom_types.RuntimeTypeInfo getRuntimeTypeInfo() => _runtimeTypeInfo ?? |
1722 _initRuntimeTypeInfo(); | 1785 _initRuntimeTypeInfo(); |
1723 | 1786 |
1724 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { | 1787 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
1725 return getRuntimeTypeInfo().typeMap; | 1788 return getRuntimeTypeInfo().typeMap; |
1726 } | 1789 } |
1727 | 1790 |
1728 var _runtimeTypeInfo; | 1791 var _runtimeTypeInfo; |
1729 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() { | 1792 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() { |
1730 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of | 1793 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of |
1731 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this | 1794 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this |
1732 // file. The string contains the base64 encoding of the gzip-compressed bytes. | 1795 // file. The string contains the base64 encoding of the gzip-compressed bytes. |
1733 var serializedRuntimeTypeInfo = "H4sIAAAJbogC/+xaT3PbRBTXH4eaf6nTDI0oberQNrgwR
KYcyOTUGShNhhnIEA7kQkZ21omDbQlJZgwnjjlyzEfgI+Rj8DFy5MgNVtFbe73alSxHltYZ78zOWooU7
fu93/uzu89QwlaB8RxG9v42da3iXobrD3Bfxd2zuk4H7ex8a3XR8XeNM9T0uc8/gXd+ONx/dfTNq8Od8
MUt9j32+5cw1nAv4V5l5vUjjA6Mj3Ff43zna6vp2+5vE89D9H++R7/0kedfz8Pg/t1z7J6HdmG+gRw6g
2NwfVEdx7X28fi1Ux/JrVByk/Yvc/2Sua4zOP0HjX2OtLu438Gd4HQf/14e6ncIX0Q/G7i/hXsL959wN
/uea3bsptUxT2z7pIPMU7uLzN9dy+zaZ7bpuc3wh9NvdNpNs93zkduymsgzG+3ecbt34pk+Btgzwy8ft
cIvbwUvdaPfJ/g8xH0Jfgf4aYBzicJjiXr+HIhZXQ7Hv1fC8dTg434F40VpMtwVCnf6/4lw/8o+8PutV
kS+D0GWvPCtMn6AyD3QJ5c3aHWBvGsgM8j7qQv2xMpNWp680qjvn6rj8tL2u8SxP1HLih8inAJ+3CuAH
wozD4OZL/GTSX6Uh28pBt/yFPiqMfi+A99z2g7ixZ8A389yxLdC+TCVE0cNau4adT1ruzVgLiO7DePcw
m75rQI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9KKfRSiolPj3B/L5i/9TPizZh3nnKb4tMzwIArP5VbLuw5nT0H730uw
f6lrPEpax4HvnM9hsckOC14nI7Hz8FHLHjMj0sDkmepfL0QvV7A+BfD58uY/Wh6PlVOXnWHs248QO6v7
eb1BsFEdSii9eYDODcVLDMjPHmYc51DklxGzDmORumVPR/b1+PPHWZ1fn2A/GudsfN+dMvOHUh9A8grT
X2DrPvDPTBkHi9W5nB/mPCprGV7fkfs6LXAjtYlsaMrJVs7ei2ZHZUn4IcSE9dmdc45wkmOuox58zfrw
DnZ/Y1onWG8EY9T2jpQUp/F1IGS2xH83oX38sKPrQeukbofsKs/dDHvFGVUKzpr3r0J+hsI9g2XQed54
Za23qCUc73dXbhXVL0dDx+NDuQZ1DVpnPuk3YN1Rtd20VEAksfnTTA+LiDeqyAD4U2ZE2fUKdb9lSlw1
G+w7l8Fn18EfrKs+2n/KYor23o2cYWtLyT5HVNWGNHT/ZzjCrteNtT5iCNrizgS2Q8pMo4k1X+S5/8PA
AD//wmWKGaINQAA"; |
1734 | 1797 |
1735 // Deserialize RuntimeTypeInfo | 1798 // Deserialize RuntimeTypeInfo |
1736 var bytes = BASE64.decode(serializedRuntimeTypeInfo); | 1799 var bytes = BASE64.decode(serializedRuntimeTypeInfo); |
1737 var unzippedBytes = new ZLibDecoder().convert(bytes); | 1800 var unzippedBytes = new ZLibDecoder().convert(bytes); |
1738 var bdata = new ByteData.view(unzippedBytes.buffer); | 1801 var bdata = new ByteData.view(unzippedBytes.buffer); |
1739 var message = new bindings.Message(bdata, null, unzippedBytes.length, 0); | 1802 var message = new bindings.Message(bdata, null, unzippedBytes.length, 0); |
1740 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message); | 1803 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message); |
1741 sample_import_mojom.getAllMojomTypeDefinitions() | 1804 sample_import_mojom.getAllMojomTypeDefinitions() |
1742 .forEach((String s, mojom_types.UserDefinedType udt) { | 1805 .forEach((String s, mojom_types.UserDefinedType udt) { |
1743 _runtimeTypeInfo.typeMap[s] = udt; | 1806 _runtimeTypeInfo.typeMap[s] = udt; |
1744 }); | 1807 }); |
1745 | 1808 |
1746 return _runtimeTypeInfo; | 1809 return _runtimeTypeInfo; |
1747 } | 1810 } |
OLD | NEW |