| // components/mirroring/mojom/session_observer.mojom-lite.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'; |
| |
| |
| mojo.internal.exportModule('mirroring.mojom'); |
| |
| |
| |
| |
| |
| /** |
| * @const { {$: !mojo.internal.MojomType} } |
| * @export |
| */ |
| mirroring.mojom.SessionErrorSpec = { $: mojo.internal.Enum() }; |
| |
| /** |
| * @enum {number} |
| * @export |
| */ |
| mirroring.mojom.SessionError = { |
| |
| ANSWER_TIME_OUT: 0, |
| ANSWER_NOT_OK: 1, |
| ANSWER_MISMATCHED_CAST_MODE: 2, |
| ANSWER_MISMATCHED_SSRC_LENGTH: 3, |
| ANSWER_SELECT_MULTIPLE_AUDIO: 4, |
| ANSWER_SELECT_MULTIPLE_VIDEO: 5, |
| ANSWER_SELECT_INVALID_INDEX: 6, |
| ANSWER_NO_AUDIO_OR_VIDEO: 7, |
| AUDIO_CAPTURE_ERROR: 8, |
| VIDEO_CAPTURE_ERROR: 9, |
| RTP_STREAM_ERROR: 10, |
| ENCODING_ERROR: 11, |
| CAST_TRANSPORT_ERROR: 12, |
| OPENSCREEN_SESSION_ERROR: 13, |
| MIN_VALUE: 0, |
| MAX_VALUE: 13, |
| }; |
| |
| |
| |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| * @export |
| */ |
| mirroring.mojom.SessionObserverPendingReceiver = 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, |
| mirroring.mojom.SessionObserver.$interfaceName, |
| scope); |
| } |
| }; |
| |
| |
| |
| /** |
| * @export |
| * @implements { mirroring.mojom.SessionObserverInterface } |
| */ |
| mirroring.mojom.SessionObserverRemote = class { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!mirroring.mojom.SessionObserverPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| mirroring.mojom.SessionObserverPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!mirroring.mojom.SessionObserverPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @param { !mirroring.mojom.SessionError } error |
| */ |
| |
| onError( |
| error) { |
| this.proxy.sendMessage( |
| 0, |
| mirroring.mojom.SessionObserver_OnError_ParamsSpec.$, |
| null, |
| [ |
| error |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| didStart() { |
| this.proxy.sendMessage( |
| 1, |
| mirroring.mojom.SessionObserver_DidStart_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| didStop() { |
| this.proxy.sendMessage( |
| 2, |
| mirroring.mojom.SessionObserver_DidStop_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| * @param { !string } message |
| */ |
| |
| logInfoMessage( |
| message) { |
| this.proxy.sendMessage( |
| 3, |
| mirroring.mojom.SessionObserver_LogInfoMessage_ParamsSpec.$, |
| null, |
| [ |
| message |
| ]); |
| } |
| |
| |
| /** |
| * @param { !string } message |
| */ |
| |
| logErrorMessage( |
| message) { |
| this.proxy.sendMessage( |
| 4, |
| mirroring.mojom.SessionObserver_LogErrorMessage_ParamsSpec.$, |
| null, |
| [ |
| message |
| ]); |
| } |
| |
| |
| /** |
| */ |
| |
| onSourceChanged() { |
| this.proxy.sendMessage( |
| 5, |
| mirroring.mojom.SessionObserver_OnSourceChanged_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| * @param { !boolean } isRemoting |
| */ |
| |
| onRemotingStateChanged( |
| isRemoting) { |
| this.proxy.sendMessage( |
| 6, |
| mirroring.mojom.SessionObserver_OnRemotingStateChanged_ParamsSpec.$, |
| null, |
| [ |
| isRemoting |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the SessionObserver |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| mirroring.mojom.SessionObserverReceiver = class { |
| /** |
| * @param {!mirroring.mojom.SessionObserverInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!mirroring.mojom.SessionObserverRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| mirroring.mojom.SessionObserverRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!mirroring.mojom.SessionObserverRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| mirroring.mojom.SessionObserver_OnError_ParamsSpec.$, |
| null, |
| impl.onError.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 1, |
| mirroring.mojom.SessionObserver_DidStart_ParamsSpec.$, |
| null, |
| impl.didStart.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 2, |
| mirroring.mojom.SessionObserver_DidStop_ParamsSpec.$, |
| null, |
| impl.didStop.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 3, |
| mirroring.mojom.SessionObserver_LogInfoMessage_ParamsSpec.$, |
| null, |
| impl.logInfoMessage.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 4, |
| mirroring.mojom.SessionObserver_LogErrorMessage_ParamsSpec.$, |
| null, |
| impl.logErrorMessage.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 5, |
| mirroring.mojom.SessionObserver_OnSourceChanged_ParamsSpec.$, |
| null, |
| impl.onSourceChanged.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 6, |
| mirroring.mojom.SessionObserver_OnRemotingStateChanged_ParamsSpec.$, |
| null, |
| impl.onRemotingStateChanged.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| }; |
| |
| /** |
| * @export |
| */ |
| mirroring.mojom.SessionObserver = class { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "mirroring.mojom.SessionObserver"; |
| } |
| |
| /** |
| * 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 {!mirroring.mojom.SessionObserverRemote} |
| * @export |
| */ |
| static getRemote() { |
| let remote = new mirroring.mojom.SessionObserverRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| }; |
| |
| |
| /** |
| * An object which receives request messages for the SessionObserver |
| * 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 |
| */ |
| mirroring.mojom.SessionObserverCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| mirroring.mojom.SessionObserverRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!mirroring.mojom.SessionObserverRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.onError = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| mirroring.mojom.SessionObserver_OnError_ParamsSpec.$, |
| null, |
| this.onError.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.didStart = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1, |
| mirroring.mojom.SessionObserver_DidStart_ParamsSpec.$, |
| null, |
| this.didStart.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.didStop = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 2, |
| mirroring.mojom.SessionObserver_DidStop_ParamsSpec.$, |
| null, |
| this.didStop.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.logInfoMessage = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 3, |
| mirroring.mojom.SessionObserver_LogInfoMessage_ParamsSpec.$, |
| null, |
| this.logInfoMessage.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.logErrorMessage = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 4, |
| mirroring.mojom.SessionObserver_LogErrorMessage_ParamsSpec.$, |
| null, |
| this.logErrorMessage.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.onSourceChanged = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 5, |
| mirroring.mojom.SessionObserver_OnSourceChanged_ParamsSpec.$, |
| null, |
| this.onSourceChanged.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.onRemotingStateChanged = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 6, |
| mirroring.mojom.SessionObserver_OnRemotingStateChanged_ParamsSpec.$, |
| null, |
| this.onRemotingStateChanged.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); |
| } |
| }; |
| |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_OnError_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_DidStart_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_DidStop_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_LogInfoMessage_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_LogErrorMessage_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_OnSourceChanged_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| mirroring.mojom.SessionObserver_OnRemotingStateChanged_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_OnError_ParamsSpec.$, |
| 'SessionObserver_OnError_Params', |
| [ |
| mojo.internal.StructField( |
| 'error', 0, |
| 0, |
| mirroring.mojom.SessionErrorSpec.$, |
| 0, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_OnError_Params = class { |
| constructor() { |
| /** @export { !mirroring.mojom.SessionError } */ |
| this.error; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_DidStart_ParamsSpec.$, |
| 'SessionObserver_DidStart_Params', |
| [ |
| ], |
| [[0, 8],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_DidStart_Params = class { |
| constructor() { |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_DidStop_ParamsSpec.$, |
| 'SessionObserver_DidStop_Params', |
| [ |
| ], |
| [[0, 8],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_DidStop_Params = class { |
| constructor() { |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_LogInfoMessage_ParamsSpec.$, |
| 'SessionObserver_LogInfoMessage_Params', |
| [ |
| mojo.internal.StructField( |
| 'message', 0, |
| 0, |
| mojo.internal.String, |
| null, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_LogInfoMessage_Params = class { |
| constructor() { |
| /** @export { !string } */ |
| this.message; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_LogErrorMessage_ParamsSpec.$, |
| 'SessionObserver_LogErrorMessage_Params', |
| [ |
| mojo.internal.StructField( |
| 'message', 0, |
| 0, |
| mojo.internal.String, |
| null, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_LogErrorMessage_Params = class { |
| constructor() { |
| /** @export { !string } */ |
| this.message; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_OnSourceChanged_ParamsSpec.$, |
| 'SessionObserver_OnSourceChanged_Params', |
| [ |
| ], |
| [[0, 8],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_OnSourceChanged_Params = class { |
| constructor() { |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| mirroring.mojom.SessionObserver_OnRemotingStateChanged_ParamsSpec.$, |
| 'SessionObserver_OnRemotingStateChanged_Params', |
| [ |
| mojo.internal.StructField( |
| 'isRemoting', 0, |
| 0, |
| mojo.internal.Bool, |
| false, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| mirroring.mojom.SessionObserver_OnRemotingStateChanged_Params = class { |
| constructor() { |
| /** @export { !boolean } */ |
| this.isRemoting; |
| } |
| }; |
| |