| Index: mojo/dart/packages/mojo/lib/mojo/shell.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo/lib/mojo/shell.mojom.dart b/mojo/dart/packages/mojo/lib/mojo/shell.mojom.dart
|
| index 60d7ab53df55c8788ebcdb6237bbc1e1f995e1a3..8fb813589b5c165ed8f77ac472ef7828a07a4516 100644
|
| --- a/mojo/dart/packages/mojo/lib/mojo/shell.mojom.dart
|
| +++ b/mojo/dart/packages/mojo/lib/mojo/shell.mojom.dart
|
| @@ -8,6 +8,7 @@ import 'dart:async';
|
|
|
| import 'package:mojo/bindings.dart' as bindings;
|
| import 'package:mojo/core.dart' as core;
|
| +import 'package:mojo/mojo/application_connector.mojom.dart' as application_connector_mojom;
|
| import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom;
|
|
|
|
|
| @@ -93,13 +94,81 @@ class ShellConnectToApplicationParams extends bindings.Struct {
|
| }
|
| }
|
|
|
| +
|
| +class ShellCreateApplicationConnectorParams extends bindings.Struct {
|
| + static const List<bindings.StructDataHeader> kVersions = const [
|
| + const bindings.StructDataHeader(16, 0)
|
| + ];
|
| + Object applicationConnectorRequest = null;
|
| +
|
| + ShellCreateApplicationConnectorParams() : super(kVersions.last.size);
|
| +
|
| + static ShellCreateApplicationConnectorParams deserialize(bindings.Message message) {
|
| + var decoder = new bindings.Decoder(message);
|
| + var result = decode(decoder);
|
| + if (decoder.excessHandles != null) {
|
| + decoder.excessHandles.forEach((h) => h.close());
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + static ShellCreateApplicationConnectorParams decode(bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + ShellCreateApplicationConnectorParams result = new ShellCreateApplicationConnectorParams();
|
| +
|
| + var mainDataHeader = decoder0.decodeStructDataHeader();
|
| + if (mainDataHeader.version <= kVersions.last.version) {
|
| + // Scan in reverse order to optimize for more recent versions.
|
| + for (int i = kVersions.length - 1; i >= 0; --i) {
|
| + if (mainDataHeader.version >= kVersions[i].version) {
|
| + if (mainDataHeader.size == kVersions[i].size) {
|
| + // Found a match.
|
| + break;
|
| + }
|
| + throw new bindings.MojoCodecError(
|
| + 'Header size doesn\'t correspond to known version size.');
|
| + }
|
| + }
|
| + } else if (mainDataHeader.size < kVersions.last.size) {
|
| + throw new bindings.MojoCodecError(
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| +
|
| + result.applicationConnectorRequest = decoder0.decodeInterfaceRequest(8, false, application_connector_mojom.ApplicationConnectorStub.newFromEndpoint);
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + void encode(bindings.Encoder encoder) {
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| +
|
| + encoder0.encodeInterfaceRequest(applicationConnectorRequest, 8, false);
|
| + }
|
| +
|
| + String toString() {
|
| + return "ShellCreateApplicationConnectorParams("
|
| + "applicationConnectorRequest: $applicationConnectorRequest" ")";
|
| + }
|
| +
|
| + Map toJson() {
|
| + throw new bindings.MojoCodecError(
|
| + 'Object containing handles cannot be encoded to JSON.');
|
| + }
|
| +}
|
| +
|
| const int kShell_connectToApplication_name = 0;
|
| +const int kShell_createApplicationConnector_name = 1;
|
|
|
| const String ShellName =
|
| 'mojo::Shell';
|
|
|
| abstract class Shell {
|
| void connectToApplication(String applicationUrl, Object services, Object exposedServices);
|
| + void createApplicationConnector(Object applicationConnectorRequest);
|
|
|
| }
|
|
|
| @@ -153,6 +222,16 @@ class _ShellProxyCalls implements Shell {
|
| _proxyImpl.sendMessage(params, kShell_connectToApplication_name);
|
| }
|
|
|
| + void createApplicationConnector(Object applicationConnectorRequest) {
|
| + if (!_proxyImpl.isBound) {
|
| + _proxyImpl.proxyError("The Proxy is closed.");
|
| + return;
|
| + }
|
| + var params = new ShellCreateApplicationConnectorParams();
|
| + params.applicationConnectorRequest = applicationConnectorRequest;
|
| + _proxyImpl.sendMessage(params, kShell_createApplicationConnector_name);
|
| + }
|
| +
|
| }
|
|
|
|
|
| @@ -249,6 +328,11 @@ class ShellStub extends bindings.Stub {
|
| message.payload);
|
| _impl.connectToApplication(params.applicationUrl, params.services, params.exposedServices);
|
| break;
|
| + case kShell_createApplicationConnector_name:
|
| + var params = ShellCreateApplicationConnectorParams.deserialize(
|
| + message.payload);
|
| + _impl.createApplicationConnector(params.applicationConnectorRequest);
|
| + break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| break;
|
|
|