| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| 'use strict'; |
| |
| goog.require('mojo.internal'); |
| goog.require('mojo.internal.interfaceSupport'); |
| |
| |
| |
| |
| |
| |
| |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl'); |
| goog.provide('serviceManager.test.mojom.LifecycleControlCallbackRouter'); |
| goog.provide('serviceManager.test.mojom.LifecycleControlInterface'); |
| goog.provide('serviceManager.test.mojom.LifecycleControlProxy'); |
| goog.provide('serviceManager.test.mojom.LifecycleControlRequest'); |
| |
| |
| /** @export */ |
| serviceManager.test.mojom.LifecycleControlRequest = class { |
| /** @param {!MojoHandle} handle */ |
| constructor(handle) { |
| /** @public {!MojoHandle} */ |
| this.handle = handle; |
| } |
| }; |
| |
| /** @interface */ |
| serviceManager.test.mojom.LifecycleControlInterface = class { |
| |
| /** |
| * @return {Promise} |
| */ |
| |
| ping() {} |
| |
| /** |
| */ |
| |
| gracefulQuit() {} |
| |
| /** |
| */ |
| |
| crash() {} |
| |
| /** |
| */ |
| |
| closeServiceManagerConnection() {} |
| }; |
| |
| /** |
| * @export |
| * @implements { serviceManager.test.mojom.LifecycleControlInterface } |
| */ |
| serviceManager.test.mojom.LifecycleControlProxy = class { |
| /** @param {MojoHandle=} opt_handle */ |
| constructor(opt_handle) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!serviceManager.test.mojom.LifecycleControlRequest>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| serviceManager.test.mojom.LifecycleControlRequest, |
| opt_handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!serviceManager.test.mojom.LifecycleControlRequest>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @return {Promise} |
| */ |
| |
| ping() { |
| return this.proxy.sendMessage( |
| 1906418829, |
| serviceManager.test.mojom.LifecycleControl_Ping_ParamsSpec.$, |
| serviceManager.test.mojom.LifecycleControl_Ping_ResponseParamsSpec.$, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| gracefulQuit() { |
| this.proxy.sendMessage( |
| 1488666348, |
| serviceManager.test.mojom.LifecycleControl_GracefulQuit_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| crash() { |
| this.proxy.sendMessage( |
| 2138620233, |
| serviceManager.test.mojom.LifecycleControl_Crash_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| closeServiceManagerConnection() { |
| this.proxy.sendMessage( |
| 1066778586, |
| serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the LifecycleControl |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControl = class { |
| /** |
| * @param {!serviceManager.test.mojom.LifecycleControlInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!serviceManager.test.mojom.LifecycleControlProxy>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| serviceManager.test.mojom.LifecycleControlProxy); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!serviceManager.test.mojom.LifecycleControlProxy>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 1906418829, |
| serviceManager.test.mojom.LifecycleControl_Ping_ParamsSpec.$, |
| serviceManager.test.mojom.LifecycleControl_Ping_ResponseParamsSpec.$, |
| impl.ping.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 1488666348, |
| serviceManager.test.mojom.LifecycleControl_GracefulQuit_ParamsSpec.$, |
| null, |
| impl.gracefulQuit.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 2138620233, |
| serviceManager.test.mojom.LifecycleControl_Crash_ParamsSpec.$, |
| null, |
| impl.crash.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 1066778586, |
| serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_ParamsSpec.$, |
| null, |
| impl.closeServiceManagerConnection.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * Returns a proxy for this interface which sends messages to the browser. |
| * The browser must have an interface request binder registered for this |
| * interface and accessible to the calling document's frame. |
| * |
| * @return {!serviceManager.test.mojom.LifecycleControlProxy} |
| * @export |
| */ |
| static getProxy() { |
| let proxy = new serviceManager.test.mojom.LifecycleControlProxy; |
| Mojo.bindInterface('service_manager.test.mojom.LifecycleControl', |
| proxy.$.bindNewPipeAndPassReceiver().handle); |
| return proxy; |
| } |
| |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "service_manager.test.mojom.LifecycleControl"; |
| } |
| |
| }; |
| |
| |
| |
| |
| /** |
| * An object which receives request messages for the LifecycleControl |
| * mojom interface and dispatches them as callbacks. One callback receiver exists |
| * on this object for each message defined in the mojom interface, and each |
| * receiver can have any number of listeners added to it. |
| * |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControlCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| serviceManager.test.mojom.LifecycleControlProxy); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!serviceManager.test.mojom.LifecycleControlProxy>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.ping = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1906418829, |
| serviceManager.test.mojom.LifecycleControl_Ping_ParamsSpec.$, |
| serviceManager.test.mojom.LifecycleControl_Ping_ResponseParamsSpec.$, |
| this.ping.createReceiverHandler(true /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.gracefulQuit = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1488666348, |
| serviceManager.test.mojom.LifecycleControl_GracefulQuit_ParamsSpec.$, |
| null, |
| this.gracefulQuit.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.crash = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 2138620233, |
| serviceManager.test.mojom.LifecycleControl_Crash_ParamsSpec.$, |
| null, |
| this.crash.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.closeServiceManagerConnection = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1066778586, |
| serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_ParamsSpec.$, |
| null, |
| this.closeServiceManagerConnection.createReceiverHandler(false /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| * @export |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| }; |
| |
| |
| |
| goog.provide('serviceManager.test.mojom.Parent'); |
| goog.provide('serviceManager.test.mojom.ParentCallbackRouter'); |
| goog.provide('serviceManager.test.mojom.ParentInterface'); |
| goog.provide('serviceManager.test.mojom.ParentProxy'); |
| goog.provide('serviceManager.test.mojom.ParentRequest'); |
| |
| |
| /** @export */ |
| serviceManager.test.mojom.ParentRequest = class { |
| /** @param {!MojoHandle} handle */ |
| constructor(handle) { |
| /** @public {!MojoHandle} */ |
| this.handle = handle; |
| } |
| }; |
| |
| /** @interface */ |
| serviceManager.test.mojom.ParentInterface = class { |
| |
| /** |
| * @return {Promise} |
| */ |
| |
| connectToChild() {} |
| |
| /** |
| */ |
| |
| quit() {} |
| }; |
| |
| /** |
| * @export |
| * @implements { serviceManager.test.mojom.ParentInterface } |
| */ |
| serviceManager.test.mojom.ParentProxy = class { |
| /** @param {MojoHandle=} opt_handle */ |
| constructor(opt_handle) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!serviceManager.test.mojom.ParentRequest>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| serviceManager.test.mojom.ParentRequest, |
| opt_handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!serviceManager.test.mojom.ParentRequest>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @return {Promise} |
| */ |
| |
| connectToChild() { |
| return this.proxy.sendMessage( |
| 1959602151, |
| serviceManager.test.mojom.Parent_ConnectToChild_ParamsSpec.$, |
| serviceManager.test.mojom.Parent_ConnectToChild_ResponseParamsSpec.$, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| quit() { |
| this.proxy.sendMessage( |
| 1807123551, |
| serviceManager.test.mojom.Parent_Quit_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the Parent |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| serviceManager.test.mojom.Parent = class { |
| /** |
| * @param {!serviceManager.test.mojom.ParentInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!serviceManager.test.mojom.ParentProxy>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| serviceManager.test.mojom.ParentProxy); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!serviceManager.test.mojom.ParentProxy>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 1959602151, |
| serviceManager.test.mojom.Parent_ConnectToChild_ParamsSpec.$, |
| serviceManager.test.mojom.Parent_ConnectToChild_ResponseParamsSpec.$, |
| impl.connectToChild.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 1807123551, |
| serviceManager.test.mojom.Parent_Quit_ParamsSpec.$, |
| null, |
| impl.quit.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * Returns a proxy for this interface which sends messages to the browser. |
| * The browser must have an interface request binder registered for this |
| * interface and accessible to the calling document's frame. |
| * |
| * @return {!serviceManager.test.mojom.ParentProxy} |
| * @export |
| */ |
| static getProxy() { |
| let proxy = new serviceManager.test.mojom.ParentProxy; |
| Mojo.bindInterface('service_manager.test.mojom.Parent', |
| proxy.$.bindNewPipeAndPassReceiver().handle); |
| return proxy; |
| } |
| |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "service_manager.test.mojom.Parent"; |
| } |
| |
| }; |
| |
| |
| |
| |
| /** |
| * An object which receives request messages for the Parent |
| * mojom interface and dispatches them as callbacks. One callback receiver exists |
| * on this object for each message defined in the mojom interface, and each |
| * receiver can have any number of listeners added to it. |
| * |
| * @export |
| */ |
| serviceManager.test.mojom.ParentCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| serviceManager.test.mojom.ParentProxy); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!serviceManager.test.mojom.ParentProxy>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.connectToChild = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1959602151, |
| serviceManager.test.mojom.Parent_ConnectToChild_ParamsSpec.$, |
| serviceManager.test.mojom.Parent_ConnectToChild_ResponseParamsSpec.$, |
| this.connectToChild.createReceiverHandler(true /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.quit = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1807123551, |
| serviceManager.test.mojom.Parent_Quit_ParamsSpec.$, |
| null, |
| this.quit.createReceiverHandler(false /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| * @export |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| }; |
| |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_Ping_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControl_Ping_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_Ping_ResponseParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControl_Ping_ResponseParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_GracefulQuit_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControl_GracefulQuit_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_Crash_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControl_Crash_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.Parent_ConnectToChild_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.Parent_ConnectToChild_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.Parent_ConnectToChild_ResponseParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.Parent_ConnectToChild_ResponseParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('serviceManager.test.mojom.Parent_Quit_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| serviceManager.test.mojom.Parent_Quit_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.LifecycleControl_Ping_ParamsSpec.$, |
| 'LifecycleControl_Ping_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_Ping_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.LifecycleControl_Ping_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.LifecycleControl_Ping_ResponseParamsSpec.$, |
| 'LifecycleControl_Ping_ResponseParams', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_Ping_ResponseParams'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.LifecycleControl_Ping_ResponseParams; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.LifecycleControl_GracefulQuit_ParamsSpec.$, |
| 'LifecycleControl_GracefulQuit_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_GracefulQuit_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.LifecycleControl_GracefulQuit_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.LifecycleControl_Crash_ParamsSpec.$, |
| 'LifecycleControl_Crash_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_Crash_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.LifecycleControl_Crash_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_ParamsSpec.$, |
| 'LifecycleControl_CloseServiceManagerConnection_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.LifecycleControl_CloseServiceManagerConnection_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.Parent_ConnectToChild_ParamsSpec.$, |
| 'Parent_ConnectToChild_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.Parent_ConnectToChild_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.Parent_ConnectToChild_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.Parent_ConnectToChild_ResponseParamsSpec.$, |
| 'Parent_ConnectToChild_ResponseParams', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.Parent_ConnectToChild_ResponseParams'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.Parent_ConnectToChild_ResponseParams; |
| |
| |
| |
| mojo.internal.Struct( |
| serviceManager.test.mojom.Parent_Quit_ParamsSpec.$, |
| 'Parent_Quit_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('serviceManager.test.mojom.Parent_Quit_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| serviceManager.test.mojom.Parent_Quit_Params; |
| |