| 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 surfaces_mojom; | 5 library surfaces_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/geometry.mojom.dart' as geometry_mojom; | 10 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 map["idNamespace"] = idNamespace; | 881 map["idNamespace"] = idNamespace; |
| 882 return map; | 882 return map; |
| 883 } | 883 } |
| 884 } | 884 } |
| 885 | 885 |
| 886 | 886 |
| 887 class _SurfaceSetResourceReturnerParams extends bindings.Struct { | 887 class _SurfaceSetResourceReturnerParams extends bindings.Struct { |
| 888 static const List<bindings.StructDataHeader> kVersions = const [ | 888 static const List<bindings.StructDataHeader> kVersions = const [ |
| 889 const bindings.StructDataHeader(16, 0) | 889 const bindings.StructDataHeader(16, 0) |
| 890 ]; | 890 ]; |
| 891 Object returner = null; | 891 ResourceReturnerInterface returner = null; |
| 892 | 892 |
| 893 _SurfaceSetResourceReturnerParams() : super(kVersions.last.size); | 893 _SurfaceSetResourceReturnerParams() : super(kVersions.last.size); |
| 894 | 894 |
| 895 static _SurfaceSetResourceReturnerParams deserialize(bindings.Message message)
{ | 895 static _SurfaceSetResourceReturnerParams deserialize(bindings.Message message)
{ |
| 896 var decoder = new bindings.Decoder(message); | 896 var decoder = new bindings.Decoder(message); |
| 897 var result = decode(decoder); | 897 var result = decode(decoder); |
| 898 if (decoder.excessHandles != null) { | 898 if (decoder.excessHandles != null) { |
| 899 decoder.excessHandles.forEach((h) => h.close()); | 899 decoder.excessHandles.forEach((h) => h.close()); |
| 900 } | 900 } |
| 901 return result; | 901 return result; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 | 1251 |
| 1252 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1252 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 1253 responseFactory(null); | 1253 responseFactory(null); |
| 1254 | 1254 |
| 1255 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1255 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 1256 responseFactory(null); | 1256 responseFactory(null); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 abstract class ResourceReturner { | 1259 abstract class ResourceReturner { |
| 1260 static const String serviceName = null; | 1260 static const String serviceName = null; |
| 1261 |
| 1262 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1263 static service_describer.ServiceDescription get serviceDescription { |
| 1264 if (_cachedServiceDescription == null) { |
| 1265 _cachedServiceDescription = new _ResourceReturnerServiceDescription(); |
| 1266 } |
| 1267 return _cachedServiceDescription; |
| 1268 } |
| 1269 |
| 1270 static ResourceReturnerProxy connectToService( |
| 1271 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 1272 ResourceReturnerProxy p = new ResourceReturnerProxy.unbound(); |
| 1273 String name = serviceName ?? ResourceReturner.serviceName; |
| 1274 if ((name == null) || name.isEmpty) { |
| 1275 throw new core.MojoApiError( |
| 1276 "If an interface has no ServiceName, then one must be provided."); |
| 1277 } |
| 1278 s.connectToService(url, p, name); |
| 1279 return p; |
| 1280 } |
| 1261 void returnResources(List<ReturnedResource> resources); | 1281 void returnResources(List<ReturnedResource> resources); |
| 1262 } | 1282 } |
| 1263 | 1283 |
| 1284 abstract class ResourceReturnerInterface |
| 1285 implements bindings.MojoInterface<ResourceReturner>, |
| 1286 ResourceReturner { |
| 1287 factory ResourceReturnerInterface([ResourceReturner impl]) => |
| 1288 new ResourceReturnerStub.unbound(impl); |
| 1289 factory ResourceReturnerInterface.fromEndpoint( |
| 1290 core.MojoMessagePipeEndpoint endpoint, |
| 1291 [ResourceReturner impl]) => |
| 1292 new ResourceReturnerStub.fromEndpoint(endpoint, impl); |
| 1293 } |
| 1294 |
| 1295 abstract class ResourceReturnerInterfaceRequest |
| 1296 implements bindings.MojoInterface<ResourceReturner>, |
| 1297 ResourceReturner { |
| 1298 factory ResourceReturnerInterfaceRequest() => |
| 1299 new ResourceReturnerProxy.unbound(); |
| 1300 } |
| 1301 |
| 1264 class _ResourceReturnerProxyControl | 1302 class _ResourceReturnerProxyControl |
| 1265 extends bindings.ProxyMessageHandler | 1303 extends bindings.ProxyMessageHandler |
| 1266 implements bindings.ProxyControl { | 1304 implements bindings.ProxyControl<ResourceReturner> { |
| 1267 _ResourceReturnerProxyControl.fromEndpoint( | 1305 _ResourceReturnerProxyControl.fromEndpoint( |
| 1268 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1306 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 1269 | 1307 |
| 1270 _ResourceReturnerProxyControl.fromHandle( | 1308 _ResourceReturnerProxyControl.fromHandle( |
| 1271 core.MojoHandle handle) : super.fromHandle(handle); | 1309 core.MojoHandle handle) : super.fromHandle(handle); |
| 1272 | 1310 |
| 1273 _ResourceReturnerProxyControl.unbound() : super.unbound(); | 1311 _ResourceReturnerProxyControl.unbound() : super.unbound(); |
| 1274 | 1312 |
| 1275 service_describer.ServiceDescription get serviceDescription => | |
| 1276 new _ResourceReturnerServiceDescription(); | |
| 1277 | |
| 1278 String get serviceName => ResourceReturner.serviceName; | 1313 String get serviceName => ResourceReturner.serviceName; |
| 1279 | 1314 |
| 1280 void handleResponse(bindings.ServiceMessage message) { | 1315 void handleResponse(bindings.ServiceMessage message) { |
| 1281 switch (message.header.type) { | 1316 switch (message.header.type) { |
| 1282 default: | 1317 default: |
| 1283 proxyError("Unexpected message type: ${message.header.type}"); | 1318 proxyError("Unexpected message type: ${message.header.type}"); |
| 1284 close(immediate: true); | 1319 close(immediate: true); |
| 1285 break; | 1320 break; |
| 1286 } | 1321 } |
| 1287 } | 1322 } |
| 1288 | 1323 |
| 1324 ResourceReturner get impl => null; |
| 1325 set impl(ResourceReturner _) { |
| 1326 throw new core.MojoApiError("The impl of a Proxy cannot be set."); |
| 1327 } |
| 1328 |
| 1289 @override | 1329 @override |
| 1290 String toString() { | 1330 String toString() { |
| 1291 var superString = super.toString(); | 1331 var superString = super.toString(); |
| 1292 return "_ResourceReturnerProxyControl($superString)"; | 1332 return "_ResourceReturnerProxyControl($superString)"; |
| 1293 } | 1333 } |
| 1294 } | 1334 } |
| 1295 | 1335 |
| 1296 class ResourceReturnerProxy | 1336 class ResourceReturnerProxy |
| 1297 extends bindings.Proxy | 1337 extends bindings.Proxy<ResourceReturner> |
| 1298 implements ResourceReturner { | 1338 implements ResourceReturner, |
| 1339 ResourceReturnerInterface, |
| 1340 ResourceReturnerInterfaceRequest { |
| 1299 ResourceReturnerProxy.fromEndpoint( | 1341 ResourceReturnerProxy.fromEndpoint( |
| 1300 core.MojoMessagePipeEndpoint endpoint) | 1342 core.MojoMessagePipeEndpoint endpoint) |
| 1301 : super(new _ResourceReturnerProxyControl.fromEndpoint(endpoint)); | 1343 : super(new _ResourceReturnerProxyControl.fromEndpoint(endpoint)); |
| 1302 | 1344 |
| 1303 ResourceReturnerProxy.fromHandle(core.MojoHandle handle) | 1345 ResourceReturnerProxy.fromHandle(core.MojoHandle handle) |
| 1304 : super(new _ResourceReturnerProxyControl.fromHandle(handle)); | 1346 : super(new _ResourceReturnerProxyControl.fromHandle(handle)); |
| 1305 | 1347 |
| 1306 ResourceReturnerProxy.unbound() | 1348 ResourceReturnerProxy.unbound() |
| 1307 : super(new _ResourceReturnerProxyControl.unbound()); | 1349 : super(new _ResourceReturnerProxyControl.unbound()); |
| 1308 | 1350 |
| 1309 static ResourceReturnerProxy newFromEndpoint( | 1351 static ResourceReturnerProxy newFromEndpoint( |
| 1310 core.MojoMessagePipeEndpoint endpoint) { | 1352 core.MojoMessagePipeEndpoint endpoint) { |
| 1311 assert(endpoint.setDescription("For ResourceReturnerProxy")); | 1353 assert(endpoint.setDescription("For ResourceReturnerProxy")); |
| 1312 return new ResourceReturnerProxy.fromEndpoint(endpoint); | 1354 return new ResourceReturnerProxy.fromEndpoint(endpoint); |
| 1313 } | 1355 } |
| 1314 | 1356 |
| 1315 factory ResourceReturnerProxy.connectToService( | |
| 1316 bindings.ServiceConnector s, String url, [String serviceName]) { | |
| 1317 ResourceReturnerProxy p = new ResourceReturnerProxy.unbound(); | |
| 1318 s.connectToService(url, p, serviceName); | |
| 1319 return p; | |
| 1320 } | |
| 1321 | |
| 1322 | 1357 |
| 1323 void returnResources(List<ReturnedResource> resources) { | 1358 void returnResources(List<ReturnedResource> resources) { |
| 1324 if (!ctrl.isBound) { | 1359 if (!ctrl.isBound) { |
| 1325 ctrl.proxyError("The Proxy is closed."); | 1360 ctrl.proxyError("The Proxy is closed."); |
| 1326 return; | 1361 return; |
| 1327 } | 1362 } |
| 1328 var params = new _ResourceReturnerReturnResourcesParams(); | 1363 var params = new _ResourceReturnerReturnResourcesParams(); |
| 1329 params.resources = resources; | 1364 params.resources = resources; |
| 1330 ctrl.sendMessage(params, | 1365 ctrl.sendMessage(params, |
| 1331 _resourceReturnerMethodReturnResourcesName); | 1366 _resourceReturnerMethodReturnResourcesName); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1344 } | 1379 } |
| 1345 | 1380 |
| 1346 _ResourceReturnerStubControl.fromHandle( | 1381 _ResourceReturnerStubControl.fromHandle( |
| 1347 core.MojoHandle handle, [ResourceReturner impl]) | 1382 core.MojoHandle handle, [ResourceReturner impl]) |
| 1348 : super.fromHandle(handle, autoBegin: impl != null) { | 1383 : super.fromHandle(handle, autoBegin: impl != null) { |
| 1349 _impl = impl; | 1384 _impl = impl; |
| 1350 } | 1385 } |
| 1351 | 1386 |
| 1352 _ResourceReturnerStubControl.unbound([this._impl]) : super.unbound(); | 1387 _ResourceReturnerStubControl.unbound([this._impl]) : super.unbound(); |
| 1353 | 1388 |
| 1389 String get serviceName => ResourceReturner.serviceName; |
| 1390 |
| 1354 | 1391 |
| 1355 | 1392 |
| 1356 dynamic handleMessage(bindings.ServiceMessage message) { | 1393 dynamic handleMessage(bindings.ServiceMessage message) { |
| 1357 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1394 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 1358 return bindings.ControlMessageHandler.handleMessage(this, | 1395 return bindings.ControlMessageHandler.handleMessage(this, |
| 1359 0, | 1396 0, |
| 1360 message); | 1397 message); |
| 1361 } | 1398 } |
| 1362 if (_impl == null) { | 1399 if (_impl == null) { |
| 1363 throw new core.MojoApiError("$this has no implementation set"); | 1400 throw new core.MojoApiError("$this has no implementation set"); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1394 } | 1431 } |
| 1395 } | 1432 } |
| 1396 | 1433 |
| 1397 @override | 1434 @override |
| 1398 String toString() { | 1435 String toString() { |
| 1399 var superString = super.toString(); | 1436 var superString = super.toString(); |
| 1400 return "_ResourceReturnerStubControl($superString)"; | 1437 return "_ResourceReturnerStubControl($superString)"; |
| 1401 } | 1438 } |
| 1402 | 1439 |
| 1403 int get version => 0; | 1440 int get version => 0; |
| 1404 | |
| 1405 static service_describer.ServiceDescription _cachedServiceDescription; | |
| 1406 static service_describer.ServiceDescription get serviceDescription { | |
| 1407 if (_cachedServiceDescription == null) { | |
| 1408 _cachedServiceDescription = new _ResourceReturnerServiceDescription(); | |
| 1409 } | |
| 1410 return _cachedServiceDescription; | |
| 1411 } | |
| 1412 } | 1441 } |
| 1413 | 1442 |
| 1414 class ResourceReturnerStub | 1443 class ResourceReturnerStub |
| 1415 extends bindings.Stub<ResourceReturner> | 1444 extends bindings.Stub<ResourceReturner> |
| 1416 implements ResourceReturner { | 1445 implements ResourceReturner, |
| 1446 ResourceReturnerInterface, |
| 1447 ResourceReturnerInterfaceRequest { |
| 1448 ResourceReturnerStub.unbound([ResourceReturner impl]) |
| 1449 : super(new _ResourceReturnerStubControl.unbound(impl)); |
| 1450 |
| 1417 ResourceReturnerStub.fromEndpoint( | 1451 ResourceReturnerStub.fromEndpoint( |
| 1418 core.MojoMessagePipeEndpoint endpoint, [ResourceReturner impl]) | 1452 core.MojoMessagePipeEndpoint endpoint, [ResourceReturner impl]) |
| 1419 : super(new _ResourceReturnerStubControl.fromEndpoint(endpoint, impl)); | 1453 : super(new _ResourceReturnerStubControl.fromEndpoint(endpoint, impl)); |
| 1420 | 1454 |
| 1421 ResourceReturnerStub.fromHandle( | 1455 ResourceReturnerStub.fromHandle( |
| 1422 core.MojoHandle handle, [ResourceReturner impl]) | 1456 core.MojoHandle handle, [ResourceReturner impl]) |
| 1423 : super(new _ResourceReturnerStubControl.fromHandle(handle, impl)); | 1457 : super(new _ResourceReturnerStubControl.fromHandle(handle, impl)); |
| 1424 | 1458 |
| 1425 ResourceReturnerStub.unbound([ResourceReturner impl]) | |
| 1426 : super(new _ResourceReturnerStubControl.unbound(impl)); | |
| 1427 | |
| 1428 static ResourceReturnerStub newFromEndpoint( | 1459 static ResourceReturnerStub newFromEndpoint( |
| 1429 core.MojoMessagePipeEndpoint endpoint) { | 1460 core.MojoMessagePipeEndpoint endpoint) { |
| 1430 assert(endpoint.setDescription("For ResourceReturnerStub")); | 1461 assert(endpoint.setDescription("For ResourceReturnerStub")); |
| 1431 return new ResourceReturnerStub.fromEndpoint(endpoint); | 1462 return new ResourceReturnerStub.fromEndpoint(endpoint); |
| 1432 } | 1463 } |
| 1433 | 1464 |
| 1434 static service_describer.ServiceDescription get serviceDescription => | |
| 1435 _ResourceReturnerStubControl.serviceDescription; | |
| 1436 | |
| 1437 | 1465 |
| 1438 void returnResources(List<ReturnedResource> resources) { | 1466 void returnResources(List<ReturnedResource> resources) { |
| 1439 return impl.returnResources(resources); | 1467 return impl.returnResources(resources); |
| 1440 } | 1468 } |
| 1441 } | 1469 } |
| 1442 | 1470 |
| 1443 const int _surfaceMethodGetIdNamespaceName = 0; | 1471 const int _surfaceMethodGetIdNamespaceName = 0; |
| 1444 const int _surfaceMethodSetResourceReturnerName = 1; | 1472 const int _surfaceMethodSetResourceReturnerName = 1; |
| 1445 const int _surfaceMethodCreateSurfaceName = 2; | 1473 const int _surfaceMethodCreateSurfaceName = 2; |
| 1446 const int _surfaceMethodSubmitFrameName = 3; | 1474 const int _surfaceMethodSubmitFrameName = 3; |
| 1447 const int _surfaceMethodDestroySurfaceName = 4; | 1475 const int _surfaceMethodDestroySurfaceName = 4; |
| 1448 | 1476 |
| 1449 class _SurfaceServiceDescription implements service_describer.ServiceDescription
{ | 1477 class _SurfaceServiceDescription implements service_describer.ServiceDescription
{ |
| 1450 dynamic getTopLevelInterface([Function responseFactory]) => | 1478 dynamic getTopLevelInterface([Function responseFactory]) => |
| 1451 responseFactory(null); | 1479 responseFactory(null); |
| 1452 | 1480 |
| 1453 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1481 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 1454 responseFactory(null); | 1482 responseFactory(null); |
| 1455 | 1483 |
| 1456 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1484 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 1457 responseFactory(null); | 1485 responseFactory(null); |
| 1458 } | 1486 } |
| 1459 | 1487 |
| 1460 abstract class Surface { | 1488 abstract class Surface { |
| 1461 static const String serviceName = "mojo::Surface"; | 1489 static const String serviceName = "mojo::Surface"; |
| 1490 |
| 1491 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1492 static service_describer.ServiceDescription get serviceDescription { |
| 1493 if (_cachedServiceDescription == null) { |
| 1494 _cachedServiceDescription = new _SurfaceServiceDescription(); |
| 1495 } |
| 1496 return _cachedServiceDescription; |
| 1497 } |
| 1498 |
| 1499 static SurfaceProxy connectToService( |
| 1500 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 1501 SurfaceProxy p = new SurfaceProxy.unbound(); |
| 1502 String name = serviceName ?? Surface.serviceName; |
| 1503 if ((name == null) || name.isEmpty) { |
| 1504 throw new core.MojoApiError( |
| 1505 "If an interface has no ServiceName, then one must be provided."); |
| 1506 } |
| 1507 s.connectToService(url, p, name); |
| 1508 return p; |
| 1509 } |
| 1462 dynamic getIdNamespace([Function responseFactory = null]); | 1510 dynamic getIdNamespace([Function responseFactory = null]); |
| 1463 void setResourceReturner(Object returner); | 1511 void setResourceReturner(ResourceReturnerInterface returner); |
| 1464 void createSurface(int idLocal); | 1512 void createSurface(int idLocal); |
| 1465 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
; | 1513 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
; |
| 1466 void destroySurface(int idLocal); | 1514 void destroySurface(int idLocal); |
| 1467 } | 1515 } |
| 1468 | 1516 |
| 1517 abstract class SurfaceInterface |
| 1518 implements bindings.MojoInterface<Surface>, |
| 1519 Surface { |
| 1520 factory SurfaceInterface([Surface impl]) => |
| 1521 new SurfaceStub.unbound(impl); |
| 1522 factory SurfaceInterface.fromEndpoint( |
| 1523 core.MojoMessagePipeEndpoint endpoint, |
| 1524 [Surface impl]) => |
| 1525 new SurfaceStub.fromEndpoint(endpoint, impl); |
| 1526 } |
| 1527 |
| 1528 abstract class SurfaceInterfaceRequest |
| 1529 implements bindings.MojoInterface<Surface>, |
| 1530 Surface { |
| 1531 factory SurfaceInterfaceRequest() => |
| 1532 new SurfaceProxy.unbound(); |
| 1533 } |
| 1534 |
| 1469 class _SurfaceProxyControl | 1535 class _SurfaceProxyControl |
| 1470 extends bindings.ProxyMessageHandler | 1536 extends bindings.ProxyMessageHandler |
| 1471 implements bindings.ProxyControl { | 1537 implements bindings.ProxyControl<Surface> { |
| 1472 _SurfaceProxyControl.fromEndpoint( | 1538 _SurfaceProxyControl.fromEndpoint( |
| 1473 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1539 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 1474 | 1540 |
| 1475 _SurfaceProxyControl.fromHandle( | 1541 _SurfaceProxyControl.fromHandle( |
| 1476 core.MojoHandle handle) : super.fromHandle(handle); | 1542 core.MojoHandle handle) : super.fromHandle(handle); |
| 1477 | 1543 |
| 1478 _SurfaceProxyControl.unbound() : super.unbound(); | 1544 _SurfaceProxyControl.unbound() : super.unbound(); |
| 1479 | 1545 |
| 1480 service_describer.ServiceDescription get serviceDescription => | |
| 1481 new _SurfaceServiceDescription(); | |
| 1482 | |
| 1483 String get serviceName => Surface.serviceName; | 1546 String get serviceName => Surface.serviceName; |
| 1484 | 1547 |
| 1485 void handleResponse(bindings.ServiceMessage message) { | 1548 void handleResponse(bindings.ServiceMessage message) { |
| 1486 switch (message.header.type) { | 1549 switch (message.header.type) { |
| 1487 case _surfaceMethodGetIdNamespaceName: | 1550 case _surfaceMethodGetIdNamespaceName: |
| 1488 var r = SurfaceGetIdNamespaceResponseParams.deserialize( | 1551 var r = SurfaceGetIdNamespaceResponseParams.deserialize( |
| 1489 message.payload); | 1552 message.payload); |
| 1490 if (!message.header.hasRequestId) { | 1553 if (!message.header.hasRequestId) { |
| 1491 proxyError("Expected a message with a valid request Id."); | 1554 proxyError("Expected a message with a valid request Id."); |
| 1492 return; | 1555 return; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 } | 1587 } |
| 1525 c.complete(r); | 1588 c.complete(r); |
| 1526 break; | 1589 break; |
| 1527 default: | 1590 default: |
| 1528 proxyError("Unexpected message type: ${message.header.type}"); | 1591 proxyError("Unexpected message type: ${message.header.type}"); |
| 1529 close(immediate: true); | 1592 close(immediate: true); |
| 1530 break; | 1593 break; |
| 1531 } | 1594 } |
| 1532 } | 1595 } |
| 1533 | 1596 |
| 1597 Surface get impl => null; |
| 1598 set impl(Surface _) { |
| 1599 throw new core.MojoApiError("The impl of a Proxy cannot be set."); |
| 1600 } |
| 1601 |
| 1534 @override | 1602 @override |
| 1535 String toString() { | 1603 String toString() { |
| 1536 var superString = super.toString(); | 1604 var superString = super.toString(); |
| 1537 return "_SurfaceProxyControl($superString)"; | 1605 return "_SurfaceProxyControl($superString)"; |
| 1538 } | 1606 } |
| 1539 } | 1607 } |
| 1540 | 1608 |
| 1541 class SurfaceProxy | 1609 class SurfaceProxy |
| 1542 extends bindings.Proxy | 1610 extends bindings.Proxy<Surface> |
| 1543 implements Surface { | 1611 implements Surface, |
| 1612 SurfaceInterface, |
| 1613 SurfaceInterfaceRequest { |
| 1544 SurfaceProxy.fromEndpoint( | 1614 SurfaceProxy.fromEndpoint( |
| 1545 core.MojoMessagePipeEndpoint endpoint) | 1615 core.MojoMessagePipeEndpoint endpoint) |
| 1546 : super(new _SurfaceProxyControl.fromEndpoint(endpoint)); | 1616 : super(new _SurfaceProxyControl.fromEndpoint(endpoint)); |
| 1547 | 1617 |
| 1548 SurfaceProxy.fromHandle(core.MojoHandle handle) | 1618 SurfaceProxy.fromHandle(core.MojoHandle handle) |
| 1549 : super(new _SurfaceProxyControl.fromHandle(handle)); | 1619 : super(new _SurfaceProxyControl.fromHandle(handle)); |
| 1550 | 1620 |
| 1551 SurfaceProxy.unbound() | 1621 SurfaceProxy.unbound() |
| 1552 : super(new _SurfaceProxyControl.unbound()); | 1622 : super(new _SurfaceProxyControl.unbound()); |
| 1553 | 1623 |
| 1554 static SurfaceProxy newFromEndpoint( | 1624 static SurfaceProxy newFromEndpoint( |
| 1555 core.MojoMessagePipeEndpoint endpoint) { | 1625 core.MojoMessagePipeEndpoint endpoint) { |
| 1556 assert(endpoint.setDescription("For SurfaceProxy")); | 1626 assert(endpoint.setDescription("For SurfaceProxy")); |
| 1557 return new SurfaceProxy.fromEndpoint(endpoint); | 1627 return new SurfaceProxy.fromEndpoint(endpoint); |
| 1558 } | 1628 } |
| 1559 | 1629 |
| 1560 factory SurfaceProxy.connectToService( | |
| 1561 bindings.ServiceConnector s, String url, [String serviceName]) { | |
| 1562 SurfaceProxy p = new SurfaceProxy.unbound(); | |
| 1563 s.connectToService(url, p, serviceName); | |
| 1564 return p; | |
| 1565 } | |
| 1566 | |
| 1567 | 1630 |
| 1568 dynamic getIdNamespace([Function responseFactory = null]) { | 1631 dynamic getIdNamespace([Function responseFactory = null]) { |
| 1569 var params = new _SurfaceGetIdNamespaceParams(); | 1632 var params = new _SurfaceGetIdNamespaceParams(); |
| 1570 return ctrl.sendMessageWithRequestId( | 1633 return ctrl.sendMessageWithRequestId( |
| 1571 params, | 1634 params, |
| 1572 _surfaceMethodGetIdNamespaceName, | 1635 _surfaceMethodGetIdNamespaceName, |
| 1573 -1, | 1636 -1, |
| 1574 bindings.MessageHeader.kMessageExpectsResponse); | 1637 bindings.MessageHeader.kMessageExpectsResponse); |
| 1575 } | 1638 } |
| 1576 void setResourceReturner(Object returner) { | 1639 void setResourceReturner(ResourceReturnerInterface returner) { |
| 1577 if (!ctrl.isBound) { | 1640 if (!ctrl.isBound) { |
| 1578 ctrl.proxyError("The Proxy is closed."); | 1641 ctrl.proxyError("The Proxy is closed."); |
| 1579 return; | 1642 return; |
| 1580 } | 1643 } |
| 1581 var params = new _SurfaceSetResourceReturnerParams(); | 1644 var params = new _SurfaceSetResourceReturnerParams(); |
| 1582 params.returner = returner; | 1645 params.returner = returner; |
| 1583 ctrl.sendMessage(params, | 1646 ctrl.sendMessage(params, |
| 1584 _surfaceMethodSetResourceReturnerName); | 1647 _surfaceMethodSetResourceReturnerName); |
| 1585 } | 1648 } |
| 1586 void createSurface(int idLocal) { | 1649 void createSurface(int idLocal) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 } | 1690 } |
| 1628 | 1691 |
| 1629 _SurfaceStubControl.fromHandle( | 1692 _SurfaceStubControl.fromHandle( |
| 1630 core.MojoHandle handle, [Surface impl]) | 1693 core.MojoHandle handle, [Surface impl]) |
| 1631 : super.fromHandle(handle, autoBegin: impl != null) { | 1694 : super.fromHandle(handle, autoBegin: impl != null) { |
| 1632 _impl = impl; | 1695 _impl = impl; |
| 1633 } | 1696 } |
| 1634 | 1697 |
| 1635 _SurfaceStubControl.unbound([this._impl]) : super.unbound(); | 1698 _SurfaceStubControl.unbound([this._impl]) : super.unbound(); |
| 1636 | 1699 |
| 1700 String get serviceName => Surface.serviceName; |
| 1701 |
| 1637 | 1702 |
| 1638 SurfaceGetIdNamespaceResponseParams _surfaceGetIdNamespaceResponseParamsFactor
y(int idNamespace) { | 1703 SurfaceGetIdNamespaceResponseParams _surfaceGetIdNamespaceResponseParamsFactor
y(int idNamespace) { |
| 1639 var result = new SurfaceGetIdNamespaceResponseParams(); | 1704 var result = new SurfaceGetIdNamespaceResponseParams(); |
| 1640 result.idNamespace = idNamespace; | 1705 result.idNamespace = idNamespace; |
| 1641 return result; | 1706 return result; |
| 1642 } | 1707 } |
| 1643 SurfaceSubmitFrameResponseParams _surfaceSubmitFrameResponseParamsFactory() { | 1708 SurfaceSubmitFrameResponseParams _surfaceSubmitFrameResponseParamsFactory() { |
| 1644 var result = new SurfaceSubmitFrameResponseParams(); | 1709 var result = new SurfaceSubmitFrameResponseParams(); |
| 1645 return result; | 1710 return result; |
| 1646 } | 1711 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1738 } | 1803 } |
| 1739 } | 1804 } |
| 1740 | 1805 |
| 1741 @override | 1806 @override |
| 1742 String toString() { | 1807 String toString() { |
| 1743 var superString = super.toString(); | 1808 var superString = super.toString(); |
| 1744 return "_SurfaceStubControl($superString)"; | 1809 return "_SurfaceStubControl($superString)"; |
| 1745 } | 1810 } |
| 1746 | 1811 |
| 1747 int get version => 0; | 1812 int get version => 0; |
| 1748 | |
| 1749 static service_describer.ServiceDescription _cachedServiceDescription; | |
| 1750 static service_describer.ServiceDescription get serviceDescription { | |
| 1751 if (_cachedServiceDescription == null) { | |
| 1752 _cachedServiceDescription = new _SurfaceServiceDescription(); | |
| 1753 } | |
| 1754 return _cachedServiceDescription; | |
| 1755 } | |
| 1756 } | 1813 } |
| 1757 | 1814 |
| 1758 class SurfaceStub | 1815 class SurfaceStub |
| 1759 extends bindings.Stub<Surface> | 1816 extends bindings.Stub<Surface> |
| 1760 implements Surface { | 1817 implements Surface, |
| 1818 SurfaceInterface, |
| 1819 SurfaceInterfaceRequest { |
| 1820 SurfaceStub.unbound([Surface impl]) |
| 1821 : super(new _SurfaceStubControl.unbound(impl)); |
| 1822 |
| 1761 SurfaceStub.fromEndpoint( | 1823 SurfaceStub.fromEndpoint( |
| 1762 core.MojoMessagePipeEndpoint endpoint, [Surface impl]) | 1824 core.MojoMessagePipeEndpoint endpoint, [Surface impl]) |
| 1763 : super(new _SurfaceStubControl.fromEndpoint(endpoint, impl)); | 1825 : super(new _SurfaceStubControl.fromEndpoint(endpoint, impl)); |
| 1764 | 1826 |
| 1765 SurfaceStub.fromHandle( | 1827 SurfaceStub.fromHandle( |
| 1766 core.MojoHandle handle, [Surface impl]) | 1828 core.MojoHandle handle, [Surface impl]) |
| 1767 : super(new _SurfaceStubControl.fromHandle(handle, impl)); | 1829 : super(new _SurfaceStubControl.fromHandle(handle, impl)); |
| 1768 | 1830 |
| 1769 SurfaceStub.unbound([Surface impl]) | |
| 1770 : super(new _SurfaceStubControl.unbound(impl)); | |
| 1771 | |
| 1772 static SurfaceStub newFromEndpoint( | 1831 static SurfaceStub newFromEndpoint( |
| 1773 core.MojoMessagePipeEndpoint endpoint) { | 1832 core.MojoMessagePipeEndpoint endpoint) { |
| 1774 assert(endpoint.setDescription("For SurfaceStub")); | 1833 assert(endpoint.setDescription("For SurfaceStub")); |
| 1775 return new SurfaceStub.fromEndpoint(endpoint); | 1834 return new SurfaceStub.fromEndpoint(endpoint); |
| 1776 } | 1835 } |
| 1777 | 1836 |
| 1778 static service_describer.ServiceDescription get serviceDescription => | |
| 1779 _SurfaceStubControl.serviceDescription; | |
| 1780 | |
| 1781 | 1837 |
| 1782 dynamic getIdNamespace([Function responseFactory = null]) { | 1838 dynamic getIdNamespace([Function responseFactory = null]) { |
| 1783 return impl.getIdNamespace(responseFactory); | 1839 return impl.getIdNamespace(responseFactory); |
| 1784 } | 1840 } |
| 1785 void setResourceReturner(Object returner) { | 1841 void setResourceReturner(ResourceReturnerInterface returner) { |
| 1786 return impl.setResourceReturner(returner); | 1842 return impl.setResourceReturner(returner); |
| 1787 } | 1843 } |
| 1788 void createSurface(int idLocal) { | 1844 void createSurface(int idLocal) { |
| 1789 return impl.createSurface(idLocal); | 1845 return impl.createSurface(idLocal); |
| 1790 } | 1846 } |
| 1791 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
{ | 1847 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
{ |
| 1792 return impl.submitFrame(idLocal,frame,responseFactory); | 1848 return impl.submitFrame(idLocal,frame,responseFactory); |
| 1793 } | 1849 } |
| 1794 void destroySurface(int idLocal) { | 1850 void destroySurface(int idLocal) { |
| 1795 return impl.destroySurface(idLocal); | 1851 return impl.destroySurface(idLocal); |
| 1796 } | 1852 } |
| 1797 } | 1853 } |
| 1798 | 1854 |
| 1799 | 1855 |
| 1800 | 1856 |
| OLD | NEW |