| // mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.mojom-lite-for-compile.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2018 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| /** |
| * @fileoverview |
| * @suppress {missingRequire} |
| */ |
| 'use strict'; |
| |
| goog.require('mojo.internal'); |
| goog.require('mojo.internal.interfaceSupport'); |
| |
| |
| |
| |
| |
| |
| |
| goog.provide('mojo.test.InterfaceX'); |
| goog.provide('mojo.test.InterfaceXReceiver'); |
| goog.provide('mojo.test.InterfaceXCallbackRouter'); |
| goog.provide('mojo.test.InterfaceXInterface'); |
| goog.provide('mojo.test.InterfaceXRemote'); |
| goog.provide('mojo.test.InterfaceXPendingReceiver'); |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| * @export |
| */ |
| mojo.test.InterfaceXPendingReceiver = class { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind( |
| this.handle, |
| mojo.test.InterfaceX.$interfaceName, |
| scope); |
| } |
| }; |
| |
| /** @interface */ |
| mojo.test.InterfaceXInterface = class { |
| }; |
| |
| /** |
| * @export |
| * @implements { mojo.test.InterfaceXInterface } |
| */ |
| mojo.test.InterfaceXRemote = class { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!mojo.test.InterfaceXPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| mojo.test.InterfaceXPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!mojo.test.InterfaceXPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the InterfaceX |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| mojo.test.InterfaceXReceiver = class { |
| /** |
| * @param {!mojo.test.InterfaceXInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!mojo.test.InterfaceXRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| mojo.test.InterfaceXRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!mojo.test.InterfaceXRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| }; |
| |
| /** |
| * @export |
| */ |
| mojo.test.InterfaceX = class { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "mojo.test.InterfaceX"; |
| } |
| |
| /** |
| * Returns a remote 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 {!mojo.test.InterfaceXRemote} |
| * @export |
| */ |
| static getRemote() { |
| let remote = new mojo.test.InterfaceXRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| }; |
| |
| |
| /** |
| * An object which receives request messages for the InterfaceX |
| * 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 |
| */ |
| mojo.test.InterfaceXCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| mojo.test.InterfaceXRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!mojo.test.InterfaceXRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** @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('mojo.test.AssociatedConformanceTestInterface'); |
| goog.provide('mojo.test.AssociatedConformanceTestInterfaceReceiver'); |
| goog.provide('mojo.test.AssociatedConformanceTestInterfaceCallbackRouter'); |
| goog.provide('mojo.test.AssociatedConformanceTestInterfaceInterface'); |
| goog.provide('mojo.test.AssociatedConformanceTestInterfaceRemote'); |
| goog.provide('mojo.test.AssociatedConformanceTestInterfacePendingReceiver'); |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterfacePendingReceiver = class { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind( |
| this.handle, |
| mojo.test.AssociatedConformanceTestInterface.$interfaceName, |
| scope); |
| } |
| }; |
| |
| /** @interface */ |
| mojo.test.AssociatedConformanceTestInterfaceInterface = class { |
| |
| /** |
| * @param { !Object } param0 |
| */ |
| |
| method0(param0) {} |
| |
| /** |
| * @param { !Object } param0 |
| */ |
| |
| method1(param0) {} |
| |
| /** |
| * @param { ?Object } param0 |
| */ |
| |
| method2(param0) {} |
| |
| /** |
| * @param { !Array<!Object> } param0 |
| */ |
| |
| method3(param0) {} |
| }; |
| |
| /** |
| * @export |
| * @implements { mojo.test.AssociatedConformanceTestInterfaceInterface } |
| */ |
| mojo.test.AssociatedConformanceTestInterfaceRemote = class { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!mojo.test.AssociatedConformanceTestInterfacePendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| mojo.test.AssociatedConformanceTestInterfacePendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!mojo.test.AssociatedConformanceTestInterfacePendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @param { !Object } param0 |
| */ |
| |
| method0( |
| param0) { |
| this.proxy.sendMessage( |
| 0, |
| mojo.test.AssociatedConformanceTestInterface_Method0_ParamsSpec.$, |
| null, |
| [ |
| param0 |
| ]); |
| } |
| |
| |
| /** |
| * @param { !Object } param0 |
| */ |
| |
| method1( |
| param0) { |
| this.proxy.sendMessage( |
| 1, |
| mojo.test.AssociatedConformanceTestInterface_Method1_ParamsSpec.$, |
| null, |
| [ |
| param0 |
| ]); |
| } |
| |
| |
| /** |
| * @param { ?Object } param0 |
| */ |
| |
| method2( |
| param0) { |
| this.proxy.sendMessage( |
| 2, |
| mojo.test.AssociatedConformanceTestInterface_Method2_ParamsSpec.$, |
| null, |
| [ |
| param0 |
| ]); |
| } |
| |
| |
| /** |
| * @param { !Array<!Object> } param0 |
| */ |
| |
| method3( |
| param0) { |
| this.proxy.sendMessage( |
| 3, |
| mojo.test.AssociatedConformanceTestInterface_Method3_ParamsSpec.$, |
| null, |
| [ |
| param0 |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the AssociatedConformanceTestInterface |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterfaceReceiver = class { |
| /** |
| * @param {!mojo.test.AssociatedConformanceTestInterfaceInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!mojo.test.AssociatedConformanceTestInterfaceRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| mojo.test.AssociatedConformanceTestInterfaceRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!mojo.test.AssociatedConformanceTestInterfaceRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| mojo.test.AssociatedConformanceTestInterface_Method0_ParamsSpec.$, |
| null, |
| impl.method0.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 1, |
| mojo.test.AssociatedConformanceTestInterface_Method1_ParamsSpec.$, |
| null, |
| impl.method1.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 2, |
| mojo.test.AssociatedConformanceTestInterface_Method2_ParamsSpec.$, |
| null, |
| impl.method2.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 3, |
| mojo.test.AssociatedConformanceTestInterface_Method3_ParamsSpec.$, |
| null, |
| impl.method3.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| }; |
| |
| /** |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterface = class { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "mojo.test.AssociatedConformanceTestInterface"; |
| } |
| |
| /** |
| * Returns a remote 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 {!mojo.test.AssociatedConformanceTestInterfaceRemote} |
| * @export |
| */ |
| static getRemote() { |
| let remote = new mojo.test.AssociatedConformanceTestInterfaceRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| }; |
| |
| |
| /** |
| * An object which receives request messages for the AssociatedConformanceTestInterface |
| * 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 |
| */ |
| mojo.test.AssociatedConformanceTestInterfaceCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| mojo.test.AssociatedConformanceTestInterfaceRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!mojo.test.AssociatedConformanceTestInterfaceRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.method0 = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| mojo.test.AssociatedConformanceTestInterface_Method0_ParamsSpec.$, |
| null, |
| this.method0.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.method1 = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1, |
| mojo.test.AssociatedConformanceTestInterface_Method1_ParamsSpec.$, |
| null, |
| this.method1.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.method2 = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 2, |
| mojo.test.AssociatedConformanceTestInterface_Method2_ParamsSpec.$, |
| null, |
| this.method2.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.method3 = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 3, |
| mojo.test.AssociatedConformanceTestInterface_Method3_ParamsSpec.$, |
| null, |
| this.method3.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('mojo.test.AssociatedConformanceTestInterface_Method0_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterface_Method0_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method1_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterface_Method1_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method2_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterface_Method2_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method3_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mojo.test.AssociatedConformanceTestInterface_Method3_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| mojo.test.AssociatedConformanceTestInterface_Method0_ParamsSpec.$, |
| 'AssociatedConformanceTestInterface_Method0_Params', |
| [ |
| mojo.internal.StructField( |
| 'param0', 0, |
| 0, |
| mojo.internal.AssociatedInterfaceProxy(mojo.test.InterfaceXRemote), |
| null, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method0_Params'); |
| |
| /** @record */ |
| mojo.test.AssociatedConformanceTestInterface_Method0_Params = class { |
| constructor() { |
| /** @export { !Object } */ |
| this.param0; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mojo.test.AssociatedConformanceTestInterface_Method1_ParamsSpec.$, |
| 'AssociatedConformanceTestInterface_Method1_Params', |
| [ |
| mojo.internal.StructField( |
| 'param0', 0, |
| 0, |
| mojo.internal.AssociatedInterfaceRequest(mojo.test.InterfaceXPendingReceiver), |
| null, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method1_Params'); |
| |
| /** @record */ |
| mojo.test.AssociatedConformanceTestInterface_Method1_Params = class { |
| constructor() { |
| /** @export { !Object } */ |
| this.param0; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mojo.test.AssociatedConformanceTestInterface_Method2_ParamsSpec.$, |
| 'AssociatedConformanceTestInterface_Method2_Params', |
| [ |
| mojo.internal.StructField( |
| 'param0', 0, |
| 0, |
| mojo.internal.AssociatedInterfaceProxy(mojo.test.InterfaceXRemote), |
| null, |
| true, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method2_Params'); |
| |
| /** @record */ |
| mojo.test.AssociatedConformanceTestInterface_Method2_Params = class { |
| constructor() { |
| /** @export { (Object|undefined) } */ |
| this.param0; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mojo.test.AssociatedConformanceTestInterface_Method3_ParamsSpec.$, |
| 'AssociatedConformanceTestInterface_Method3_Params', |
| [ |
| mojo.internal.StructField( |
| 'param0', 0, |
| 0, |
| mojo.internal.Array(mojo.internal.AssociatedInterfaceProxy(mojo.test.InterfaceXRemote), false), |
| null, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| goog.provide('mojo.test.AssociatedConformanceTestInterface_Method3_Params'); |
| |
| /** @record */ |
| mojo.test.AssociatedConformanceTestInterface_Method3_Params = class { |
| constructor() { |
| /** @export { !Array<!Object> } */ |
| this.param0; |
| } |
| }; |
| |