| // 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('media.mojom.OutputProtection'); |
| goog.provide('media.mojom.OutputProtectionCallbackRouter'); |
| goog.provide('media.mojom.OutputProtectionInterface'); |
| goog.provide('media.mojom.OutputProtectionProxy'); |
| goog.provide('media.mojom.OutputProtectionRequest'); |
| |
| |
| /** @export */ |
| media.mojom.OutputProtectionRequest = class { |
| /** @param {!MojoHandle} handle */ |
| constructor(handle) { |
| /** @public {!MojoHandle} */ |
| this.handle = handle; |
| } |
| }; |
| |
| /** @interface */ |
| media.mojom.OutputProtectionInterface = class { |
| |
| /** |
| * @return {Promise<{ |
| success: !boolean, |
| linkMask: !number, |
| protectionMask: !number, |
| * }>} |
| */ |
| |
| queryStatus() {} |
| |
| /** |
| * @param { !number } desiredProtectionMask |
| * @return {Promise<{ |
| success: !boolean, |
| * }>} |
| */ |
| |
| enableProtection(desiredProtectionMask) {} |
| }; |
| |
| /** |
| * @export |
| * @implements { media.mojom.OutputProtectionInterface } |
| */ |
| media.mojom.OutputProtectionProxy = class { |
| /** @param {MojoHandle=} opt_handle */ |
| constructor(opt_handle) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!media.mojom.OutputProtectionRequest>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| media.mojom.OutputProtectionRequest, |
| opt_handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!media.mojom.OutputProtectionRequest>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @return {Promise<{ |
| success: !boolean, |
| linkMask: !number, |
| protectionMask: !number, |
| * }>} |
| */ |
| |
| queryStatus() { |
| return this.proxy.sendMessage( |
| 173054161, |
| media.mojom.OutputProtection_QueryStatus_ParamsSpec.$, |
| media.mojom.OutputProtection_QueryStatus_ResponseParamsSpec.$, |
| [ |
| ]); |
| } |
| |
| |
| /** |
| * @param { !number } desiredProtectionMask |
| * @return {Promise<{ |
| success: !boolean, |
| * }>} |
| */ |
| |
| enableProtection( |
| desiredProtectionMask) { |
| return this.proxy.sendMessage( |
| 1326540670, |
| media.mojom.OutputProtection_EnableProtection_ParamsSpec.$, |
| media.mojom.OutputProtection_EnableProtection_ResponseParamsSpec.$, |
| [ |
| desiredProtectionMask |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the OutputProtection |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| media.mojom.OutputProtection = class { |
| /** |
| * @param {!media.mojom.OutputProtectionInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!media.mojom.OutputProtectionProxy>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| media.mojom.OutputProtectionProxy); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!media.mojom.OutputProtectionProxy>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 173054161, |
| media.mojom.OutputProtection_QueryStatus_ParamsSpec.$, |
| media.mojom.OutputProtection_QueryStatus_ResponseParamsSpec.$, |
| impl.queryStatus.bind(impl)); |
| this.helper_internal_.registerHandler( |
| 1326540670, |
| media.mojom.OutputProtection_EnableProtection_ParamsSpec.$, |
| media.mojom.OutputProtection_EnableProtection_ResponseParamsSpec.$, |
| impl.enableProtection.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 {!media.mojom.OutputProtectionProxy} |
| * @export |
| */ |
| static getProxy() { |
| let proxy = new media.mojom.OutputProtectionProxy; |
| Mojo.bindInterface('media.mojom.OutputProtection', |
| proxy.$.bindNewPipeAndPassReceiver().handle); |
| return proxy; |
| } |
| |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "media.mojom.OutputProtection"; |
| } |
| |
| }; |
| |
| goog.provide('media.mojom.OutputProtection_ProtectionType'); |
| goog.provide('media.mojom.OutputProtection.ProtectionTypeSpec'); |
| /** |
| * @const { {$: !mojo.internal.MojomType} } |
| * @export |
| */ |
| media.mojom.OutputProtection.ProtectionTypeSpec = { $: mojo.internal.Enum() }; |
| |
| /** |
| * @enum {number} |
| * @export |
| */ |
| media.mojom.OutputProtection_ProtectionType = { |
| |
| NONE: 0, |
| HDCP: 0, |
| MIN_VALUE: 0, |
| MAX_VALUE: 1, |
| }; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_ProtectionType.NONE = 0; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_ProtectionType.HDCP = 1; |
| goog.provide('media.mojom.OutputProtection_LinkType'); |
| goog.provide('media.mojom.OutputProtection.LinkTypeSpec'); |
| /** |
| * @const { {$: !mojo.internal.MojomType} } |
| * @export |
| */ |
| media.mojom.OutputProtection.LinkTypeSpec = { $: mojo.internal.Enum() }; |
| |
| /** |
| * @enum {number} |
| * @export |
| */ |
| media.mojom.OutputProtection_LinkType = { |
| |
| NONE: 0, |
| UNKNOWN: 0, |
| INTERNAL: 0, |
| VGA: 0, |
| HDMI: 0, |
| DVI: 0, |
| DISPLAYPORT: 0, |
| NETWORK: 0, |
| MIN_VALUE: 0, |
| MAX_VALUE: 64, |
| }; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.NONE = 0; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.UNKNOWN = 1; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.INTERNAL = 2; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.VGA = 4; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.HDMI = 8; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.DVI = 16; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.DISPLAYPORT = 32; |
| |
| /** @suppress {checkTypes} */ |
| media.mojom.OutputProtection_LinkType.NETWORK = 64; |
| |
| |
| |
| /** |
| * An object which receives request messages for the OutputProtection |
| * 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 |
| */ |
| media.mojom.OutputProtectionCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| media.mojom.OutputProtectionProxy); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!media.mojom.OutputProtectionProxy>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.queryStatus = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 173054161, |
| media.mojom.OutputProtection_QueryStatus_ParamsSpec.$, |
| media.mojom.OutputProtection_QueryStatus_ResponseParamsSpec.$, |
| this.queryStatus.createReceiverHandler(true /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.enableProtection = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 1326540670, |
| media.mojom.OutputProtection_EnableProtection_ParamsSpec.$, |
| media.mojom.OutputProtection_EnableProtection_ResponseParamsSpec.$, |
| this.enableProtection.createReceiverHandler(true /* 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('media.mojom.OutputProtection_QueryStatus_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| media.mojom.OutputProtection_QueryStatus_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('media.mojom.OutputProtection_QueryStatus_ResponseParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| media.mojom.OutputProtection_QueryStatus_ResponseParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('media.mojom.OutputProtection_EnableProtection_ParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| media.mojom.OutputProtection_EnableProtection_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| goog.provide('media.mojom.OutputProtection_EnableProtection_ResponseParamsSpec'); |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| media.mojom.OutputProtection_EnableProtection_ResponseParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| media.mojom.OutputProtection_QueryStatus_ParamsSpec.$, |
| 'OutputProtection_QueryStatus_Params', |
| 0, |
| [ |
| ]); |
| |
| goog.provide('media.mojom.OutputProtection_QueryStatus_Params'); |
| |
| |
| /** @typedef {Object} */ |
| |
| media.mojom.OutputProtection_QueryStatus_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| media.mojom.OutputProtection_QueryStatus_ResponseParamsSpec.$, |
| 'OutputProtection_QueryStatus_ResponseParams', |
| 16, |
| [ |
| mojo.internal.StructField( |
| 'success', 0, |
| 0, |
| mojo.internal.Bool, |
| false, |
| false /* nullable */), |
| mojo.internal.StructField( |
| 'linkMask', 4, |
| 0, |
| mojo.internal.Uint32, |
| 0, |
| false /* nullable */), |
| mojo.internal.StructField( |
| 'protectionMask', 8, |
| 0, |
| mojo.internal.Uint32, |
| 0, |
| false /* nullable */), |
| ]); |
| |
| goog.provide('media.mojom.OutputProtection_QueryStatus_ResponseParams'); |
| |
| |
| /** |
| * @typedef { { |
| * success: !boolean, |
| * linkMask: !number, |
| * protectionMask: !number, |
| * } } |
| */ |
| |
| media.mojom.OutputProtection_QueryStatus_ResponseParams; |
| |
| |
| |
| mojo.internal.Struct( |
| media.mojom.OutputProtection_EnableProtection_ParamsSpec.$, |
| 'OutputProtection_EnableProtection_Params', |
| 8, |
| [ |
| mojo.internal.StructField( |
| 'desiredProtectionMask', 0, |
| 0, |
| mojo.internal.Uint32, |
| 0, |
| false /* nullable */), |
| ]); |
| |
| goog.provide('media.mojom.OutputProtection_EnableProtection_Params'); |
| |
| |
| /** |
| * @typedef { { |
| * desiredProtectionMask: !number, |
| * } } |
| */ |
| |
| media.mojom.OutputProtection_EnableProtection_Params; |
| |
| |
| |
| mojo.internal.Struct( |
| media.mojom.OutputProtection_EnableProtection_ResponseParamsSpec.$, |
| 'OutputProtection_EnableProtection_ResponseParams', |
| 8, |
| [ |
| mojo.internal.StructField( |
| 'success', 0, |
| 0, |
| mojo.internal.Bool, |
| false, |
| false /* nullable */), |
| ]); |
| |
| goog.provide('media.mojom.OutputProtection_EnableProtection_ResponseParams'); |
| |
| |
| /** |
| * @typedef { { |
| * success: !boolean, |
| * } } |
| */ |
| |
| media.mojom.OutputProtection_EnableProtection_ResponseParams; |
| |