| // mojom-webui/chrome/test/data/webui/mojo/mojo_file_system_access_test.mojom-webui.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2020 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. |
| |
| import {mojo} from '//resources/mojo/mojo/public/js/bindings.js'; |
| |
| |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| */ |
| export class MojoFileSystemAccessTestPendingReceiver { |
| /** |
| * @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, 'test.mojom.MojoFileSystemAccessTest', scope); |
| } |
| } |
| |
| /** @interface */ |
| export class MojoFileSystemAccessTestInterface { |
| |
| /** |
| * @param { !MojoHandle } h |
| */ |
| |
| resolveTransferToken(h) {} |
| } |
| |
| /** |
| * @implements { MojoFileSystemAccessTestInterface } |
| */ |
| export class MojoFileSystemAccessTestRemote { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!MojoFileSystemAccessTestPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| MojoFileSystemAccessTestPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!MojoFileSystemAccessTestPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @param { !MojoHandle } h |
| */ |
| |
| resolveTransferToken( |
| h) { |
| this.proxy.sendMessage( |
| 1060122247, |
| MojoFileSystemAccessTest_ResolveTransferToken_ParamsSpec.$, |
| null, |
| [ |
| h |
| ]); |
| } |
| } |
| |
| /** |
| * An object which receives request messages for the MojoFileSystemAccessTest |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| */ |
| export class MojoFileSystemAccessTestReceiver { |
| /** |
| * @param {!MojoFileSystemAccessTestInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!MojoFileSystemAccessTestRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| MojoFileSystemAccessTestRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!MojoFileSystemAccessTestRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 1060122247, |
| MojoFileSystemAccessTest_ResolveTransferToken_ParamsSpec.$, |
| null, |
| impl.resolveTransferToken.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| } |
| |
| export class MojoFileSystemAccessTest { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "test.mojom.MojoFileSystemAccessTest"; |
| } |
| |
| /** |
| * 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 {!MojoFileSystemAccessTestRemote} |
| */ |
| static getRemote() { |
| let remote = new MojoFileSystemAccessTestRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| } |
| |
| |
| /** |
| * An object which receives request messages for the MojoFileSystemAccessTest |
| * 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 class MojoFileSystemAccessTestCallbackRouter { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| MojoFileSystemAccessTestRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!MojoFileSystemAccessTestRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.resolveTransferToken = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1060122247, |
| MojoFileSystemAccessTest_ResolveTransferToken_ParamsSpec.$, |
| null, |
| this.resolveTransferToken.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. |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| } |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const MojoFileSystemAccessTest_ResolveTransferToken_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| MojoFileSystemAccessTest_ResolveTransferToken_ParamsSpec.$, |
| 'MojoFileSystemAccessTest_ResolveTransferToken_Params', |
| [ |
| mojo.internal.StructField( |
| 'h', 0, |
| 0, |
| mojo.internal.Handle, |
| null, |
| false /* nullable */, |
| 0), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| /** |
| * @record |
| */ |
| export class MojoFileSystemAccessTest_ResolveTransferToken_Params { |
| constructor() { |
| /** @type { !MojoHandle } */ |
| this.h; |
| } |
| } |
| |