}% & n  f e Er+ %j&0<2u=2>2%?2X@22cA2sB2|C2 D2tE2VF2\G2$bH2dI2hJ2lK2JuL2 yM2/N2ڧO2<P2SQ2R25S2T2U2V2W2X2Y2`Z2#[2z'\2`,]2;^2(?_2H`2hPa2\Xb2[c2Ebd2eu2huv2w2Ͼx2my2$z2{2|2 }2~2I2h22s0Ca1C2C3Cy4C 5C6C 7Cb 8C; 9C :C BC CC# GC) HC} JC! KCV# LC# MCO- _~/ _@ _M _HN bN bO bQ bT bW b2Y bZ c^ cc cc che cf cg cRh dh d d d; i* i/ ie ib i i i7& i' i. iA4 i9 !i@ "iOB #iF %iJ 'iM )iQ *i\ 0iK` 1ia 2ij 3is 4iyt 5iu 6iw 7iz :i{ ;i} iӃ ?is @i Bi Di Fi Gi Li Nij Oi Pi Qi0 Ri SiӦ TiR Uiͧ ViX Wi. Xi YiҪ Zi [i \i( ]iѭ ^i _i{ `iP ai% bi ciϲ di ei iil ji, ki li mi niq oi siT ti ui vi wi xiL yi zi {i4 |i }i ~i iB i  i i iT i  i i iU i  i@ i6 i- i< :k$ ;kp kl ?k  @k Ak Bk Ck Dk Ek Fk Gku Hk Ik Jk  Kk Lk Mky Nk. Ok Pk{ QkI! Rk7" Sk" Tk# Uk$ Vkd% Wk& Xk& Yk' ZkZ( [k=) \kU* ]k* ^k+ _k, `k. ak:/ bk/0 ck0 dk1 ekG2 fk2 gk,4 hk4 ikS5 jk5 kk5 lke6 mk6 nk87 ok7 qk7 rk.8 skr8 tk8 uk9 vkN9 wk9 xk9 zk#: {k: |k; }k; ~k; k9< k< k< ko= k= k-> k> k> k2? k? k? kL@ k@ kA k`A kA k@B kB kLC kC kD kdD kD kE kE kLF kF kIENDB`PNG  IHDR:=,IDATcπ |B;p:RL?˟~Fq# n>MIENDB`PNG  IHDRVIDATx^e r'vqb*܋`B Q/iA1ς& W$ E17f-A/X;\o$IENDB`PNG  IHDRIDATxc P6SNIENDB`PNG  IHDRZIDATx^]A 1IJ#=~B_=t"l,x !̤OGAH7iA@"@ EzO[ {ek"t ?nj;TcyIENDB`PNG  IHDR:=3IDATco9{—(V>L٢9u{.tiIENDB`PNG  IHDRѝIDATxc?!?|^:IENDB`PNG  IHDR:=5IDATc=s#Q}b20ıE}3ɰoe ݍA5IENDB`PNG  IHDR:=3IDATc``_) 㙴SC-!w8[#R f j j:C lIENDB`PNG  IHDRѝIDATxc/P`^[rIENDB`PNG  IHDR:=3IDATc/_ L~Ϥ0012ĩb`PBsP uIENDB`PNG  IHDR7IDATxc/hp' # d2dD!CBQ&BjP܀! ; OtmIENDB`PNG  IHDRIDATxc`Pgb``b`a gTrIENDB`PNG  IHDR5IDATcbPB=2L d3 X 2PAZ&n`}8G1IENDB`PNG  IHDR:=3IDATc`ɠCp`d``5 .J,IENDB`PNG  IHDRѝIDATxc`g`0f`d~~IENDB`PNG  IHDR:=3IDATc`B N f Q

$i18n{message}

$i18n{message}

$i18n{fileName}

$i18n{message}

// Copyright (c) 2012 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. // Custom binding for the app API. var appNatives = requireNative('app'); var process = requireNative('process'); var extensionId = process.GetExtensionId(); var logActivity = requireNative('activityLogger'); function wrapForLogging(fun) { if (!extensionId) return fun; // nothing interesting to log without an extension return function() { // TODO(ataly): We need to make sure we use the right prototype for // fun.apply. Array slice can either be rewritten or similarly defined. logActivity.LogAPICall(extensionId, "app." + fun.name, $Array.slice(arguments)); return $Function.apply(fun, this, arguments); }; } // This becomes chrome.app var app = { getIsInstalled: wrapForLogging(appNatives.GetIsInstalled), getDetails: wrapForLogging(appNatives.GetDetails), runningState: wrapForLogging(appNatives.GetRunningState) }; // Tricky; "getIsInstalled" is actually exposed as the getter "isInstalled", // but we don't have a way to express this in the schema JSON (nor is it // worth it for this one special case). // // So, define it manually, and let the getIsInstalled function act as its // documentation. var isInstalled = wrapForLogging(appNatives.GetIsInstalled); $Object.defineProperty( app, 'isInstalled', { __proto__: null, configurable: true, enumerable: true, get: function() { return isInstalled(); }, }); // Called by app_bindings.cc. function onInstallStateResponse(state, callbackId) { var callback = callbacks[callbackId]; delete callbacks[callbackId]; if (typeof callback == 'function') { try { callback(state); } catch (e) { console.error('Exception in chrome.app.installState response handler: ' + e.stack); } } } // TODO(kalman): move this stuff to its own custom bindings. var callbacks = { __proto__: null }; var nextCallbackId = 1; function getInstallState(callback) { var callbackId = nextCallbackId++; callbacks[callbackId] = callback; appNatives.GetInstallState(callbackId); } $Object.defineProperty( app, 'installState', { __proto__: null, configurable: true, enumerable: true, value: wrapForLogging(getInstallState), writable: true, }); exports.$set('binding', app); exports.$set('onInstallStateResponse', onInstallStateResponse); // Copyright 2014 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. // Custom bindings for the automation API. var AutomationNode = require('automationNode').AutomationNode; var AutomationRootNode = require('automationNode').AutomationRootNode; var automation = apiBridge || require('binding').Binding.create('automation'); var automationInternal = getInternalApi ? getInternalApi('automationInternal') : require('binding').Binding.create('automationInternal').generate(); var exceptionHandler = require('uncaught_exception_handler'); var logging = requireNative('logging'); var nativeAutomationInternal = requireNative('automationInternal'); var DestroyAccessibilityTree = nativeAutomationInternal.DestroyAccessibilityTree; var GetIntAttribute = nativeAutomationInternal.GetIntAttribute; var StartCachingAccessibilityTrees = nativeAutomationInternal.StartCachingAccessibilityTrees; var AddTreeChangeObserver = nativeAutomationInternal.AddTreeChangeObserver; var RemoveTreeChangeObserver = nativeAutomationInternal.RemoveTreeChangeObserver; var GetFocusNative = nativeAutomationInternal.GetFocus; var jsLastError = bindingUtil ? undefined : require('lastError'); function hasLastError() { return bindingUtil ? bindingUtil.hasLastError() : jsLastError.hasError(chrome); } /** * A namespace to export utility functions to other files in automation. */ window.automationUtil = function() {}; // TODO(aboxhall): Look into using WeakMap var idToCallback = {}; var DESKTOP_TREE_ID = 0; automationUtil.storeTreeCallback = function(id, callback) { if (!callback) return; var targetTree = AutomationRootNode.get(id); if (!targetTree) { // If we haven't cached the tree, hold the callback until the tree is // populated by the initial onAccessibilityEvent call. if (id in idToCallback) idToCallback[id].push(callback); else idToCallback[id] = [callback]; } else { callback(targetTree); } }; /** * Global list of tree change observers. * @type {Object} */ automationUtil.treeChangeObserverMap = {}; /** * The id of the next tree change observer. * @type {number} */ automationUtil.nextTreeChangeObserverId = 1; /** * @type {AutomationNode} The current focused node. This is only updated * when calling automationUtil.updateFocusedNode. */ automationUtil.focusedNode = null; /** * Gets the currently focused AutomationNode. * @return {AutomationNode} */ automationUtil.getFocus = function() { var focusedNodeInfo = GetFocusNative(DESKTOP_TREE_ID); if (!focusedNodeInfo) return null; var tree = AutomationRootNode.getOrCreate(focusedNodeInfo.treeId); if (tree) return privates(tree).impl.get(focusedNodeInfo.nodeId); }; /** * Update automationUtil.focusedNode to be the node that currently has focus. */ automationUtil.updateFocusedNode = function() { automationUtil.focusedNode = automationUtil.getFocus(); }; /** * Updates the focus on blur. */ automationUtil.updateFocusedNodeOnBlur = function() { var focus = automationUtil.getFocus(); automationUtil.focusedNode = focus ? focus.root : null; }; automation.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; // TODO(aboxhall, dtseng): Make this return the speced AutomationRootNode obj. apiFunctions.setHandleRequest('getTree', function getTree(tabID, callback) { StartCachingAccessibilityTrees(); // enableTab() ensures the renderer for the active or specified tab has // accessibility enabled, and fetches its ax tree id to use as // a key in the idToAutomationRootNode map. The callback to // enableTab is bound to the callback passed in to getTree(), so that once // the tree is available (either due to having been cached earlier, or after // an accessibility event occurs which causes the tree to be populated), the // callback can be called. var params = { tabID: tabID }; automationInternal.enableTab(params, function onEnable(id) { if (hasLastError()) { callback(); return; } automationUtil.storeTreeCallback(id, callback); }); }); var desktopTree = null; apiFunctions.setHandleRequest('getDesktop', function(callback) { StartCachingAccessibilityTrees(); desktopTree = AutomationRootNode.get(DESKTOP_TREE_ID); if (!desktopTree) { if (DESKTOP_TREE_ID in idToCallback) idToCallback[DESKTOP_TREE_ID].push(callback); else idToCallback[DESKTOP_TREE_ID] = [callback]; // TODO(dtseng): Disable desktop tree once desktop object goes out of // scope. automationInternal.enableDesktop(function() { if (hasLastError()) { AutomationRootNode.destroy(DESKTOP_TREE_ID); callback(); return; } }); } else { callback(desktopTree); } }); apiFunctions.setHandleRequest('getFocus', function(callback) { callback(automationUtil.getFocus()); }); function removeTreeChangeObserver(observer) { for (var id in automationUtil.treeChangeObserverMap) { if (automationUtil.treeChangeObserverMap[id] == observer) { RemoveTreeChangeObserver(id); delete automationUtil.treeChangeObserverMap[id]; return; } } } apiFunctions.setHandleRequest('removeTreeChangeObserver', function(observer) { removeTreeChangeObserver(observer); }); function addTreeChangeObserver(filter, observer) { removeTreeChangeObserver(observer); var id = automationUtil.nextTreeChangeObserverId++; AddTreeChangeObserver(id, filter); automationUtil.treeChangeObserverMap[id] = observer; } apiFunctions.setHandleRequest('addTreeChangeObserver', function(filter, observer) { addTreeChangeObserver(filter, observer); }); apiFunctions.setHandleRequest('setDocumentSelection', function(params) { var anchorNodeImpl = privates(params.anchorObject).impl; var focusNodeImpl = privates(params.focusObject).impl; if (anchorNodeImpl.treeID !== focusNodeImpl.treeID) throw new Error('Selection anchor and focus must be in the same tree.'); if (anchorNodeImpl.treeID === DESKTOP_TREE_ID) { throw new Error('Use AutomationNode.setSelection to set the selection ' + 'in the desktop tree.'); } automationInternal.performAction({ treeID: anchorNodeImpl.treeID, automationNodeID: anchorNodeImpl.id, actionType: 'setSelection'}, { focusNodeID: focusNodeImpl.id, anchorOffset: params.anchorOffset, focusOffset: params.focusOffset }); }); }); automationInternal.onChildTreeID.addListener(function(treeID, nodeID) { var tree = AutomationRootNode.getOrCreate(treeID); if (!tree) return; var node = privates(tree).impl.get(nodeID); if (!node) return; // A WebView in the desktop tree has a different AX tree as its child. // When we encounter a WebView with a child AX tree id that we don't // currently have cached, explicitly request that AX tree from the // browser process and set up a callback when it loads to attach that // tree as a child of this node and fire appropriate events. var childTreeID = GetIntAttribute(treeID, nodeID, 'childTreeId'); if (!childTreeID) return; var subroot = AutomationRootNode.get(childTreeID); if (!subroot || subroot.role == 'unknown') { automationUtil.storeTreeCallback(childTreeID, function(root) { // Return early if the root has already been attached. if (root.parent) return; privates(root).impl.setHostNode(node); if (root.docLoaded) { privates(root).impl.dispatchEvent('loadComplete', 'page'); } privates(node).impl.dispatchEvent('childrenChanged', 'none'); }); automationInternal.enableFrame(childTreeID); } else { privates(subroot).impl.setHostNode(node); } }); automationInternal.onTreeChange.addListener(function(observerID, treeID, nodeID, changeType) { var tree = AutomationRootNode.getOrCreate(treeID); if (!tree) return; var node = privates(tree).impl.get(nodeID); if (!node) return; var observer = automationUtil.treeChangeObserverMap[observerID]; if (!observer) return; try { observer({target: node, type: changeType}); } catch (e) { exceptionHandler.handle('Error in tree change observer for ' + treeChange.type, e); } }); automationInternal.onNodesRemoved.addListener(function(treeID, nodeIDs) { var tree = AutomationRootNode.getOrCreate(treeID); if (!tree) return; for (var i = 0; i < nodeIDs.length; i++) { privates(tree).impl.remove(nodeIDs[i]); } }); /** * Dispatch accessibility events fired on individual nodes to its * corresponding AutomationNode. Handle focus events specially * (see below). */ automationInternal.onAccessibilityEvent.addListener(function(eventParams) { var id = eventParams.treeID; var targetTree = AutomationRootNode.getOrCreate(id); if (eventParams.eventType == 'blur') { // Work around an issue where Chrome sends us 'blur' events on the // root node when nothing has focus, we need to treat those as focus // events but otherwise not handle blur events specially. var node = privates(targetTree).impl.get(eventParams.targetID); if (node == node.root) automationUtil.updateFocusedNodeOnBlur(); } else if (eventParams.eventType == 'mediaStartedPlaying' || eventParams.eventType == 'mediaStoppedPlaying') { // These events are global to the tree. eventParams.targetID = privates(targetTree).impl.id; } else { var previousFocusedNode = automationUtil.focusedNode; automationUtil.updateFocusedNode(); // Fire focus events if necessary. if (automationUtil.focusedNode && automationUtil.focusedNode != previousFocusedNode) { var eventParamsCopy = {}; for (var key in eventParams) eventParamsCopy[key] = eventParams[key]; eventParamsCopy['eventType'] = 'focus'; eventParamsCopy['treeID'] = privates(automationUtil.focusedNode.root).impl.treeID; eventParamsCopy['targetID'] = privates(automationUtil.focusedNode).impl.id; privates(automationUtil.focusedNode.root) .impl.onAccessibilityEvent(eventParamsCopy); } } // Note that focus type events have already been handled above if there was a // focused node. All other events, even non-focus events that triggered a // focus dispatch, still need to have their original event fired. if ((!automationUtil.focusedNode || eventParams.eventType != 'focus') && !privates(targetTree).impl.onAccessibilityEvent(eventParams)) return; // If we're not waiting on a callback to getTree(), we can early out here. if (!(id in idToCallback)) return; // We usually get a 'placeholder' tree first, which doesn't have any url // attribute or child nodes. If we've got that, wait for the full tree before // calling the callback. // TODO(dmazzoni): Don't send down placeholder (crbug.com/397553) if (id != DESKTOP_TREE_ID && !targetTree.url && targetTree.children.length == 0) return; // If the tree wasn't available when getTree() was called, the callback will // have been cached in idToCallback, so call and delete it now that we // have the complete tree. for (var i = 0; i < idToCallback[id].length; i++) { var callback = idToCallback[id][i]; callback(targetTree); } delete idToCallback[id]; }); automationInternal.onAccessibilityTreeDestroyed.addListener(function(id) { // Destroy the AutomationRootNode. var targetTree = AutomationRootNode.get(id); if (targetTree) { privates(targetTree).impl.destroy(); AutomationRootNode.destroy(id); } else { logging.WARNING('no targetTree to destroy'); } // Destroy the native cache of the accessibility tree. DestroyAccessibilityTree(id); }); automationInternal.onAccessibilityTreeSerializationError.addListener( function(id) { automationInternal.enableFrame(id); }); automationInternal.onActionResult.addListener( function(treeID, requestID, result) { var targetTree = AutomationRootNode.get(treeID); if (!targetTree) return; privates(targetTree).impl.onActionResult(requestID, result); }); if (!apiBridge) exports.$set('binding', automation.generate()); // Copyright 2014 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. var utils = require('utils'); function AutomationEventImpl(type, target, eventFrom) { this.propagationStopped = false; this.type = type; this.target = target; this.eventPhase = Event.NONE; this.eventFrom = eventFrom; } AutomationEventImpl.prototype = { __proto__: null, stopPropagation: function() { this.propagationStopped = true; }, }; function AutomationEvent() { privates(AutomationEvent).constructPrivate(this, arguments); } utils.expose(AutomationEvent, AutomationEventImpl, { functions: [ 'stopPropagation', ], readonly: [ 'type', 'target', 'eventPhase', 'eventFrom', ], }); exports.$set('AutomationEvent', AutomationEvent); // Copyright 2014 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. var AutomationEvent = require('automationEvent').AutomationEvent; var automationInternal = getInternalApi ? getInternalApi('automationInternal') : require('binding').Binding.create('automationInternal').generate(); var exceptionHandler = require('uncaught_exception_handler'); var natives = requireNative('automationInternal'); var IsInteractPermitted = natives.IsInteractPermitted; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?number} The id of the root node. */ var GetRootID = natives.GetRootID; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?string} The title of the document. */ var GetDocTitle = natives.GetDocTitle; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?string} The url of the document. */ var GetDocURL = natives.GetDocURL; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?boolean} True if the document has finished loading. */ var GetDocLoaded = natives.GetDocLoaded; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?number} The loading progress, from 0.0 to 1.0 (fully loaded). */ var GetDocLoadingProgress = natives.GetDocLoadingProgress; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?number} The ID of the selection anchor object. */ var GetAnchorObjectID = natives.GetAnchorObjectID; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?number} The selection anchor offset. */ var GetAnchorOffset = natives.GetAnchorOffset; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?string} The selection anchor affinity. */ var GetAnchorAffinity = natives.GetAnchorAffinity; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?number} The ID of the selection focus object. */ var GetFocusObjectID = natives.GetFocusObjectID; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?number} The selection focus offset. */ var GetFocusOffset = natives.GetFocusOffset; /** * @param {number} axTreeID The id of the accessibility tree. * @return {?string} The selection focus affinity. */ var GetFocusAffinity = natives.GetFocusAffinity; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?number} The id of the node's parent, or undefined if it's the * root of its tree or if the tree or node wasn't found. */ var GetParentID = natives.GetParentID; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?number} The number of children of the node, or undefined if * the tree or node wasn't found. */ var GetChildCount = natives.GetChildCount; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {number} childIndex An index of a child of this node. * @return {?number} The id of the child at the given index, or undefined * if the tree or node or child at that index wasn't found. */ var GetChildIDAtIndex = natives.GetChildIDAtIndex; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?number} The ids of the children of the node, or undefined * if the tree or node wasn't found. */ var GetChildIds = natives.GetChildIDs; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?Object} An object mapping html attributes to values. */ var GetHtmlAttributes = natives.GetHtmlAttributes; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?number} The index of this node in its parent, or undefined if * the tree or node or node parent wasn't found. */ var GetIndexInParent = natives.GetIndexInParent; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?Object} An object with a string key for every state flag set, * or undefined if the tree or node or node parent wasn't found. */ var GetState = natives.GetState; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {string} The restriction, one of * "disabled", "readOnly" or undefined if enabled or other object not disabled */ var GetRestriction = natives.GetRestriction; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {string} The checked state, as undefined, "true", "false" or "mixed". */ var GetChecked = natives.GetChecked; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {string} The role of the node, or undefined if the tree or * node wasn't found. */ var GetRole = natives.GetRole; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?automation.Rect} The location of the node, or undefined if * the tree or node wasn't found. */ var GetLocation = natives.GetLocation; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {number} startIndex The start index of the range. * @param {number} endIndex The end index of the range. * @return {?automation.Rect} The bounding box of the subrange of this node, * or the location if there are no subranges, or undefined if * the tree or node wasn't found. */ var GetBoundsForRange = natives.GetBoundsForRange; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?automation.Rect} The unclipped location of the node, or * undefined if the tree or node wasn't found. */ var GetUnclippedLocation = natives.GetUnclippedLocation; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {!Array} The text offset where each line starts, or an empty * array if this node has no text content, or undefined if the tree or node * was not found. */ var GetLineStartOffsets = requireNative( 'automationInternal').GetLineStartOffsets; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of a string attribute. * @return {?string} The value of this attribute, or undefined if the tree, * node, or attribute wasn't found. */ var GetStringAttribute = natives.GetStringAttribute; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an attribute. * @return {?boolean} The value of this attribute, or undefined if the tree, * node, or attribute wasn't found. */ var GetBoolAttribute = natives.GetBoolAttribute; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an attribute. * @return {?number} The value of this attribute, or undefined if the tree, * node, or attribute wasn't found. */ var GetIntAttribute = natives.GetIntAttribute; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an attribute. * @return {?Array} The ids of nodes who have a relationship pointing * to |nodeID| (a reverse relationship). */ var GetIntAttributeReverseRelations = natives.GetIntAttributeReverseRelations; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an attribute. * @return {?number} The value of this attribute, or undefined if the tree, * node, or attribute wasn't found. */ var GetFloatAttribute = natives.GetFloatAttribute; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an attribute. * @return {?Array} The value of this attribute, or undefined * if the tree, node, or attribute wasn't found. */ var GetIntListAttribute = natives.GetIntListAttribute; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an attribute. * @return {?Array} The ids of nodes who have a relationship pointing * to |nodeID| (a reverse relationship). */ var GetIntListAttributeReverseRelations = natives.GetIntListAttributeReverseRelations; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @param {string} attr The name of an HTML attribute. * @return {?string} The value of this attribute, or undefined if the tree, * node, or attribute wasn't found. */ var GetHtmlAttribute = natives.GetHtmlAttribute; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {automation.NameFromType} The source of the node's name. */ var GetNameFrom = natives.GetNameFrom; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {boolean} */ var GetBold = natives.GetBold; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {boolean} */ var GetItalic = natives.GetItalic; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {boolean} */ var GetUnderline = natives.GetUnderline; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {boolean} */ var GetLineThrough = natives.GetLineThrough; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?Array} List of custom actions of the * node. */ var GetCustomActions = natives.GetCustomActions; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {?Array} List of standard actions of the node. */ var GetStandardActions = natives.GetStandardActions; /** * @param {number} axTreeID The id of the accessibility tree. * @param {number} nodeID The id of a node. * @return {automation.NameFromType} The source of the node's name. */ var GetDefaultActionVerb = natives.GetDefaultActionVerb; var logging = requireNative('logging'); var utils = require('utils'); /** * A single node in the Automation tree. * @param {AutomationRootNodeImpl} root The root of the tree. * @constructor */ function AutomationNodeImpl(root) { this.rootImpl = root; this.hostNode_ = null; this.listeners = {__proto__: null}; } AutomationNodeImpl.prototype = { __proto__: null, treeID: -1, id: -1, isRootNode: false, detach: function() { this.rootImpl = null; this.hostNode_ = null; this.listeners = {__proto__: null}; }, get root() { return this.rootImpl && this.rootImpl.wrapper; }, get parent() { if (!this.rootImpl) return undefined; if (this.hostNode_) return this.hostNode_; var parentID = GetParentID(this.treeID, this.id); return this.rootImpl.get(parentID); }, get htmlAttributes() { return GetHtmlAttributes(this.treeID, this.id) || {}; }, get state() { return GetState(this.treeID, this.id) || {}; }, get role() { return GetRole(this.treeID, this.id); }, get restriction() { return GetRestriction(this.treeID, this.id); }, get checked() { return GetChecked(this.treeID, this.id); }, get location() { return GetLocation(this.treeID, this.id); }, boundsForRange: function(startIndex, endIndex) { return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex); }, get unclippedLocation() { var result = GetUnclippedLocation(this.treeID, this.id); if (result === undefined) result = GetLocation(this.treeID, this.id); return result; }, get indexInParent() { return GetIndexInParent(this.treeID, this.id); }, get lineStartOffsets() { return GetLineStartOffsets(this.treeID, this.id); }, get childTree() { var childTreeID = GetIntAttribute(this.treeID, this.id, 'childTreeId'); if (childTreeID) return AutomationRootNodeImpl.get(childTreeID); }, get firstChild() { if (!this.rootImpl) return undefined; if (this.childTree) return this.childTree; if (!GetChildCount(this.treeID, this.id)) return undefined; var firstChildID = GetChildIDAtIndex(this.treeID, this.id, 0); return this.rootImpl.get(firstChildID); }, get lastChild() { if (!this.rootImpl) return undefined; if (this.childTree) return this.childTree; var count = GetChildCount(this.treeID, this.id); if (!count) return undefined; var lastChildID = GetChildIDAtIndex(this.treeID, this.id, count - 1); return this.rootImpl.get(lastChildID); }, get children() { if (!this.rootImpl) return []; if (this.childTree) return [this.childTree]; var children = []; var childIds = GetChildIds(this.treeID, this.id); for (var i = 0; i < childIds.length; ++i) { var childID = childIds[i]; var child = this.rootImpl.get(childID); $Array.push(children, child); } return children; }, get previousSibling() { var parent = this.parent; if (!parent) return undefined; parent = privates(parent).impl; var indexInParent = GetIndexInParent(this.treeID, this.id); return this.rootImpl.get( GetChildIDAtIndex(parent.treeID, parent.id, indexInParent - 1)); }, get nextSibling() { var parent = this.parent; if (!parent) return undefined; parent = privates(parent).impl; var indexInParent = GetIndexInParent(this.treeID, this.id); return this.rootImpl.get( GetChildIDAtIndex(parent.treeID, parent.id, indexInParent + 1)); }, get nameFrom() { return GetNameFrom(this.treeID, this.id); }, get bold() { return GetBold(this.treeID, this.id); }, get italic() { return GetItalic(this.treeID, this.id); }, get underline() { return GetUnderline(this.treeID, this.id); }, get lineThrough() { return GetLineThrough(this.treeID, this.id); }, get customActions() { return GetCustomActions(this.treeID, this.id); }, get standardActions() { return GetStandardActions(this.treeID, this.id); }, get defaultActionVerb() { return GetDefaultActionVerb(this.treeID, this.id); }, doDefault: function() { this.performAction_('doDefault'); }, focus: function() { this.performAction_('focus'); }, getImageData: function(maxWidth, maxHeight) { this.performAction_('getImageData', { maxWidth: maxWidth, maxHeight: maxHeight }); }, hitTest: function(x, y, eventToFire) { this.hitTestInternal(x, y, eventToFire); }, hitTestWithReply: function(x, y, opt_callback) { this.hitTestInternal(x, y, 'hitTestResult', opt_callback); }, hitTestInternal: function(x, y, eventToFire, opt_callback) { // Convert from global to tree-relative coordinates. var location = GetLocation(this.treeID, GetRootID(this.treeID)); this.performAction_('hitTest', { x: Math.floor(x - location.left), y: Math.floor(y - location.top), eventToFire: eventToFire }, opt_callback); }, makeVisible: function() { this.performAction_('scrollToMakeVisible'); }, performCustomAction: function(customActionId) { this.performAction_('customAction', { customActionID: customActionId }); }, performStandardAction: function(action) { var standardActions = GetStandardActions(this.treeID, this.id); if (!standardActions || !standardActions.find(item => action == item)) { throw 'Inapplicable action for node: ' + action; } this.performAction_(action); }, replaceSelectedText: function(value) { if (this.state.editable) { this.performAction_('replaceSelectedText', { value: value}); } }, resumeMedia: function() { this.performAction_('resumeMedia'); }, scrollBackward: function(opt_callback) { this.performAction_('scrollBackward', {}, opt_callback); }, scrollForward: function(opt_callback) { this.performAction_('scrollForward', {}, opt_callback); }, scrollUp: function(opt_callback) { this.performAction_('scrollUp', {}, opt_callback); }, scrollDown: function(opt_callback) { this.performAction_('scrollDown', {}, opt_callback); }, scrollLeft: function(opt_callback) { this.performAction_('scrollLeft', {}, opt_callback); }, scrollRight: function(opt_callback) { this.performAction_('scrollRight', {}, opt_callback); }, setSelection: function(startIndex, endIndex) { if (this.state.editable) { this.performAction_('setSelection', { focusNodeID: this.id, anchorOffset: startIndex, focusOffset: endIndex }); } }, setSequentialFocusNavigationStartingPoint: function() { this.performAction_('setSequentialFocusNavigationStartingPoint'); }, setValue: function(value) { if (this.state.editable) { this.performAction_('setValue', { value: value}); } }, showContextMenu: function() { this.performAction_('showContextMenu'); }, startDuckingMedia: function() { this.performAction_('startDuckingMedia'); }, stopDuckingMedia: function() { this.performAction_('stopDuckingMedia'); }, suspendMedia: function() { this.performAction_('suspendMedia'); }, domQuerySelector: function(selector, callback) { if (!this.rootImpl) callback(); automationInternal.querySelector( { treeID: this.rootImpl.treeID, automationNodeID: this.id, selector: selector }, $Function.bind(this.domQuerySelectorCallback_, this, callback)); }, find: function(params) { return this.findInternal_(params); }, findAll: function(params) { return this.findInternal_(params, []); }, matches: function(params) { return this.matchInternal_(params); }, addEventListener: function(eventType, callback, capture) { this.removeEventListener(eventType, callback); if (!this.listeners[eventType]) this.listeners[eventType] = []; $Array.push(this.listeners[eventType], { __proto__: null, callback: callback, capture: !!capture, }); }, // TODO(dtseng/aboxhall): Check this impl against spec. removeEventListener: function(eventType, callback) { if (this.listeners[eventType]) { var listeners = this.listeners[eventType]; for (var i = 0; i < listeners.length; i++) { if (callback === listeners[i].callback) $Array.splice(listeners, i, 1); } } }, toJSON: function() { return { treeID: this.treeID, id: this.id, role: this.role, attributes: this.attributes }; }, dispatchEvent: function(eventType, eventFrom, mouseX, mouseY) { var path = []; var parent = this.parent; while (parent) { $Array.push(path, parent); parent = parent.parent; } var event = new AutomationEvent(eventType, this.wrapper, eventFrom); event.mouseX = mouseX; event.mouseY = mouseY; // Dispatch the event through the propagation path in three phases: // - capturing: starting from the root and going down to the target's parent // - targeting: dispatching the event on the target itself // - bubbling: starting from the target's parent, going back up to the root. // At any stage, a listener may call stopPropagation() on the event, which // will immediately stop event propagation through this path. if (this.dispatchEventAtCapturing_(event, path)) { if (this.dispatchEventAtTargeting_(event, path)) this.dispatchEventAtBubbling_(event, path); } }, toString: function() { var parentID = GetParentID(this.treeID, this.id); var childTreeID = GetIntAttribute(this.treeID, this.id, 'childTreeId'); var count = GetChildCount(this.treeID, this.id); var childIDs = []; for (var i = 0; i < count; ++i) { var childID = GetChildIDAtIndex(this.treeID, this.id, i); $Array.push(childIDs, childID); } var result = 'node id=' + this.id + ' role=' + this.role + ' state=' + $JSON.stringify(this.state) + ' parentID=' + parentID + ' childIds=' + $JSON.stringify(childIDs); if (this.hostNode_) { var hostNodeImpl = privates(this.hostNode_).impl; result += ' host treeID=' + hostNodeImpl.treeID + ' host nodeID=' + hostNodeImpl.id; } if (childTreeID) result += ' childTreeID=' + childTreeID; return result; }, dispatchEventAtCapturing_: function(event, path) { privates(event).impl.eventPhase = Event.CAPTURING_PHASE; for (var i = path.length - 1; i >= 0; i--) { this.fireEventListeners_(path[i], event); if (privates(event).impl.propagationStopped) return false; } return true; }, dispatchEventAtTargeting_: function(event) { privates(event).impl.eventPhase = Event.AT_TARGET; this.fireEventListeners_(this.wrapper, event); return !privates(event).impl.propagationStopped; }, dispatchEventAtBubbling_: function(event, path) { privates(event).impl.eventPhase = Event.BUBBLING_PHASE; for (var i = 0; i < path.length; i++) { this.fireEventListeners_(path[i], event); if (privates(event).impl.propagationStopped) return false; } return true; }, fireEventListeners_: function(node, event) { var nodeImpl = privates(node).impl; if (!nodeImpl.rootImpl) return; var listeners = nodeImpl.listeners[event.type]; if (!listeners) return; var eventPhase = event.eventPhase; for (var i = 0; i < listeners.length; i++) { if (eventPhase == Event.CAPTURING_PHASE && !listeners[i].capture) continue; if (eventPhase == Event.BUBBLING_PHASE && listeners[i].capture) continue; try { listeners[i].callback(event); } catch (e) { exceptionHandler.handle('Error in event handler for ' + event.type + ' during phase ' + eventPhase, e); } } }, performAction_: function(actionType, opt_args, opt_callback) { if (!this.rootImpl) return; // Not yet initialized. if (this.rootImpl.treeID === undefined || this.id === undefined) { return; } // Check permissions. if (!IsInteractPermitted()) { throw new Error(actionType + ' requires {"desktop": true} or' + ' {"interact": true} in the "automation" manifest key.'); } var requestID = -1; if (opt_callback) { requestID = this.rootImpl.addActionResultCallback(opt_callback); } automationInternal.performAction({ treeID: this.rootImpl.treeID, automationNodeID: this.id, actionType: actionType, requestID: requestID}, opt_args || {}); }, domQuerySelectorCallback_: function(userCallback, resultAutomationNodeID) { // resultAutomationNodeID could be zero or undefined or (unlikely) null; // they all amount to the same thing here, which is that no node was // returned. if (!resultAutomationNodeID || !this.rootImpl) { userCallback(null); return; } var resultNode = this.rootImpl.get(resultAutomationNodeID); if (!resultNode) { logging.WARNING('Query selector result not in tree: ' + resultAutomationNodeID); userCallback(null); } userCallback(resultNode); }, findInternal_: function(params, opt_results) { var result = null; this.forAllDescendants_(function(node) { if (privates(node).impl.matchInternal_(params)) { if (opt_results) $Array.push(opt_results, node); else result = node; return !opt_results; } }); if (opt_results) return opt_results; return result; }, /** * Executes a closure for all of this node's descendants, in pre-order. * Early-outs if the closure returns true. * @param {Function(AutomationNode):boolean} closure Closure to be executed * for each node. Return true to early-out the traversal. */ forAllDescendants_: function(closure) { var stack = $Array.reverse(this.wrapper.children); while (stack.length > 0) { var node = $Array.pop(stack); if (closure(node)) return; var children = node.children; for (var i = children.length - 1; i >= 0; i--) $Array.push(stack, children[i]); } }, matchInternal_: function(params) { if ($Object.keys(params).length === 0) return false; if ('role' in params && this.role != params.role) return false; if ('state' in params) { for (var state in params.state) { if (params.state[state] != (state in this.state)) return false; } } if ('attributes' in params) { for (var attribute in params.attributes) { var attrValue = params.attributes[attribute]; if (typeof attrValue != 'object') { if (this[attribute] !== attrValue) return false; } else if (attrValue instanceof $RegExp.self) { if (typeof this[attribute] != 'string') return false; if (!attrValue.test(this[attribute])) return false; } else { // TODO(aboxhall): handle intlist case. return false; } } } return true; } }; var stringAttributes = [ 'accessKey', 'ariaInvalidValue', 'autoComplete', 'className', 'containerLiveRelevant', 'containerLiveStatus', 'description', 'display', 'htmlTag', 'imageDataUrl', 'language', 'liveRelevant', 'liveStatus', 'name', 'placeholder', 'roleDescription', 'textInputType', 'url', 'value']; var boolAttributes = [ 'busy', 'clickable', 'containerLiveAtomic', 'containerLiveBusy', 'liveAtomic', 'modal', 'scrollable', 'selected' ]; var intAttributes = [ 'backgroundColor', 'color', 'colorValue', 'hierarchicalLevel', 'posInSet', 'scrollX', 'scrollXMax', 'scrollXMin', 'scrollY', 'scrollYMax', 'scrollYMin', 'setSize', 'tableCellColumnIndex', 'ariaCellColumnIndex', 'tableCellColumnSpan', 'tableCellRowIndex', 'ariaCellRowIndex', 'tableCellRowSpan', 'tableColumnCount', 'ariaColumnCount', 'tableColumnIndex', 'tableRowCount', 'ariaRowCount', 'tableRowIndex', 'textSelEnd', 'textSelStart']; // Int attribute, relation property to expose, reverse relation to expose. var nodeRefAttributes = [ ['activedescendantId', 'activeDescendant', null], ['detailsId', 'details', 'detailsFor'], ['errorMessageId', 'errorMessage', 'errorMessageFor'], ['inPageLinkTargetId', 'inPageLinkTarget', null], ['nextFocusId', 'nextFocus', null], ['nextOnLineId', 'nextOnLine', null], ['previousFocusId', 'previousFocus', null], ['previousOnLineId', 'previousOnLine', null], ['tableColumnHeaderId', 'tableColumnHeader', null], ['tableHeaderId', 'tableHeader', null], ['tableRowHeaderId', 'tableRowHeader', null]]; var intListAttributes = [ 'lineBreaks', 'markerEnds', 'markerStarts', 'markerTypes', 'wordEnds', 'wordStarts']; // Intlist attribute, relation property to expose, reverse relation to expose. var nodeRefListAttributes = [ ['controlsIds', 'controls', 'controlledBy'], ['describedbyIds', 'describedBy', 'descriptionFor'], ['flowtoIds', 'flowTo', 'flowFrom'], ['labelledbyIds', 'labelledBy', 'labelFor']]; var floatAttributes = [ 'valueForRange', 'minValueForRange', 'maxValueForRange']; var htmlAttributes = [ ['type', 'inputType']]; var publicAttributes = []; $Array.forEach(stringAttributes, function(attributeName) { $Array.push(publicAttributes, attributeName); $Object.defineProperty(AutomationNodeImpl.prototype, attributeName, { __proto__: null, get: function() { return GetStringAttribute(this.treeID, this.id, attributeName); } }); }); $Array.forEach(boolAttributes, function(attributeName) { $Array.push(publicAttributes, attributeName); $Object.defineProperty(AutomationNodeImpl.prototype, attributeName, { __proto__: null, get: function() { return GetBoolAttribute(this.treeID, this.id, attributeName); } }); }); $Array.forEach(intAttributes, function(attributeName) { $Array.push(publicAttributes, attributeName); $Object.defineProperty(AutomationNodeImpl.prototype, attributeName, { __proto__: null, get: function() { return GetIntAttribute(this.treeID, this.id, attributeName); } }); }); $Array.forEach(nodeRefAttributes, function(params) { var srcAttributeName = params[0]; var dstAttributeName = params[1]; var dstReverseAttributeName = params[2]; $Array.push(publicAttributes, dstAttributeName); $Object.defineProperty(AutomationNodeImpl.prototype, dstAttributeName, { __proto__: null, get: function() { var id = GetIntAttribute(this.treeID, this.id, srcAttributeName); if (id && this.rootImpl) return this.rootImpl.get(id); else return undefined; } }); if (dstReverseAttributeName) { $Array.push(publicAttributes, dstReverseAttributeName); $Object.defineProperty(AutomationNodeImpl.prototype, dstReverseAttributeName, { __proto__: null, get: function() { var ids = GetIntAttributeReverseRelations( this.treeID, this.id, srcAttributeName); if (!ids || !this.rootImpl) return undefined; var result = []; for (var i = 0; i < ids.length; ++i) { var node = this.rootImpl.get(ids[i]); if (node) $Array.push(result, node); } return result; } }); } }); $Array.forEach(intListAttributes, function(attributeName) { $Array.push(publicAttributes, attributeName); $Object.defineProperty(AutomationNodeImpl.prototype, attributeName, { __proto__: null, get: function() { return GetIntListAttribute(this.treeID, this.id, attributeName); } }); }); $Array.forEach(nodeRefListAttributes, function(params) { var srcAttributeName = params[0]; var dstAttributeName = params[1]; var dstReverseAttributeName = params[2]; $Array.push(publicAttributes, dstAttributeName); $Object.defineProperty(AutomationNodeImpl.prototype, dstAttributeName, { __proto__: null, get: function() { var ids = GetIntListAttribute(this.treeID, this.id, srcAttributeName); if (!ids || !this.rootImpl) return undefined; var result = []; for (var i = 0; i < ids.length; ++i) { var node = this.rootImpl.get(ids[i]); if (node) $Array.push(result, node); } return result; } }); if (dstReverseAttributeName) { $Array.push(publicAttributes, dstReverseAttributeName); $Object.defineProperty(AutomationNodeImpl.prototype, dstReverseAttributeName, { __proto__: null, get: function() { var ids = GetIntListAttributeReverseRelations( this.treeID, this.id, srcAttributeName); if (!ids || !this.rootImpl) return undefined; var result = []; for (var i = 0; i < ids.length; ++i) { var node = this.rootImpl.get(ids[i]); if (node) $Array.push(result, node); } return result; } }); } }); $Array.forEach(floatAttributes, function(attributeName) { $Array.push(publicAttributes, attributeName); $Object.defineProperty(AutomationNodeImpl.prototype, attributeName, { __proto__: null, get: function() { return GetFloatAttribute(this.treeID, this.id, attributeName); } }); }); $Array.forEach(htmlAttributes, function(params) { var srcAttributeName = params[0]; var dstAttributeName = params[1]; $Array.push(publicAttributes, dstAttributeName); $Object.defineProperty(AutomationNodeImpl.prototype, dstAttributeName, { __proto__: null, get: function() { return GetHtmlAttribute(this.treeID, this.id, srcAttributeName); } }); }); /** * AutomationRootNode. * * An AutomationRootNode is the javascript end of an AXTree living in the * browser. AutomationRootNode handles unserializing incremental updates from * the source AXTree. Each update contains node data that form a complete tree * after applying the update. * * A brief note about ids used through this class. The source AXTree assigns * unique ids per node and we use these ids to build a hash to the actual * AutomationNode object. * Thus, tree traversals amount to a lookup in our hash. * * The tree itself is identified by the accessibility tree id of the * renderer widget host. * @constructor */ function AutomationRootNodeImpl(treeID) { $Function.call(AutomationNodeImpl, this, this); this.treeID = treeID; this.axNodeDataCache_ = {__proto__: null}; this.actionRequestIDToCallback_ = {__proto__: null}; } utils.defineProperty(AutomationRootNodeImpl, 'idToAutomationRootNode_', {__proto__: null}); utils.defineProperty(AutomationRootNodeImpl, 'get', function(treeID) { var result = AutomationRootNodeImpl.idToAutomationRootNode_[treeID]; return result || undefined; }); utils.defineProperty(AutomationRootNodeImpl, 'getOrCreate', function(treeID) { if (AutomationRootNodeImpl.idToAutomationRootNode_[treeID]) return AutomationRootNodeImpl.idToAutomationRootNode_[treeID]; var result = new AutomationRootNode(treeID); AutomationRootNodeImpl.idToAutomationRootNode_[treeID] = result; return result; }); utils.defineProperty(AutomationRootNodeImpl, 'destroy', function(treeID) { delete AutomationRootNodeImpl.idToAutomationRootNode_[treeID]; }); AutomationRootNodeImpl.prototype = { __proto__: AutomationNodeImpl.prototype, /** * @type {boolean} */ isRootNode: true, /** * @type {number} */ treeID: -1, /** * The parent of this node from a different tree. * @type {?AutomationNode} * @private */ hostNode_: null, /** * A map from id to AutomationNode. * @type {Object.} * @private */ axNodeDataCache_: null, actionRequestCounter_: 0, actionRequestIDToCallback_: null, get id() { var result = GetRootID(this.treeID); // Don't return undefined, because the id is often passed directly // as an argument to a native binding that expects only a valid number. if (result === undefined) return -1; return result; }, get chromeChannel() { return GetStringAttribute(this.treeID, this.id, 'chromeChannel'); }, get docUrl() { return GetDocURL(this.treeID); }, get docTitle() { return GetDocTitle(this.treeID); }, get docLoaded() { return GetDocLoaded(this.treeID); }, get docLoadingProgress() { return GetDocLoadingProgress(this.treeID); }, get anchorObject() { var id = GetAnchorObjectID(this.treeID); if (id && id != -1) return this.get(id); else return undefined; }, get anchorOffset() { var id = GetAnchorObjectID(this.treeID); if (id && id != -1) return GetAnchorOffset(this.treeID); }, get anchorAffinity() { var id = GetAnchorObjectID(this.treeID); if (id && id != -1) return GetAnchorAffinity(this.treeID); }, get focusObject() { var id = GetFocusObjectID(this.treeID); if (id && id != -1) return this.get(id); else return undefined; }, get focusOffset() { var id = GetFocusObjectID(this.treeID); if (id && id != -1) return GetFocusOffset(this.treeID); }, get focusAffinity() { var id = GetFocusObjectID(this.treeID); if (id && id != -1) return GetFocusAffinity(this.treeID); }, get: function(id) { if (id == undefined) return undefined; if (id == this.id) return this.wrapper; var obj = this.axNodeDataCache_[id]; if (obj) return obj; // Validate the backing AXTree has the specified node. if (!GetRole(this.treeID, id)) return; obj = new AutomationNode(this); privates(obj).impl.treeID = this.treeID; privates(obj).impl.id = id; this.axNodeDataCache_[id] = obj; return obj; }, remove: function(id) { if (this.axNodeDataCache_[id]) privates(this.axNodeDataCache_[id]).impl.detach(); delete this.axNodeDataCache_[id]; }, destroy: function() { this.dispatchEvent('destroyed', 'none'); for (var id in this.axNodeDataCache_) this.remove(id); this.detach(); }, setHostNode(hostNode) { this.hostNode_ = hostNode; }, onAccessibilityEvent: function(eventParams) { var targetNode = this.get(eventParams.targetID); if (targetNode) { var targetNodeImpl = privates(targetNode).impl; targetNodeImpl.dispatchEvent( eventParams.eventType, eventParams.eventFrom, eventParams.mouseX, eventParams.mouseY); if (eventParams.actionRequestID != -1) { this.onActionResult(eventParams.actionRequestID, targetNode); } } else { logging.WARNING('Got ' + eventParams.eventType + ' event on unknown node: ' + eventParams.targetID + '; this: ' + this.id); } return true; }, addActionResultCallback: function(callback) { this.actionRequestIDToCallback_[++this.actionRequestCounter_] = callback; return this.actionRequestCounter_; }, onActionResult: function(requestID, result) { if (requestID in this.actionRequestIDToCallback_) { this.actionRequestIDToCallback_[requestID](result); delete this.actionRequestIDToCallback_[requestID]; } }, toString: function() { function toStringInternal(nodeImpl, indent) { if (!nodeImpl) return ''; var output = ''; if (nodeImpl.isRootNode) output += indent + 'tree id=' + nodeImpl.treeID + '\n'; output += indent + $Function.call(AutomationNodeImpl.prototype.toString, nodeImpl) + '\n'; indent += ' '; var children = nodeImpl.children; for (var i = 0; i < children.length; ++i) output += toStringInternal(privates(children[i]).impl, indent); return output; } return toStringInternal(this, ''); }, }; function AutomationNode() { privates(AutomationNode).constructPrivate(this, arguments); } utils.expose(AutomationNode, AutomationNodeImpl, { functions: [ 'doDefault', 'find', 'findAll', 'focus', 'getImageData', 'hitTest', 'hitTestWithReply', 'makeVisible', 'matches', 'performCustomAction', 'performStandardAction', 'replaceSelectedText', 'resumeMedia', 'scrollBackward', 'scrollForward', 'scrollUp', 'scrollDown', 'scrollLeft', 'scrollRight', 'setSelection', 'setSequentialFocusNavigationStartingPoint', 'setValue', 'showContextMenu', 'startDuckingMedia', 'stopDuckingMedia', 'suspendMedia', 'addEventListener', 'removeEventListener', 'domQuerySelector', 'toString', 'boundsForRange', ], readonly: $Array.concat(publicAttributes, [ 'parent', 'firstChild', 'lastChild', 'children', 'previousSibling', 'nextSibling', 'isRootNode', 'role', 'checked', 'defaultActionVerb', 'restriction', 'state', 'location', 'indexInParent', 'lineStartOffsets', 'root', 'htmlAttributes', 'nameFrom', 'bold', 'italic', 'underline', 'lineThrough', 'customActions', 'standardActions', 'unclippedLocation', ]), }); function AutomationRootNode() { privates(AutomationRootNode).constructPrivate(this, arguments); } utils.expose(AutomationRootNode, AutomationRootNodeImpl, { superclass: AutomationNode, readonly: [ 'chromeChannel', 'docTitle', 'docUrl', 'docLoaded', 'docLoadingProgress', 'anchorObject', 'anchorOffset', 'anchorAffinity', 'focusObject', 'focusOffset', 'focusAffinity', ], }); utils.defineProperty(AutomationRootNode, 'get', function(treeID) { return AutomationRootNodeImpl.get(treeID); }); utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { return AutomationRootNodeImpl.getOrCreate(treeID); }); utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { AutomationRootNodeImpl.destroy(treeID); }); exports.$set('AutomationNode', AutomationNode); exports.$set('AutomationRootNode', AutomationRootNode); // Copyright (c) 2012 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. // Custom binding for the browserAction API. var binding = apiBridge || require('binding').Binding.create('browserAction'); var setIcon = require('setIcon').setIcon; var getExtensionViews = requireNative('runtime').GetExtensionViews; var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; var jsLastError = bindingUtil ? undefined : require('lastError'); function hasLastError() { return bindingUtil ? bindingUtil.hasLastError() : jsLastError.hasError(chrome); } binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('setIcon', function(details, callback) { setIcon(details, function(args) { sendRequest('browserAction.setIcon', [args, callback], apiBridge ? undefined : this.definition.parameters, undefined); }.bind(this)); }); apiFunctions.setCustomCallback('openPopup', function(name, request, callback, response) { if (!callback) return; if (hasLastError()) { callback(); } else { var views = getExtensionViews(-1, -1, 'POPUP'); callback(views.length > 0 ? views[0] : null); } }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the Cast Streaming RtpStream API. var binding = apiBridge || require('binding').Binding.create('cast.streaming.rtpStream'); var natives = requireNative('cast_streaming_natives'); binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('destroy', function(transportId) { natives.DestroyCastRtpStream(transportId); }); apiFunctions.setHandleRequest('getSupportedParams', function(transportId) { return natives.GetSupportedParamsCastRtpStream(transportId); }); apiFunctions.setHandleRequest('start', function(transportId, params) { natives.StartCastRtpStream(transportId, params); }); apiFunctions.setHandleRequest('stop', function(transportId) { natives.StopCastRtpStream(transportId); }); apiFunctions.setHandleRequest('toggleLogging', function(transportId, enable) { natives.ToggleLogging(transportId, enable); }); apiFunctions.setHandleRequest('getRawEvents', function(transportId, extraData, callback) { natives.GetRawEvents(transportId, extraData, callback); }); apiFunctions.setHandleRequest('getStats', function(transportId, callback) { natives.GetStats(transportId, callback); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the Cast Streaming Session API. var binding = apiBridge || require('binding').Binding.create('cast.streaming.session'); var natives = requireNative('cast_streaming_natives'); binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('create', function(audioTrack, videoTrack, callback) { natives.CreateSession(audioTrack, videoTrack, callback); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the Cast Streaming UdpTransport API. var binding = apiBridge || require('binding').Binding.create('cast.streaming.udpTransport'); var natives = requireNative('cast_streaming_natives'); binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('destroy', function(transportId) { natives.DestroyCastUdpTransport(transportId); }); apiFunctions.setHandleRequest('setDestination', function(transportId, destination) { natives.SetDestinationCastUdpTransport(transportId, destination); }); apiFunctions.setHandleRequest('setOptions', function(transportId, options) { natives.SetOptionsCastUdpTransport(transportId, options); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the Cast Streaming Session API. var binding = apiBridge || require('binding').Binding.create('cast.streaming.receiverSession'); var natives = requireNative('cast_streaming_natives'); binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest( 'createAndBind', function(ap, vp, local, weidgth, height, fr, url, cb, op) { natives.StartCastRtpReceiver( ap, vp, local, weidgth, height, fr, url, cb, op); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. var Event = require('event_bindings').Event; var sendRequest = require('sendRequest').sendRequest; var validate = require('schemaUtils').validate; function extendSchema(schema) { var extendedSchema = $Array.slice(schema); $Array.unshift(extendedSchema, {'type': 'string'}); return extendedSchema; } // TODO(devlin): Maybe find a way to combine this and ContentSetting. function ChromeSetting(prefKey, valueSchema, schema) { var getFunctionParameters = function(name) { var f = $Array.filter( schema.functions, function(f) { return f.name === name; })[0]; return f.parameters; }; this.get = function(details, callback) { var getSchema = getFunctionParameters('get'); validate([details, callback], getSchema); return sendRequest('types.ChromeSetting.get', [prefKey, details, callback], extendSchema(getSchema)); }; this.set = function(details, callback) { // The set schema included in the Schema object is generic, since it varies // per-setting. However, this is only ever for a single setting, so we can // enforce the types more thoroughly. var rawSetSchema = getFunctionParameters('set'); var rawSettingParam = rawSetSchema[0]; var props = $Object.assign({}, rawSettingParam.properties); props.value = valueSchema; var modSettingParam = { name: rawSettingParam.name, type: rawSettingParam.type, properties: props, }; var modSetSchema = $Array.slice(rawSetSchema); modSetSchema[0] = modSettingParam; validate([details, callback], modSetSchema); return sendRequest('types.ChromeSetting.set', [prefKey, details, callback], extendSchema(modSetSchema)); }; this.clear = function(details, callback) { var clearSchema = getFunctionParameters('clear'); validate([details, callback], clearSchema); return sendRequest('types.ChromeSetting.clear', [prefKey, details, callback], extendSchema(clearSchema)); }; this.onChange = new Event('types.ChromeSetting.' + prefKey + '.onChange'); }; exports.$set('ChromeSetting', ChromeSetting); // Copyright 2014 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. var binding = apiBridge || require('binding').Binding.create('chromeWebViewInternal'); var contextMenusHandlers = require('contextMenusHandlers'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; var handlers = contextMenusHandlers.create(true /* isWebview */); apiFunctions.setHandleRequest( 'contextMenusCreate', handlers.requestHandlers.create); apiFunctions.setHandleRequest( 'contextMenusUpdate', handlers.requestHandlers.update); apiFunctions.setHandleRequest( 'contextMenusRemove', handlers.requestHandlers.remove); apiFunctions.setHandleRequest( 'contextMenusRemoveAll', handlers.requestHandlers.removeAll); }); if (!apiBridge) exports.$set('ChromeWebView', binding.generate()); // Copyright 2014 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. // This module implements chrome-specific API. // See web_view_api_methods.js for details. var ChromeWebView = getInternalApi ? getInternalApi('chromeWebViewInternal') : require('chromeWebViewInternal').ChromeWebView; var ChromeWebViewSchema = requireNative('schema_registry').GetSchema('chromeWebViewInternal'); var CreateEvent = require('guestViewEvents').CreateEvent; var GuestViewInternalNatives = requireNative('guest_view_internal'); var idGeneratorNatives = requireNative('id_generator'); var utils = require('utils'); var WebViewImpl = require('webView').WebViewImpl; // This is the only "webViewInternal.onClicked" named event for this renderer. // // Since we need an event per , we define events with suffix // (subEventName) in each of the . Behind the scenes, this event is // registered as a ContextMenusEvent, with filter set to the webview's // |viewInstanceId|. Any time a ContextMenusEvent is dispatched, we re-dispatch // it to the subEvent's listeners. This way // .contextMenus.onClicked behave as a regular chrome Event type. var ContextMenusEvent = CreateEvent('chromeWebViewInternal.onClicked'); // See comment above. var ContextMenusHandlerEvent = CreateEvent('chromeWebViewInternal.onContextMenuShow'); var jsEvent; function createCustomEvent(name, schema, options, webviewId) { if (bindingUtil) return bindingUtil.createCustomEvent(name, undefined, false, false); if (!jsEvent) jsEvent = require('event_bindings').Event; return new jsEvent(name, schema, options, webviewId); } // This event is exposed as .contextMenus.onClicked. function createContextMenusOnClickedEvent(webViewInstanceId, opt_eventName, opt_argSchemas, opt_eventOptions) { var subEventName = GetUniqueSubEventName(opt_eventName); var newEvent = createCustomEvent(subEventName, opt_argSchemas, opt_eventOptions, webViewInstanceId); var view = GuestViewInternalNatives.GetViewFromID(webViewInstanceId); if (view) { view.events.addScopedListener( ContextMenusEvent, $Function.bind(function() { // Re-dispatch to subEvent's listeners. $Function.apply(newEvent.dispatch, newEvent, $Array.slice(arguments)); }, newEvent), {instanceId: webViewInstanceId}); } return newEvent; } // This event is exposed as .contextMenus.onShow. function createContextMenusOnContextMenuEvent(webViewInstanceId, opt_eventName, opt_argSchemas, opt_eventOptions) { var subEventName = GetUniqueSubEventName(opt_eventName); var newEvent = createCustomEvent(subEventName, opt_argSchemas, opt_eventOptions, webViewInstanceId); var view = GuestViewInternalNatives.GetViewFromID(webViewInstanceId); if (view) { view.events.addScopedListener( ContextMenusHandlerEvent, $Function.bind(function(e) { var defaultPrevented = false; var event = { preventDefault: function() { defaultPrevented = true; } }; // Re-dispatch to subEvent's listeners. $Function.apply(newEvent.dispatch, newEvent, [event]); if (!defaultPrevented) { // TODO(lazyboy): Remove |items| parameter completely from // ChromeWebView.showContextMenu as we don't do anything useful with // it currently. var items = []; var guestInstanceId = GuestViewInternalNatives. GetViewFromID(webViewInstanceId).guest.getId(); ChromeWebView.showContextMenu(guestInstanceId, e.requestId, items); } }, newEvent), {instanceId: webViewInstanceId}); } return newEvent; } // ----------------------------------------------------------------------------- // WebViewContextMenusImpl object. // An instance of this class is exposed as .contextMenus. function WebViewContextMenusImpl(viewInstanceId) { this.viewInstanceId_ = viewInstanceId; } $Object.setPrototypeOf(WebViewContextMenusImpl.prototype, null); WebViewContextMenusImpl.prototype.create = function() { var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments)); return $Function.apply(ChromeWebView.contextMenusCreate, null, args); }; WebViewContextMenusImpl.prototype.remove = function() { var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments)); return $Function.apply(ChromeWebView.contextMenusRemove, null, args); }; WebViewContextMenusImpl.prototype.removeAll = function() { var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments)); return $Function.apply(ChromeWebView.contextMenusRemoveAll, null, args); }; WebViewContextMenusImpl.prototype.update = function() { var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments)); return $Function.apply(ChromeWebView.contextMenusUpdate, null, args); }; function WebViewContextMenus() { privates(WebViewContextMenus).constructPrivate(this, arguments); } utils.expose(WebViewContextMenus, WebViewContextMenusImpl, { functions: [ 'create', 'remove', 'removeAll', 'update', ], }); // ----------------------------------------------------------------------------- WebViewImpl.prototype.maybeSetupContextMenus = function() { if (!this.contextMenusOnContextMenuEvent_) { var eventName = 'chromeWebViewInternal.onContextMenuShow'; var eventSchema = utils.lookup(ChromeWebViewSchema.events, 'name', 'onShow'); var eventOptions = {supportsListeners: true, supportsLazyListeners: false}; this.contextMenusOnContextMenuEvent_ = createContextMenusOnContextMenuEvent( this.viewInstanceId, eventName, eventSchema, eventOptions); } var createContextMenus = $Function.bind(function() { return this.weakWrapper(function() { if (this.contextMenus_) { return this.contextMenus_; } this.contextMenus_ = new WebViewContextMenus(this.viewInstanceId); // Define 'onClicked' event property on |this.contextMenus_|. var getOnClickedEvent = $Function.bind(function() { return this.weakWrapper(function() { if (!this.contextMenusOnClickedEvent_) { var eventName = 'chromeWebViewInternal.onClicked'; var eventSchema = utils.lookup(ChromeWebViewSchema.events, 'name', 'onClicked'); var eventOptions = {supportsListeners: true, supportsLazyListeners: false}; var onClickedEvent = createContextMenusOnClickedEvent( this.viewInstanceId, eventName, eventSchema, eventOptions); this.contextMenusOnClickedEvent_ = onClickedEvent; return onClickedEvent; } return this.contextMenusOnClickedEvent_; }); }, this); $Object.defineProperty( this.contextMenus_, 'onClicked', {get: getOnClickedEvent(), enumerable: true}); $Object.defineProperty( this.contextMenus_, 'onShow', { get: this.weakWrapper(function() { return this.contextMenusOnContextMenuEvent_; }), enumerable: true }); return this.contextMenus_; }); }, this); // Expose .contextMenus object. $Object.defineProperty( this.element, 'contextMenus', { get: createContextMenus(), enumerable: true }); }; function GetUniqueSubEventName(eventName) { return eventName + '/' + idGeneratorNatives.GetNextId(); } // Copyright (c) 2012 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. // Custom binding for the contentSettings API. var sendRequest = require('sendRequest').sendRequest; var validate = require('schemaUtils').validate; // Some content types have been removed and no longer correspond to a real // content setting. Instead, these always return a fixed dummy value, and issue // a warning when accessed. This maps the content type name to the dummy value. var DEPRECATED_CONTENT_TYPES = { __proto__: null, fullscreen: 'allow', mouselock: 'allow', }; function extendSchema(schema) { var extendedSchema = $Array.slice(schema); $Array.unshift(extendedSchema, {'type': 'string'}); return extendedSchema; } function ContentSetting(contentType, settingSchema, schema) { var getFunctionParameters = function(name) { var f = $Array.filter( schema.functions, function(f) { return f.name === name; })[0]; return f.parameters; }; this.get = function(details, callback) { var getSchema = getFunctionParameters('get'); validate([details, callback], getSchema); var dummySetting = DEPRECATED_CONTENT_TYPES[contentType]; if (dummySetting !== undefined) { console.warn('contentSettings.' + contentType + ' is deprecated; it will ' + 'always return \'' + dummySetting + '\'.'); $Function.apply(callback, undefined, [{setting: dummySetting}]); return; } return sendRequest('contentSettings.get', [contentType, details, callback], extendSchema(getSchema)); }; this.set = function(details, callback) { // We check if the setting is deprecated first, since the validation will // fail for deprecated types. if ($Object.hasOwnProperty(DEPRECATED_CONTENT_TYPES, contentType)) { console.warn('contentSettings.' + contentType + ' is deprecated; setting ' + 'it has no effect.'); $Function.apply(callback, undefined, []); return; } // The set schema included in the Schema object is generic, since it varies // per-setting. However, this is only ever for a single setting, so we can // enforce the types more thoroughly. var rawSetSchema = getFunctionParameters('set'); var rawSettingParam = rawSetSchema[0]; var props = $Object.assign({}, rawSettingParam.properties); props.setting = settingSchema; var modSettingParam = { name: rawSettingParam.name, type: rawSettingParam.type, properties: props, }; var modSetSchema = $Array.slice(rawSetSchema); modSetSchema[0] = modSettingParam; validate([details, callback], modSetSchema); return sendRequest('contentSettings.set', [contentType, details, callback], extendSchema(modSetSchema)); }; this.clear = function(details, callback) { var clearSchema = getFunctionParameters('clear'); validate([details, callback], clearSchema); if ($Object.hasOwnProperty(DEPRECATED_CONTENT_TYPES, contentType)) { console.warn('contentSettings.' + contentType + ' is deprecated; ' + 'clearing it has no effect.'); $Function.apply(callback, undefined, []); return; } return sendRequest('contentSettings.clear', [contentType, details, callback], extendSchema(clearSchema)); }; this.getResourceIdentifiers = function(callback) { var schema = getFunctionParameters('getResourceIdentifiers'); validate([callback], schema); if ($Object.hasOwnProperty(DEPRECATED_CONTENT_TYPES, contentType)) { $Function.apply(callback, undefined, []); return; } return sendRequest( 'contentSettings.getResourceIdentifiers', [contentType, callback], extendSchema(schema)); }; } exports.$set('ContentSetting', ContentSetting); // Copyright (c) 2012 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. // Custom binding for the declarativeContent API. var binding = apiBridge || require('binding').Binding.create('declarativeContent'); if (!apiBridge) { var utils = require('utils'); var validate = require('schemaUtils').validate; var canonicalizeCompoundSelector = requireNative('css_natives').CanonicalizeCompoundSelector; } var setIcon = require('setIcon').setIcon; binding.registerCustomHook(function(api) { var declarativeContent = api.compiledApi; if (apiBridge) { // Validation for most types is done in the native C++ with native bindings, // but setIcon is funny (and sadly broken). Ideally, we can move this // validation entirely into the native code, and this whole file can go // away. var nativeSetIcon = declarativeContent.SetIcon; declarativeContent.SetIcon = function(parameters) { // TODO(devlin): This is very, very wrong. setIcon() is potentially // asynchronous (in the case of a path being specified), which means this // becomes an "asynchronous constructor". Errors can be thrown *after* the // `new declarativeContent.SetIcon(...)` call, and in the async cases, // this wouldn't work when we immediately add the action via an API call // (e.g., // chrome.declarativeContent.onPageChange.addRules( // [{conditions: ..., actions: [ new SetIcon(...) ]}]); // ). Some of this is tracked in http://crbug.com/415315. setIcon(parameters, $Function.bind(function(data) { // Fake calling the original function as a constructor. $Object.setPrototypeOf(this, nativeSetIcon.prototype); $Function.apply(nativeSetIcon, this, [data]); }, this)); }; return; } // Returns the schema definition of type |typeId| defined in |namespace|. function getSchema(typeId) { return utils.lookup(api.schema.types, 'id', 'declarativeContent.' + typeId); } // Helper function for the constructor of concrete datatypes of the // declarative content API. // Makes sure that |this| contains the union of parameters and // {'instanceType': 'declarativeContent.' + typeId} and validates the // generated union dictionary against the schema for |typeId|. function setupInstance(instance, parameters, typeId) { for (var key in parameters) { if ($Object.hasOwnProperty(parameters, key)) { instance[key] = parameters[key]; } } instance.instanceType = 'declarativeContent.' + typeId; var schema = getSchema(typeId); validate([instance], [schema]); } function canonicalizeCssSelectors(selectors) { for (var i = 0; i < selectors.length; i++) { var canonicalizedSelector = canonicalizeCompoundSelector(selectors[i]); if (canonicalizedSelector == '') { throw new Error( 'Element of \'css\' array must be a ' + 'list of valid compound selectors: ' + selectors[i]); } selectors[i] = canonicalizedSelector; } } // Setup all data types for the declarative content API. declarativeContent.PageStateMatcher = function(parameters) { setupInstance(this, parameters, 'PageStateMatcher'); if ($Object.hasOwnProperty(this, 'css')) { canonicalizeCssSelectors(this.css); } }; declarativeContent.ShowPageAction = function(parameters) { setupInstance(this, parameters, 'ShowPageAction'); }; declarativeContent.RequestContentScript = function(parameters) { setupInstance(this, parameters, 'RequestContentScript'); }; // TODO(rockot): Do not expose this in M39 stable. Making this restriction // possible will take some extra work. See http://crbug.com/415315 // Note: See also the SetIcon wrapper above for more issues. declarativeContent.SetIcon = function(parameters) { setIcon(parameters, $Function.bind(function(data) { setupInstance(this, data, 'SetIcon'); }, this)); }; }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the desktopCapture API. var binding = apiBridge || require('binding').Binding.create('desktopCapture'); var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; var idGenerator = requireNative('id_generator'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; var pendingRequests = {}; function onRequestResult(id, result, options) { if (id in pendingRequests) { var callback = pendingRequests[id]; delete pendingRequests[id]; callback(result, options); } } apiFunctions.setHandleRequest('chooseDesktopMedia', function(sources, target_tab, callback) { // |target_tab| is an optional parameter. if (callback === undefined) { callback = target_tab; target_tab = undefined; } var id = idGenerator.GetNextId(); pendingRequests[id] = callback; sendRequest('desktopCapture.chooseDesktopMedia', [id, sources, target_tab, $Function.bind(onRequestResult, null, id)], apiBridge ? undefined : this.definition.parameters, undefined); return id; }); apiFunctions.setHandleRequest('cancelChooseDesktopMedia', function(id) { if (id in pendingRequests) { delete pendingRequests[id]; sendRequest('desktopCapture.cancelChooseDesktopMedia', [id], apiBridge ? undefined : this.definition.parameters, undefined); } }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2014 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. // Custom binding for the developerPrivate API. var binding = apiBridge || require('binding').Binding.create('developerPrivate'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; // Converts the argument of |functionName| from DirectoryEntry to URL. function bindFileSystemFunction(functionName) { apiFunctions.setUpdateArgumentsPostValidate( functionName, function(directoryEntry, callback) { var fileSystemName = directoryEntry.filesystem.name; var relativePath = $String.slice(directoryEntry.fullPath, 1); var url = directoryEntry.toURL(); return [fileSystemName, relativePath, url, callback]; }); } bindFileSystemFunction('loadDirectory'); // developerPrivate.enable is the same as chrome.management.setEnabled. // TODO(devlin): Migrate callers off developerPrivate.enable. bindingsAPI.compiledApi.enable = chrome.management.setEnabled; apiFunctions.setHandleRequest('allowFileAccess', function(id, allow, callback) { chrome.developerPrivate.updateExtensionConfiguration( {extensionId: id, fileAccess: allow}, callback); }); apiFunctions.setHandleRequest('allowIncognito', function(id, allow, callback) { chrome.developerPrivate.updateExtensionConfiguration( {extensionId: id, incognitoAccess: allow}, callback); }); apiFunctions.setHandleRequest('inspect', function(options, callback) { var renderViewId = options.render_view_id; if (typeof renderViewId == 'string') { renderViewId = parseInt(renderViewId); if (isNaN(renderViewId)) throw new Error('Invalid value for render_view_id'); } var renderProcessId = options.render_process_id; if (typeof renderProcessId == 'string') { renderProcessId = parseInt(renderProcessId); if (isNaN(renderProcessId)) throw new Error('Invalid value for render_process_id'); } chrome.developerPrivate.openDevTools({ extensionId: options.extension_id, renderProcessId: renderProcessId, renderViewId: renderViewId, incognito: options.incognito }, callback); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2013 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. // Custom bindings for the downloads API. var binding = apiBridge || require('binding').Binding.create('downloads'); var downloadsInternal = getInternalApi ? getInternalApi('downloadsInternal') : require('binding').Binding.create('downloadsInternal').generate(); var registerArgumentMassager = bindingUtil ? $Function.bind(bindingUtil.registerEventArgumentMassager, bindingUtil) : require('event_bindings').registerArgumentMassager; registerArgumentMassager('downloads.onDeterminingFilename', function(args, dispatch) { var downloadItem = args[0]; // Copy the id so that extensions can't change it. var downloadId = downloadItem.id; var suggestable = true; function isValidResult(result) { if (result === undefined) return false; if (typeof(result) != 'object') { console.error('Error: Invocation of form suggest(' + typeof(result) + ') doesn\'t match definition suggest({filename: string, ' + 'conflictAction: string})'); return false; } else if ((typeof(result.filename) != 'string') || (result.filename.length == 0)) { console.error('Error: "filename" parameter to suggest() must be a ' + 'non-empty string'); return false; } else if ([undefined, 'uniquify', 'overwrite', 'prompt'].indexOf( result.conflictAction) < 0) { console.error('Error: "conflictAction" parameter to suggest() must be ' + 'one of undefined, "uniquify", "overwrite", "prompt"'); return false; } return true; } function suggestCallback(result) { if (!suggestable) { console.error('suggestCallback may not be called more than once.'); return; } suggestable = false; if (isValidResult(result)) { downloadsInternal.determineFilename( downloadId, result.filename, result.conflictAction || ""); } else { downloadsInternal.determineFilename(downloadId, "", ""); } } try { var results = dispatch([downloadItem, suggestCallback]); var async = (results && results.results && (results.results.length != 0) && (results.results[0] === true)); if (suggestable && !async) suggestCallback(); } catch (e) { suggestCallback(); throw e; } }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2017 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. var Event = require('event_bindings').Event; // The EasyUnlockProximityRequired object is just a stub that has an onChange // event, which is never triggered. // TODO(devlin): Remove this once the preferencesPrivate API is fully removed. // https://crbug.com/593166 function EasyUnlockProximityRequired(prefKey, valueSchema, schema) { // Note: technically, extensions could intercept this through a setter on // Object.prototype(). We don't really care, because a) this is only for a // private API, so we shouldn't have to worry about untrusted code, and b) // this is an anonymous event, which exposes no attack surface and will be // exposed to the extension anyway. this.onChange = new Event(); }; exports.$set('EasyUnlockProximityRequired', EasyUnlockProximityRequired); // Copyright 2013 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. // Custom binding for the GCM API. var binding = apiBridge || require('binding').Binding.create('gcm'); var forEach = require('utils').forEach; binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; var gcm = bindingsAPI.compiledApi; apiFunctions.setUpdateArgumentsPostValidate( 'send', function(message, callback) { // Validate message.data. var payloadSize = 0; forEach(message.data, function(property, value) { if (property.length == 0) throw new Error("One of data keys is empty."); var lowerCasedProperty = property.toLowerCase(); // Issue an error for forbidden prefixes of property names. if (lowerCasedProperty.startsWith("goog.") || lowerCasedProperty.startsWith("google") || property.startsWith("collapse_key")) { throw new Error("Invalid data key: " + property); } payloadSize += property.length + value.length; }); if (payloadSize > gcm.MAX_MESSAGE_SIZE) throw new Error("Payload exceeded allowed size limit. Payload size is: " + payloadSize); if (payloadSize == 0) throw new Error("No data to send."); return arguments; }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the Identity API. var binding = apiBridge || require('binding').Binding.create('identity'); binding.registerCustomHook(function(binding, id, contextType) { var apiFunctions = binding.apiFunctions; apiFunctions.setHandleRequest('getRedirectURL', function(path) { if (path === null || path === undefined) path = '/'; else path = String(path); if (path[0] != '/') path = '/' + path; return 'https://' + id + '.chromiumapp.org' + path; }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom binding for the image writer private API. var binding = apiBridge || require('binding').Binding.create('imageWriterPrivate'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setUpdateArgumentsPostValidate( 'writeFromFile', function(device, fileEntry, options, callback) { var fileSystemName = fileEntry.filesystem.name; var relativePath = $String.slice(fileEntry.fullPath, 1); return [device, fileSystemName, relativePath, callback]; }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the input ime API. Only injected into the // v8 contexts for extensions which have permission for the API. var binding = apiBridge || require('binding').Binding.create('input.ime'); var appWindowNatives = requireNative('app_window_natives'); var registerArgumentMassager = bindingUtil ? $Function.bind(bindingUtil.registerEventArgumentMassager, bindingUtil) : require('event_bindings').registerArgumentMassager; // TODO(crbug.com/733825): These bindings have some issues. var inputIme; registerArgumentMassager('input.ime.onKeyEvent', function(args, dispatch) { var keyData = args[1]; var result = false; try { // dispatch() is weird - it returns an object {results: array} iff // there is at least one result value that !== undefined. Since onKeyEvent // has a maximum of one listener, we know that any result we find is the one // we're interested in. var dispatchResult = dispatch(args); if (dispatchResult && dispatchResult.results) result = dispatchResult.results[0]; } catch (e) { console.error('Error in event handler for onKeyEvent: ' + e.stack); } if (!inputIme.onKeyEvent.async) inputIme.keyEventHandled(keyData.requestId, result); }); binding.registerCustomHook(function(api) { inputIme = api.compiledApi; var originalAddListener = inputIme.onKeyEvent.addListener; inputIme.onKeyEvent.addListener = function(cb, opt_extraInfo) { inputIme.onKeyEvent.async = false; if (opt_extraInfo instanceof Array) { for (var i = 0; i < opt_extraInfo.length; ++i) { if (opt_extraInfo[i] == 'async') { inputIme.onKeyEvent.async = true; } } } $Function.call(originalAddListener, this, cb); }; api.apiFunctions.setCustomCallback('createWindow', function(name, request, callback, windowParams) { if (!callback) { return; } var view; if (windowParams && windowParams.frameId) { view = appWindowNatives.GetFrame( windowParams.frameId, false /* notifyBrowser */); view.id = windowParams.frameId; } callback(view); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the Media Gallery API. var binding = apiBridge || require('binding').Binding.create('mediaGalleries'); var blobNatives = requireNative('blob_natives'); var mediaGalleriesNatives = requireNative('mediaGalleries'); var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; var blobsAwaitingMetadata = {}; var mediaGalleriesMetadata = {}; function createFileSystemObjectsAndUpdateMetadata(response) { var result = []; mediaGalleriesMetadata = {}; // Clear any previous metadata. if (response) { for (var i = 0; i < response.length; i++) { var filesystem = mediaGalleriesNatives.GetMediaFileSystemObject( response[i].fsid); $Array.push(result, filesystem); var metadata = response[i]; delete metadata.fsid; mediaGalleriesMetadata[filesystem.name] = metadata; } } return result; } binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; // getMediaFileSystems and addUserSelectedFolder use a custom callback so that // they can instantiate and return an array of file system objects. apiFunctions.setCustomCallback('getMediaFileSystems', function(name, request, callback, response) { var result = createFileSystemObjectsAndUpdateMetadata(response); if (callback) callback(result); }); apiFunctions.setCustomCallback('addUserSelectedFolder', function(name, request, callback, response) { var fileSystems = []; var selectedFileSystemName = ""; if (response && 'mediaFileSystems' in response && 'selectedFileSystemIndex' in response) { fileSystems = createFileSystemObjectsAndUpdateMetadata( response['mediaFileSystems']); var selectedFileSystemIndex = response['selectedFileSystemIndex']; if (selectedFileSystemIndex >= 0) { selectedFileSystemName = fileSystems[selectedFileSystemIndex].name; } } if (callback) callback(fileSystems, selectedFileSystemName); }); apiFunctions.setHandleRequest('getMediaFileSystemMetadata', function(filesystem) { if (filesystem && filesystem.name && filesystem.name in mediaGalleriesMetadata) { return mediaGalleriesMetadata[filesystem.name]; } return { 'name': '', 'galleryId': '', 'isRemovable': false, 'isMediaDevice': false, 'isAvailable': false, }; }); function getMetadataCallback(uuid, name, request, callback, response) { if (response && response.attachedImagesBlobInfo) { for (var i = 0; i < response.attachedImagesBlobInfo.length; i++) { var blobInfo = response.attachedImagesBlobInfo[i]; var blob = blobNatives.TakeBrowserProcessBlob( blobInfo.blobUUID, blobInfo.type, blobInfo.size); response.metadata.attachedImages.push(blob); } } if (callback) callback(response ? response.metadata : null); delete blobsAwaitingMetadata[uuid]; } apiFunctions.setHandleRequest('getMetadata', function(mediaFile, options, callback) { var blobUuid = blobNatives.GetBlobUuid(mediaFile) // Store the blob in a global object to keep its refcount nonzero -- this // prevents the object from being garbage collected before any metadata // parsing gets to occur (see crbug.com/415792). blobsAwaitingMetadata[blobUuid] = mediaFile; var optArgs = { __proto__: null, customCallback: $Function.bind(getMetadataCallback, null, blobUuid), }; sendRequest('mediaGalleries.getMetadata', [blobUuid, options, callback], bindingUtil ? undefined : this.definition.parameters, optArgs); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2013 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. // Custom bindings for the notifications API. // var binding = apiBridge || require('binding').Binding.create('notifications'); var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; var exceptionHandler = require('uncaught_exception_handler'); var imageUtil = require('imageUtil'); var notificationsPrivate = requireNative('notifications_private'); var jsLastError = bindingUtil ? undefined : require('lastError'); function runCallbackWithLastError(name, message, stack, callback, args) { if (bindingUtil) { bindingUtil.runCallbackWithLastError(message, function() { $Function.apply(callback, null, args); }); } else { jsLastError.run(name, message, stack, callback, args); } } function imageDataSetter(context, key) { var f = function(val) { this[key] = val; }; return $Function.bind(f, context); } // A URL Spec is an object with the following keys: // path: The resource to be downloaded. // width: (optional) The maximum width of the image to be downloaded in device // pixels. // height: (optional) The maximum height of the image to be downloaded in // device pixels. // callback: A function to be called when the URL is complete. It // should accept an ImageData object and set the appropriate // field in |notificationDetails|. function getUrlSpecs(imageSizes, notificationDetails) { var urlSpecs = []; // |iconUrl| might be optional for notification updates. if (notificationDetails.iconUrl) { $Array.push(urlSpecs, { path: notificationDetails.iconUrl, width: imageSizes.icon.width * imageSizes.scaleFactor, height: imageSizes.icon.height * imageSizes.scaleFactor, callback: imageDataSetter(notificationDetails, 'iconBitmap') }); } // |appIconMaskUrl| is optional. if (notificationDetails.appIconMaskUrl) { $Array.push(urlSpecs, { path: notificationDetails.appIconMaskUrl, width: imageSizes.appIconMask.width * imageSizes.scaleFactor, height: imageSizes.appIconMask.height * imageSizes.scaleFactor, callback: imageDataSetter(notificationDetails, 'appIconMaskBitmap') }); } // |imageUrl| is optional. if (notificationDetails.imageUrl) { $Array.push(urlSpecs, { path: notificationDetails.imageUrl, width: imageSizes.image.width * imageSizes.scaleFactor, height: imageSizes.image.height * imageSizes.scaleFactor, callback: imageDataSetter(notificationDetails, 'imageBitmap') }); } // Each button has an optional icon. var buttonList = notificationDetails.buttons; if (buttonList && typeof buttonList.length === 'number') { var numButtons = buttonList.length; for (var i = 0; i < numButtons; i++) { if (buttonList[i].iconUrl) { $Array.push(urlSpecs, { path: buttonList[i].iconUrl, width: imageSizes.buttonIcon.width * imageSizes.scaleFactor, height: imageSizes.buttonIcon.height * imageSizes.scaleFactor, callback: imageDataSetter(buttonList[i], 'iconBitmap') }); } } } return urlSpecs; } function replaceNotificationOptionURLs(notification_details, callback) { var imageSizes = notificationsPrivate.GetNotificationImageSizes(); var url_specs = getUrlSpecs(imageSizes, notification_details); if (!url_specs.length) { callback(true); return; } var errors = 0; imageUtil.loadAllImages(url_specs, { onerror: function(index) { errors++; }, oncomplete: function(imageData) { if (errors > 0) { callback(false); return; } for (var index = 0; index < url_specs.length; index++) { var url_spec = url_specs[index]; url_spec.callback(imageData[index]); } callback(true); } }); } function genHandle(name, failure_function) { return function(id, input_notification_details, callback) { // TODO(dewittj): Remove this hack. This is used as a way to deep // copy a complex JSON object. var notification_details = $JSON.parse( $JSON.stringify(input_notification_details)); var that = this; var stack = exceptionHandler.getExtensionStackTrace(); replaceNotificationOptionURLs(notification_details, function(success) { if (success) { sendRequest( name, [id, notification_details, callback], bindingUtil ? undefined : that.definition.parameters, bindingUtil ? undefined : {__proto__: null, stack: stack}); return; } runCallbackWithLastError( name, 'Unable to download all specified images.', stack, failure_function, [callback || function() {}, id]); }); }; } var handleCreate = genHandle('notifications.create', function(callback, id) { callback(id); }); var handleUpdate = genHandle('notifications.update', function(callback, id) { callback(false); }); var notificationsCustomHook = function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('create', handleCreate); apiFunctions.setHandleRequest('update', handleUpdate); }; binding.registerCustomHook(notificationsCustomHook); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the omnibox API. Only injected into the v8 contexts // for extensions which have permission for the omnibox API. var binding = apiBridge || require('binding').Binding.create('omnibox'); var registerArgumentMassager = bindingUtil ? $Function.bind(bindingUtil.registerEventArgumentMassager, bindingUtil) : require('event_bindings').registerArgumentMassager; var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; // Remove invalid characters from |text| so that it is suitable to use // for |AutocompleteMatch::contents|. function sanitizeString(text, shouldTrim) { // NOTE: This logic mirrors |AutocompleteMatch::SanitizeString()|. // 0x2028 = line separator; 0x2029 = paragraph separator. var kRemoveChars = /(\r|\n|\t|\u2028|\u2029)/gm; if (shouldTrim) text = text.trimLeft(); return text.replace(kRemoveChars, ''); } // Parses the xml syntax supported by omnibox suggestion results. Returns an // object with two properties: 'description', which is just the text content, // and 'descriptionStyles', which is an array of style objects in a format // understood by the C++ backend. function parseOmniboxDescription(input) { var domParser = new DOMParser(); // The XML parser requires a single top-level element, but we want to // support things like 'hello, world!'. So we wrap the // provided text in generated root level element. var root = domParser.parseFromString( '' + input + '', 'text/xml'); // DOMParser has a terrible error reporting facility. Errors come out nested // inside the returned document. var error = root.querySelector('parsererror div'); if (error) { throw new Error(error.textContent); } // Otherwise, it's valid, so build up the result. var result = { description: '', descriptionStyles: [] }; // Recursively walk the tree. function walk(node) { for (var i = 0, child; child = node.childNodes[i]; i++) { // Append text nodes to our description. if (child.nodeType == Node.TEXT_NODE) { var shouldTrim = result.description.length == 0; result.description += sanitizeString(child.nodeValue, shouldTrim); continue; } // Process and descend into a subset of recognized tags. if (child.nodeType == Node.ELEMENT_NODE && (child.nodeName == 'dim' || child.nodeName == 'match' || child.nodeName == 'url')) { var style = { 'type': child.nodeName, 'offset': result.description.length }; $Array.push(result.descriptionStyles, style); walk(child); style.length = result.description.length - style.offset; continue; } // Descend into all other nodes, even if they are unrecognized, for // forward compat. walk(child); } }; walk(root); return result; } binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setUpdateArgumentsPreValidate('setDefaultSuggestion', function(suggestResult) { if (suggestResult.content != undefined) { // null, etc. throw new Error( 'setDefaultSuggestion cannot contain the "content" field'); } return [suggestResult]; }); apiFunctions.setHandleRequest('setDefaultSuggestion', function(details) { var parseResult = parseOmniboxDescription(details.description); sendRequest('omnibox.setDefaultSuggestion', [parseResult], bindingUtil ? undefined : this.definition.parameters, undefined); }); apiFunctions.setUpdateArgumentsPostValidate( 'sendSuggestions', function(requestId, userSuggestions) { var suggestions = []; for (var i = 0; i < userSuggestions.length; i++) { var parseResult = parseOmniboxDescription( userSuggestions[i].description); parseResult.content = userSuggestions[i].content; parseResult.deletable = userSuggestions[i].deletable; $Array.push(suggestions, parseResult); } return [requestId, suggestions]; }); }); registerArgumentMassager('omnibox.onInputChanged', function(args, dispatch) { var text = args[0]; var requestId = args[1]; var suggestCallback = function(suggestions) { chrome.omnibox.sendSuggestions(requestId, suggestions); }; dispatch([text, suggestCallback]); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the pageAction API. var binding = apiBridge || require('binding').Binding.create('pageAction'); var setIcon = require('setIcon').setIcon; var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('setIcon', function(details, callback) { setIcon(details, $Function.bind(function(args) { sendRequest('pageAction.setIcon', [args, callback], bindingUtil ? undefined : this.definition.parameters, undefined); }, this)); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the pageCapture API. var binding = apiBridge || require('binding').Binding.create('pageCapture'); var handleUncaughtException = require('uncaught_exception_handler').handle; var pageCaptureNatives = requireNative('page_capture'); var CreateBlob = pageCaptureNatives.CreateBlob; var SendResponseAck = pageCaptureNatives.SendResponseAck; binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setCustomCallback('saveAsMHTML', function(name, request, callback, response) { if (response) response = CreateBlob(response.mhtmlFilePath, response.mhtmlFileLength); try { callback(response); } catch (e) { handleUncaughtException( 'Error in chrome.pageCapture.saveAsMHTML callback', e, request.stack); } finally { // Notify the browser. Now that the blob is referenced from JavaScript, // the browser can drop its reference to it. SendResponseAck(request.id); } }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the syncFileSystem API. var binding = apiBridge || require('binding').Binding.create('syncFileSystem'); var registerArgumentMassager = bindingUtil ? $Function.bind(bindingUtil.registerEventArgumentMassager, bindingUtil) : require('event_bindings').registerArgumentMassager; var fileSystemNatives = requireNative('file_system_natives'); var syncFileSystemNatives = requireNative('sync_file_system'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; // Functions which take in an [instanceOf=FileEntry]. function bindFileEntryFunction(functionName) { apiFunctions.setUpdateArgumentsPostValidate( functionName, function(entry, callback) { var fileSystemUrl = entry.toURL(); return [fileSystemUrl, callback]; }); } $Array.forEach(['getFileStatus'], bindFileEntryFunction); // Functions which take in a FileEntry array. function bindFileEntryArrayFunction(functionName) { apiFunctions.setUpdateArgumentsPostValidate( functionName, function(entries, callback) { var fileSystemUrlArray = []; for (var i=0; i < entries.length; i++) { $Array.push(fileSystemUrlArray, entries[i].toURL()); } return [fileSystemUrlArray, callback]; }); } $Array.forEach(['getFileStatuses'], bindFileEntryArrayFunction); // Functions which take in an [instanceOf=DOMFileSystem]. function bindFileSystemFunction(functionName) { apiFunctions.setUpdateArgumentsPostValidate( functionName, function(filesystem, callback) { var fileSystemUrl = filesystem.root.toURL(); return [fileSystemUrl, callback]; }); } $Array.forEach(['getUsageAndQuota'], bindFileSystemFunction); // Functions which return an [instanceOf=DOMFileSystem]. apiFunctions.setCustomCallback('requestFileSystem', function(name, request, callback, response) { var result = null; if (response) { result = syncFileSystemNatives.GetSyncFileSystemObject( response.name, response.root); } if (callback) callback(result); }); // Functions which return an array of FileStatusInfo object // which has [instanceOf=FileEntry]. apiFunctions.setCustomCallback('getFileStatuses', function(name, request, callback, response) { var results = []; if (response) { for (var i = 0; i < response.length; i++) { var result = {}; var entry = response[i].entry; result.fileEntry = fileSystemNatives.GetFileEntry( entry.fileSystemType, entry.fileSystemName, entry.rootUrl, entry.filePath, entry.isDirectory); result.status = response[i].status; result.error = response[i].error; $Array.push(results, result); } } if (callback) callback(results); }); }); registerArgumentMassager('syncFileSystem.onFileStatusChanged', function(args, dispatch) { // Make FileEntry object using all the base string fields. var fileEntry = fileSystemNatives.GetFileEntry( args[0].fileSystemType, args[0].fileSystemName, args[0].rootUrl, args[0].filePath, args[0].isDirectory); // Combine into a single dictionary. var fileInfo = new Object(); fileInfo.fileEntry = fileEntry; fileInfo.status = args[1]; if (fileInfo.status == "synced") { fileInfo.action = args[2]; fileInfo.direction = args[3]; } dispatch([fileInfo]); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the systemIndicator API. // TODO(dewittj) Refactor custom binding to reduce redundancy between the // extension action APIs. var binding = apiBridge || require('binding').Binding.create('systemIndicator'); var setIcon = require('setIcon').setIcon; var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setHandleRequest('setIcon', function(details, callback) { setIcon(details, $Function.bind(function(args) { sendRequest('systemIndicator.setIcon', [args, callback], bindingUtil ? undefined : this.definition.parameters, undefined); }, this)); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the Tab Capture API. var binding = apiBridge || require('binding').Binding.create('tabCapture'); var jsLastError = bindingUtil ? undefined : require('lastError'); function runCallbackWithLastError(name, message, stack, callback, args) { if (bindingUtil) { bindingUtil.runCallbackWithLastError(message, function() { $Function.apply(callback, null, args); }); } else { jsLastError.run(name, message, stack, callback, args); } } binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; function proxyToGetUserMedia(name, request, callback, response) { if (!callback) return; if (!response) { // When the response is missing, runtime.lastError has already been set. // See chrome/browser/extensions/api/tab_capture/tab_capture_api.cc. callback(null); return; } // Convenience function for processing webkitGetUserMedia() error objects to // provide runtime.lastError messages for the tab capture API. function getErrorMessage(error, fallbackMessage) { if (!error || (typeof error.message != 'string')) return fallbackMessage; return error.message.replace(/(navigator\.)?(webkit)?GetUserMedia/gi, name); } var options = {}; if (response.audioConstraints) options.audio = response.audioConstraints; if (response.videoConstraints) options.video = response.videoConstraints; try { navigator.webkitGetUserMedia( options, function onSuccess(media_stream) { callback(media_stream); }, function onError(error) { runCallbackWithLastError( name, getErrorMessage(error, "Failed to start MediaStream."), request.stack, function() { callback(null); }); }); } catch (error) { runCallbackWithLastError( name, getErrorMessage(error, "Invalid argument(s)."), request.stack, function() { callback(null); }); } } apiFunctions.setCustomCallback('capture', proxyToGetUserMedia); apiFunctions.setCustomCallback('captureOffscreenTab', proxyToGetUserMedia); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the tabs API. var binding = apiBridge || require('binding').Binding.create('tabs'); var messaging = require('messaging'); var OpenChannelToTab = requireNative('messaging_natives').OpenChannelToTab; var sendRequestIsDisabled = requireNative('process').IsSendRequestDisabled(); var forEach = require('utils').forEach; binding.registerCustomHook(function(bindingsAPI, extensionId) { var apiFunctions = bindingsAPI.apiFunctions; var tabs = bindingsAPI.compiledApi; apiFunctions.setHandleRequest('connect', function(tabId, connectInfo) { var name = ''; var frameId = -1; if (connectInfo) { name = connectInfo.name || name; frameId = connectInfo.frameId; if (typeof frameId == 'undefined' || frameId === null || frameId < 0) frameId = -1; } var portId = OpenChannelToTab(tabId, frameId, extensionId, name); return messaging.createPort(portId, name); }); apiFunctions.setHandleRequest('sendRequest', function(tabId, request, responseCallback) { if (sendRequestIsDisabled) throw new Error(sendRequestIsDisabled); var port = tabs.connect(tabId, {name: messaging.kRequestChannel}); messaging.sendMessageImpl(port, request, responseCallback); }); apiFunctions.setHandleRequest('sendMessage', function(tabId, message, options, responseCallback) { var connectInfo = { name: messaging.kMessageChannel }; if (options) { forEach(options, function(k, v) { connectInfo[k] = v; }); } var port = tabs.connect(tabId, connectInfo); messaging.sendMessageImpl(port, message, responseCallback); }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the tts API. var binding = apiBridge || require('binding').Binding.create('tts'); var idGenerator = requireNative('id_generator'); var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; var lazyBG = requireNative('lazy_background_page'); binding.registerCustomHook(function(api) { var apiFunctions = api.apiFunctions; var tts = api.compiledApi; var handlers = {}; function ttsEventListener(event) { var eventHandler = handlers[event.srcId]; if (eventHandler) { eventHandler({ type: event.type, charIndex: event.charIndex, errorMessage: event.errorMessage }); if (event.isFinalEvent) { delete handlers[event.srcId]; // Balanced in 'speak' handler. lazyBG.DecrementKeepaliveCount(); } } } // This file will get run if an extension needs the ttsEngine permission, but // it doesn't necessarily have the tts permission. If it doesn't, trying to // add a listener to chrome.tts.onEvent will fail. // See http://crbug.com/122474. try { tts.onEvent.addListener(ttsEventListener); } catch (e) {} apiFunctions.setHandleRequest('speak', function() { var args = $Array.from(arguments); if (args.length > 1 && args[1] && args[1].onEvent) { var id = idGenerator.GetNextId(); args[1].srcId = id; handlers[id] = args[1].onEvent; // Keep the page alive until the event finishes. // Balanced in eventHandler. lazyBG.IncrementKeepaliveCount(); } sendRequest('tts.speak', args, bindingUtil ? undefined : this.definition.parameters, undefined); return id; }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the ttsEngine API. var binding = apiBridge || require('binding').Binding.create('ttsEngine'); var registerArgumentMassager = bindingUtil ? $Function.bind(bindingUtil.registerEventArgumentMassager, bindingUtil) : require('event_bindings').registerArgumentMassager; registerArgumentMassager('ttsEngine.onSpeak', function(args, dispatch) { var text = args[0]; var options = args[1]; var requestId = args[2]; var sendTtsEvent = function(event) { chrome.ttsEngine.sendTtsEvent(requestId, event); }; dispatch([text, options, sendTtsEvent]); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2015 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. // Custom binding for the webrtcDesktopCapturePrivate API. var binding = apiBridge || require('binding').Binding.create('webrtcDesktopCapturePrivate'); var sendRequest = bindingUtil ? $Function.bind(bindingUtil.sendRequest, bindingUtil) : require('sendRequest').sendRequest; var idGenerator = requireNative('id_generator'); binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; var pendingRequests = {}; function onRequestResult(id, result) { if (id in pendingRequests) { var callback = pendingRequests[id]; delete pendingRequests[id]; callback(result); } } apiFunctions.setHandleRequest('chooseDesktopMedia', function(sources, request, callback) { var id = idGenerator.GetNextId(); pendingRequests[id] = callback; sendRequest('webrtcDesktopCapturePrivate.chooseDesktopMedia', [id, sources, request, $Function.bind(onRequestResult, null, id)], bindingUtil ? undefined : this.definition.parameters, undefined); return id; }); apiFunctions.setHandleRequest('cancelChooseDesktopMedia', function(id) { if (id in pendingRequests) { delete pendingRequests[id]; sendRequest('webrtcDesktopCapturePrivate.cancelChooseDesktopMedia', [id], bindingUtil ? undefined : this.definition.parameters, undefined); } }); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright 2017 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. // Custom binding for the webrtcLoggingPrivate API. var binding = apiBridge || require('binding').Binding.create('webrtcLoggingPrivate'); var getBindDirectoryEntryCallback = require('fileEntryBindingUtil').getBindDirectoryEntryCallback; binding.registerCustomHook(function(binding, id, contextType) { var apiFunctions = binding.apiFunctions; apiFunctions.setCustomCallback('getLogsDirectory', getBindDirectoryEntryCallback()); }); if (!apiBridge) exports.$set('binding', binding.generate()); // Copyright (c) 2012 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. // Custom binding for the webstore API. var webstoreNatives = requireNative('webstore'); var onInstallStageChanged; var onDownloadProgress; function Installer() { this._pendingInstall = null; } Installer.prototype.install = function(url, onSuccess, onFailure) { if (this._pendingInstall) throw new Error('A Chrome Web Store installation is already pending.'); // With native bindings, these calls go through argument validation, which // sets optional/missing arguments to null. The native webstore bindings // expect either present or undefined, so transform null to undefined. if (url === null) url = undefined; if (onSuccess === null) onSuccess = undefined; if (onFailure === null) onFailure = undefined; if (url !== undefined && typeof url !== 'string') { throw new Error( 'The Chrome Web Store item link URL parameter must be a string.'); } if (onSuccess !== undefined && typeof onSuccess !== 'function') { throw new Error('The success callback parameter must be a function.'); } if (onFailure !== undefined && typeof onFailure !== 'function') { throw new Error('The failure callback parameter must be a function.'); } // Since we call Install() with a bool for if we have listeners, listeners // must be set prior to the inline installation starting (this is also // noted in the Event documentation in // chrome/common/extensions/api/webstore.json). var installId = webstoreNatives.Install( onInstallStageChanged.hasListeners(), onDownloadProgress.hasListeners(), url, onSuccess, onFailure); if (installId !== undefined) { this._pendingInstall = { installId: installId, onSuccess: onSuccess, onFailure: onFailure }; } }; Installer.prototype.onInstallResponse = function(installId, success, error, resultCode) { var pendingInstall = this._pendingInstall; if (!pendingInstall || pendingInstall.installId != installId) { // TODO(kalman): should this be an error? return; } try { if (success && pendingInstall.onSuccess) pendingInstall.onSuccess(); else if (!success && pendingInstall.onFailure) pendingInstall.onFailure(error, resultCode); } catch (e) { console.error('Exception in chrome.webstore.install response handler: ' + e.stack); } finally { this._pendingInstall = null; } }; Installer.prototype.onInstallStageChanged = function(installStage) { onInstallStageChanged.dispatch(installStage); }; Installer.prototype.onDownloadProgress = function(progress) { onDownloadProgress.dispatch(progress); }; var installer = new Installer(); if (apiBridge) { apiBridge.registerCustomHook(function(api) { api.apiFunctions.setHandleRequest('install', function(url, onSuccess, onFailure) { installer.install(url, onSuccess, onFailure); }); onInstallStageChanged = api.compiledApi.onInstallStageChanged; onDownloadProgress = api.compiledApi.onDownloadProgress; }); } else { var Event = require('event_bindings').Event; onInstallStageChanged = new Event(null, [{name: 'stage', type: 'string'}], {unmanaged: true}); onDownloadProgress = new Event(null, [{name: 'progress', type: 'number'}], {unmanaged: true}); var chromeWebstore = { install: function (url, onSuccess, onFailure) { installer.install(url, onSuccess, onFailure); }, onInstallStageChanged: onInstallStageChanged, onDownloadProgress: onDownloadProgress, }; exports.$set('binding', chromeWebstore); } // Called by webstore_bindings.cc. exports.$set('onInstallResponse', $Function.bind(Installer.prototype.onInstallResponse, installer)); exports.$set('onInstallStageChanged', $Function.bind(Installer.prototype.onInstallStageChanged, installer)); exports.$set('onDownloadProgress', $Function.bind(Installer.prototype.onDownloadProgress, installer)); // Copyright 2014 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'; (function() { var mojomId = 'chrome/common/media_router/mojo/media_controller.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('mediaRouter.mojom'); var media_status$ = mojo.internal.exposeNamespace('mediaRouter.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'chrome/common/media_router/mojo/media_status.mojom', 'media_status.mojom.js'); } var time$ = mojo.internal.exposeNamespace('mojoBase.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'mojo/public/mojom/base/time.mojom', '../../../../mojo/public/mojom/base/time.mojom.js'); } function MediaController_Play_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaController_Play_Params.prototype.initDefaults_ = function() { }; MediaController_Play_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaController_Play_Params.generate = function(generator_) { var generated = new MediaController_Play_Params; return generated; }; MediaController_Play_Params.prototype.mutate = function(mutator_) { return this; }; MediaController_Play_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaController_Play_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaController_Play_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaController_Play_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaController_Play_Params.encodedSize = codec.kStructHeaderSize + 0; MediaController_Play_Params.decode = function(decoder) { var packed; var val = new MediaController_Play_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MediaController_Play_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaController_Play_Params.encodedSize); encoder.writeUint32(0); }; function MediaController_Pause_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaController_Pause_Params.prototype.initDefaults_ = function() { }; MediaController_Pause_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaController_Pause_Params.generate = function(generator_) { var generated = new MediaController_Pause_Params; return generated; }; MediaController_Pause_Params.prototype.mutate = function(mutator_) { return this; }; MediaController_Pause_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaController_Pause_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaController_Pause_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaController_Pause_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaController_Pause_Params.encodedSize = codec.kStructHeaderSize + 0; MediaController_Pause_Params.decode = function(decoder) { var packed; var val = new MediaController_Pause_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MediaController_Pause_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaController_Pause_Params.encodedSize); encoder.writeUint32(0); }; function MediaController_SetMute_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaController_SetMute_Params.prototype.initDefaults_ = function() { this.mute = false; }; MediaController_SetMute_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaController_SetMute_Params.generate = function(generator_) { var generated = new MediaController_SetMute_Params; generated.mute = generator_.generateBool(); return generated; }; MediaController_SetMute_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mute = mutator_.mutateBool(this.mute); } return this; }; MediaController_SetMute_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaController_SetMute_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaController_SetMute_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaController_SetMute_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaController_SetMute_Params.encodedSize = codec.kStructHeaderSize + 8; MediaController_SetMute_Params.decode = function(decoder) { var packed; var val = new MediaController_SetMute_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.mute = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaController_SetMute_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaController_SetMute_Params.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.mute & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaController_SetVolume_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaController_SetVolume_Params.prototype.initDefaults_ = function() { this.volume = 0; }; MediaController_SetVolume_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaController_SetVolume_Params.generate = function(generator_) { var generated = new MediaController_SetVolume_Params; generated.volume = generator_.generateFloat(); return generated; }; MediaController_SetVolume_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.volume = mutator_.mutateFloat(this.volume); } return this; }; MediaController_SetVolume_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaController_SetVolume_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaController_SetVolume_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaController_SetVolume_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaController_SetVolume_Params.encodedSize = codec.kStructHeaderSize + 8; MediaController_SetVolume_Params.decode = function(decoder) { var packed; var val = new MediaController_SetVolume_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.volume = decoder.decodeStruct(codec.Float); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaController_SetVolume_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaController_SetVolume_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Float, val.volume); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaController_Seek_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaController_Seek_Params.prototype.initDefaults_ = function() { this.time = null; }; MediaController_Seek_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaController_Seek_Params.generate = function(generator_) { var generated = new MediaController_Seek_Params; generated.time = generator_.generateStruct(mojoBase.mojom.TimeDelta, false); return generated; }; MediaController_Seek_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.time = mutator_.mutateStruct(mojoBase.mojom.TimeDelta, false); } return this; }; MediaController_Seek_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaController_Seek_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaController_Seek_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaController_Seek_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaController_Seek_Params.time err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, time$.TimeDelta, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaController_Seek_Params.encodedSize = codec.kStructHeaderSize + 8; MediaController_Seek_Params.decode = function(decoder) { var packed; var val = new MediaController_Seek_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.time = decoder.decodeStructPointer(time$.TimeDelta); return val; }; MediaController_Seek_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaController_Seek_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(time$.TimeDelta, val.time); }; function MediaController_ConnectHangoutsMediaRouteController_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaController_ConnectHangoutsMediaRouteController_Params.prototype.initDefaults_ = function() { this.controllerRequest = new bindings.InterfaceRequest(); }; MediaController_ConnectHangoutsMediaRouteController_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaController_ConnectHangoutsMediaRouteController_Params.generate = function(generator_) { var generated = new MediaController_ConnectHangoutsMediaRouteController_Params; generated.controllerRequest = generator_.generateInterfaceRequest("mediaRouter.mojom.HangoutsMediaRouteController", false); return generated; }; MediaController_ConnectHangoutsMediaRouteController_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.controllerRequest = mutator_.mutateInterfaceRequest(this.controllerRequest, "mediaRouter.mojom.HangoutsMediaRouteController", false); } return this; }; MediaController_ConnectHangoutsMediaRouteController_Params.prototype.getHandleDeps = function() { var handles = []; if (this.controllerRequest !== null) { Array.prototype.push.apply(handles, ["mediaRouter.mojom.HangoutsMediaRouteControllerRequest"]); } return handles; }; MediaController_ConnectHangoutsMediaRouteController_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaController_ConnectHangoutsMediaRouteController_Params.prototype.setHandlesInternal_ = function(handles, idx) { this.controllerRequest = handles[idx++];; return idx; }; MediaController_ConnectHangoutsMediaRouteController_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaController_ConnectHangoutsMediaRouteController_Params.controllerRequest err = messageValidator.validateInterfaceRequest(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaController_ConnectHangoutsMediaRouteController_Params.encodedSize = codec.kStructHeaderSize + 8; MediaController_ConnectHangoutsMediaRouteController_Params.decode = function(decoder) { var packed; var val = new MediaController_ConnectHangoutsMediaRouteController_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.controllerRequest = decoder.decodeStruct(codec.InterfaceRequest); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaController_ConnectHangoutsMediaRouteController_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaController_ConnectHangoutsMediaRouteController_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.InterfaceRequest, val.controllerRequest); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function HangoutsMediaRouteController_SetLocalPresent_Params(values) { this.initDefaults_(); this.initFields_(values); } HangoutsMediaRouteController_SetLocalPresent_Params.prototype.initDefaults_ = function() { this.localPresent = false; }; HangoutsMediaRouteController_SetLocalPresent_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; HangoutsMediaRouteController_SetLocalPresent_Params.generate = function(generator_) { var generated = new HangoutsMediaRouteController_SetLocalPresent_Params; generated.localPresent = generator_.generateBool(); return generated; }; HangoutsMediaRouteController_SetLocalPresent_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.localPresent = mutator_.mutateBool(this.localPresent); } return this; }; HangoutsMediaRouteController_SetLocalPresent_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; HangoutsMediaRouteController_SetLocalPresent_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; HangoutsMediaRouteController_SetLocalPresent_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; HangoutsMediaRouteController_SetLocalPresent_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; HangoutsMediaRouteController_SetLocalPresent_Params.encodedSize = codec.kStructHeaderSize + 8; HangoutsMediaRouteController_SetLocalPresent_Params.decode = function(decoder) { var packed; var val = new HangoutsMediaRouteController_SetLocalPresent_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.localPresent = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; HangoutsMediaRouteController_SetLocalPresent_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(HangoutsMediaRouteController_SetLocalPresent_Params.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.localPresent & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; var kMediaController_Play_Name = 1672780310; var kMediaController_Pause_Name = 10036118; var kMediaController_SetMute_Name = 1515531509; var kMediaController_SetVolume_Name = 1943302738; var kMediaController_Seek_Name = 2121731849; var kMediaController_ConnectHangoutsMediaRouteController_Name = 652970310; function MediaControllerPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(MediaController, handleOrPtrInfo); } function MediaControllerAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( MediaController, associatedInterfacePtrInfo); } MediaControllerAssociatedPtr.prototype = Object.create(MediaControllerPtr.prototype); MediaControllerAssociatedPtr.prototype.constructor = MediaControllerAssociatedPtr; function MediaControllerProxy(receiver) { this.receiver_ = receiver; } MediaControllerPtr.prototype.play = function() { return MediaControllerProxy.prototype.play .apply(this.ptr.getProxy(), arguments); }; MediaControllerProxy.prototype.play = function() { var params_ = new MediaController_Play_Params(); var builder = new codec.MessageV0Builder( kMediaController_Play_Name, codec.align(MediaController_Play_Params.encodedSize)); builder.encodeStruct(MediaController_Play_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaControllerPtr.prototype.pause = function() { return MediaControllerProxy.prototype.pause .apply(this.ptr.getProxy(), arguments); }; MediaControllerProxy.prototype.pause = function() { var params_ = new MediaController_Pause_Params(); var builder = new codec.MessageV0Builder( kMediaController_Pause_Name, codec.align(MediaController_Pause_Params.encodedSize)); builder.encodeStruct(MediaController_Pause_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaControllerPtr.prototype.setMute = function() { return MediaControllerProxy.prototype.setMute .apply(this.ptr.getProxy(), arguments); }; MediaControllerProxy.prototype.setMute = function(mute) { var params_ = new MediaController_SetMute_Params(); params_.mute = mute; var builder = new codec.MessageV0Builder( kMediaController_SetMute_Name, codec.align(MediaController_SetMute_Params.encodedSize)); builder.encodeStruct(MediaController_SetMute_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaControllerPtr.prototype.setVolume = function() { return MediaControllerProxy.prototype.setVolume .apply(this.ptr.getProxy(), arguments); }; MediaControllerProxy.prototype.setVolume = function(volume) { var params_ = new MediaController_SetVolume_Params(); params_.volume = volume; var builder = new codec.MessageV0Builder( kMediaController_SetVolume_Name, codec.align(MediaController_SetVolume_Params.encodedSize)); builder.encodeStruct(MediaController_SetVolume_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaControllerPtr.prototype.seek = function() { return MediaControllerProxy.prototype.seek .apply(this.ptr.getProxy(), arguments); }; MediaControllerProxy.prototype.seek = function(time) { var params_ = new MediaController_Seek_Params(); params_.time = time; var builder = new codec.MessageV0Builder( kMediaController_Seek_Name, codec.align(MediaController_Seek_Params.encodedSize)); builder.encodeStruct(MediaController_Seek_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaControllerPtr.prototype.connectHangoutsMediaRouteController = function() { return MediaControllerProxy.prototype.connectHangoutsMediaRouteController .apply(this.ptr.getProxy(), arguments); }; MediaControllerProxy.prototype.connectHangoutsMediaRouteController = function(controllerRequest) { var params_ = new MediaController_ConnectHangoutsMediaRouteController_Params(); params_.controllerRequest = controllerRequest; var builder = new codec.MessageV0Builder( kMediaController_ConnectHangoutsMediaRouteController_Name, codec.align(MediaController_ConnectHangoutsMediaRouteController_Params.encodedSize)); builder.encodeStruct(MediaController_ConnectHangoutsMediaRouteController_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; function MediaControllerStub(delegate) { this.delegate_ = delegate; } MediaControllerStub.prototype.play = function() { return this.delegate_ && this.delegate_.play && this.delegate_.play(); } MediaControllerStub.prototype.pause = function() { return this.delegate_ && this.delegate_.pause && this.delegate_.pause(); } MediaControllerStub.prototype.setMute = function(mute) { return this.delegate_ && this.delegate_.setMute && this.delegate_.setMute(mute); } MediaControllerStub.prototype.setVolume = function(volume) { return this.delegate_ && this.delegate_.setVolume && this.delegate_.setVolume(volume); } MediaControllerStub.prototype.seek = function(time) { return this.delegate_ && this.delegate_.seek && this.delegate_.seek(time); } MediaControllerStub.prototype.connectHangoutsMediaRouteController = function(controllerRequest) { return this.delegate_ && this.delegate_.connectHangoutsMediaRouteController && this.delegate_.connectHangoutsMediaRouteController(controllerRequest); } MediaControllerStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMediaController_Play_Name: var params = reader.decodeStruct(MediaController_Play_Params); this.play(); return true; case kMediaController_Pause_Name: var params = reader.decodeStruct(MediaController_Pause_Params); this.pause(); return true; case kMediaController_SetMute_Name: var params = reader.decodeStruct(MediaController_SetMute_Params); this.setMute(params.mute); return true; case kMediaController_SetVolume_Name: var params = reader.decodeStruct(MediaController_SetVolume_Params); this.setVolume(params.volume); return true; case kMediaController_Seek_Name: var params = reader.decodeStruct(MediaController_Seek_Params); this.seek(params.time); return true; case kMediaController_ConnectHangoutsMediaRouteController_Name: var params = reader.decodeStruct(MediaController_ConnectHangoutsMediaRouteController_Params); this.connectHangoutsMediaRouteController(params.controllerRequest); return true; default: return false; } }; MediaControllerStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { default: return false; } }; function validateMediaControllerRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMediaController_Play_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaController_Play_Params; break; case kMediaController_Pause_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaController_Pause_Params; break; case kMediaController_SetMute_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaController_SetMute_Params; break; case kMediaController_SetVolume_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaController_SetVolume_Params; break; case kMediaController_Seek_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaController_Seek_Params; break; case kMediaController_ConnectHangoutsMediaRouteController_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaController_ConnectHangoutsMediaRouteController_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateMediaControllerResponse(messageValidator) { return validator.validationError.NONE; } var MediaController = { name: 'media_router.mojom.MediaController', kVersion: 0, ptrClass: MediaControllerPtr, proxyClass: MediaControllerProxy, stubClass: MediaControllerStub, validateRequest: validateMediaControllerRequest, validateResponse: null, mojomId: 'chrome/common/media_router/mojo/media_controller.mojom', fuzzMethods: { play: { params: MediaController_Play_Params, }, pause: { params: MediaController_Pause_Params, }, setMute: { params: MediaController_SetMute_Params, }, setVolume: { params: MediaController_SetVolume_Params, }, seek: { params: MediaController_Seek_Params, }, connectHangoutsMediaRouteController: { params: MediaController_ConnectHangoutsMediaRouteController_Params, }, }, }; MediaControllerStub.prototype.validator = validateMediaControllerRequest; MediaControllerProxy.prototype.validator = null; var kHangoutsMediaRouteController_SetLocalPresent_Name = 2076284069; function HangoutsMediaRouteControllerPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(HangoutsMediaRouteController, handleOrPtrInfo); } function HangoutsMediaRouteControllerAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( HangoutsMediaRouteController, associatedInterfacePtrInfo); } HangoutsMediaRouteControllerAssociatedPtr.prototype = Object.create(HangoutsMediaRouteControllerPtr.prototype); HangoutsMediaRouteControllerAssociatedPtr.prototype.constructor = HangoutsMediaRouteControllerAssociatedPtr; function HangoutsMediaRouteControllerProxy(receiver) { this.receiver_ = receiver; } HangoutsMediaRouteControllerPtr.prototype.setLocalPresent = function() { return HangoutsMediaRouteControllerProxy.prototype.setLocalPresent .apply(this.ptr.getProxy(), arguments); }; HangoutsMediaRouteControllerProxy.prototype.setLocalPresent = function(localPresent) { var params_ = new HangoutsMediaRouteController_SetLocalPresent_Params(); params_.localPresent = localPresent; var builder = new codec.MessageV0Builder( kHangoutsMediaRouteController_SetLocalPresent_Name, codec.align(HangoutsMediaRouteController_SetLocalPresent_Params.encodedSize)); builder.encodeStruct(HangoutsMediaRouteController_SetLocalPresent_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; function HangoutsMediaRouteControllerStub(delegate) { this.delegate_ = delegate; } HangoutsMediaRouteControllerStub.prototype.setLocalPresent = function(localPresent) { return this.delegate_ && this.delegate_.setLocalPresent && this.delegate_.setLocalPresent(localPresent); } HangoutsMediaRouteControllerStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kHangoutsMediaRouteController_SetLocalPresent_Name: var params = reader.decodeStruct(HangoutsMediaRouteController_SetLocalPresent_Params); this.setLocalPresent(params.localPresent); return true; default: return false; } }; HangoutsMediaRouteControllerStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { default: return false; } }; function validateHangoutsMediaRouteControllerRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kHangoutsMediaRouteController_SetLocalPresent_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = HangoutsMediaRouteController_SetLocalPresent_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateHangoutsMediaRouteControllerResponse(messageValidator) { return validator.validationError.NONE; } var HangoutsMediaRouteController = { name: 'media_router.mojom.HangoutsMediaRouteController', kVersion: 0, ptrClass: HangoutsMediaRouteControllerPtr, proxyClass: HangoutsMediaRouteControllerProxy, stubClass: HangoutsMediaRouteControllerStub, validateRequest: validateHangoutsMediaRouteControllerRequest, validateResponse: null, mojomId: 'chrome/common/media_router/mojo/media_controller.mojom', fuzzMethods: { setLocalPresent: { params: HangoutsMediaRouteController_SetLocalPresent_Params, }, }, }; HangoutsMediaRouteControllerStub.prototype.validator = validateHangoutsMediaRouteControllerRequest; HangoutsMediaRouteControllerProxy.prototype.validator = null; exports.MediaController = MediaController; exports.MediaControllerPtr = MediaControllerPtr; exports.MediaControllerAssociatedPtr = MediaControllerAssociatedPtr; exports.HangoutsMediaRouteController = HangoutsMediaRouteController; exports.HangoutsMediaRouteControllerPtr = HangoutsMediaRouteControllerPtr; exports.HangoutsMediaRouteControllerAssociatedPtr = HangoutsMediaRouteControllerAssociatedPtr; })();// Copyright 2014 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'; (function() { var mojomId = 'chrome/common/media_router/mojo/media_router.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('mediaRouter.mojom'); var media_controller$ = mojo.internal.exposeNamespace('mediaRouter.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'chrome/common/media_router/mojo/media_controller.mojom', 'media_controller.mojom.js'); } var media_status$ = mojo.internal.exposeNamespace('mediaRouter.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'chrome/common/media_router/mojo/media_status.mojom', 'media_status.mojom.js'); } var mirror_service_remoting$ = mojo.internal.exposeNamespace('media.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'media/mojo/interfaces/mirror_service_remoting.mojom', '../../../../media/mojo/interfaces/mirror_service_remoting.mojom.js'); } var time$ = mojo.internal.exposeNamespace('mojoBase.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'mojo/public/mojom/base/time.mojom', '../../../../mojo/public/mojom/base/time.mojom.js'); } var ip_address$ = mojo.internal.exposeNamespace('net.interfaces'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'net/interfaces/ip_address.mojom', '../../../../net/interfaces/ip_address.mojom.js'); } var ip_endpoint$ = mojo.internal.exposeNamespace('net.interfaces'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'net/interfaces/ip_endpoint.mojom', '../../../../net/interfaces/ip_endpoint.mojom.js'); } var origin$ = mojo.internal.exposeNamespace('url.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'url/mojom/origin.mojom', '../../../../url/mojom/origin.mojom.js'); } var url$ = mojo.internal.exposeNamespace('url.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'url/mojom/url.mojom', '../../../../url/mojom/url.mojom.js'); } var SinkIconType = {}; SinkIconType.CAST = 0; SinkIconType.CAST_AUDIO_GROUP = SinkIconType.CAST + 1; SinkIconType.CAST_AUDIO = SinkIconType.CAST_AUDIO_GROUP + 1; SinkIconType.MEETING = SinkIconType.CAST_AUDIO + 1; SinkIconType.HANGOUT = SinkIconType.MEETING + 1; SinkIconType.EDUCATION = SinkIconType.HANGOUT + 1; SinkIconType.WIRED_DISPLAY = SinkIconType.EDUCATION + 1; SinkIconType.GENERIC = SinkIconType.WIRED_DISPLAY + 1; SinkIconType.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: return true; } return false; }; SinkIconType.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; var RouteControllerType = {}; RouteControllerType.kNone = 0; RouteControllerType.kGeneric = RouteControllerType.kNone + 1; RouteControllerType.kHangouts = RouteControllerType.kGeneric + 1; RouteControllerType.kMirroring = RouteControllerType.kHangouts + 1; RouteControllerType.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: return true; } return false; }; RouteControllerType.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; var RouteRequestResultCode = {}; RouteRequestResultCode.UNKNOWN_ERROR = 0; RouteRequestResultCode.OK = RouteRequestResultCode.UNKNOWN_ERROR + 1; RouteRequestResultCode.TIMED_OUT = RouteRequestResultCode.OK + 1; RouteRequestResultCode.ROUTE_NOT_FOUND = RouteRequestResultCode.TIMED_OUT + 1; RouteRequestResultCode.SINK_NOT_FOUND = RouteRequestResultCode.ROUTE_NOT_FOUND + 1; RouteRequestResultCode.INVALID_ORIGIN = RouteRequestResultCode.SINK_NOT_FOUND + 1; RouteRequestResultCode.INCOGNITO_MISMATCH = RouteRequestResultCode.INVALID_ORIGIN + 1; RouteRequestResultCode.NO_SUPPORTED_PROVIDER = RouteRequestResultCode.INCOGNITO_MISMATCH + 1; RouteRequestResultCode.CANCELLED = RouteRequestResultCode.NO_SUPPORTED_PROVIDER + 1; RouteRequestResultCode.ROUTE_ALREADY_EXISTS = RouteRequestResultCode.CANCELLED + 1; RouteRequestResultCode.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: return true; } return false; }; RouteRequestResultCode.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; function MediaSink(values) { this.initDefaults_(); this.initFields_(values); } MediaSink.prototype.initDefaults_ = function() { this.sinkId = null; this.name = null; this.description = null; this.domain = null; this.iconType = 0; this.providerId = 0; this.extraData = null; }; MediaSink.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaSink.generate = function(generator_) { var generated = new MediaSink; generated.sinkId = generator_.generateString(false); generated.name = generator_.generateString(false); generated.description = generator_.generateString(true); generated.domain = generator_.generateString(true); generated.iconType = generator_.generateEnum(0, 7); generated.providerId = generator_.generateEnum(0, 3); generated.extraData = generator_.generateUnion(mediaRouter.mojom.MediaSinkExtraData, true); return generated; }; MediaSink.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.sinkId = mutator_.mutateString(this.sinkId, false); } if (mutator_.chooseMutateField()) { this.name = mutator_.mutateString(this.name, false); } if (mutator_.chooseMutateField()) { this.description = mutator_.mutateString(this.description, true); } if (mutator_.chooseMutateField()) { this.domain = mutator_.mutateString(this.domain, true); } if (mutator_.chooseMutateField()) { this.iconType = mutator_.mutateEnum(this.iconType, 0, 7); } if (mutator_.chooseMutateField()) { this.providerId = mutator_.mutateEnum(this.providerId, 0, 3); } if (mutator_.chooseMutateField()) { this.extraData = mutator_.mutateUnion(mediaRouter.mojom.MediaSinkExtraData, true); } return this; }; MediaSink.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaSink.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaSink.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaSink.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 64} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaSink.sinkId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaSink.name err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaSink.description err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, true) if (err !== validator.validationError.NONE) return err; // validate MediaSink.domain err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, true) if (err !== validator.validationError.NONE) return err; // validate MediaSink.iconType err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 32, SinkIconType); if (err !== validator.validationError.NONE) return err; // validate MediaSink.providerId err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 36, MediaRouteProvider.Id); if (err !== validator.validationError.NONE) return err; // validate MediaSink.extraData err = messageValidator.validateUnion(offset + codec.kStructHeaderSize + 40, MediaSinkExtraData, true); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaSink.encodedSize = codec.kStructHeaderSize + 56; MediaSink.decode = function(decoder) { var packed; var val = new MediaSink(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.sinkId = decoder.decodeStruct(codec.String); val.name = decoder.decodeStruct(codec.String); val.description = decoder.decodeStruct(codec.NullableString); val.domain = decoder.decodeStruct(codec.NullableString); val.iconType = decoder.decodeStruct(codec.Int32); val.providerId = decoder.decodeStruct(codec.Int32); val.extraData = decoder.decodeStruct(MediaSinkExtraData); return val; }; MediaSink.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaSink.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.sinkId); encoder.encodeStruct(codec.String, val.name); encoder.encodeStruct(codec.NullableString, val.description); encoder.encodeStruct(codec.NullableString, val.domain); encoder.encodeStruct(codec.Int32, val.iconType); encoder.encodeStruct(codec.Int32, val.providerId); encoder.encodeStruct(MediaSinkExtraData, val.extraData); }; function DialMediaSink(values) { this.initDefaults_(); this.initFields_(values); } DialMediaSink.prototype.initDefaults_ = function() { this.ipAddress = null; this.modelName = null; this.appUrl = null; }; DialMediaSink.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; DialMediaSink.generate = function(generator_) { var generated = new DialMediaSink; generated.ipAddress = generator_.generateStruct(net.interfaces.IPAddress, false); generated.modelName = generator_.generateString(false); generated.appUrl = generator_.generateStruct(url.mojom.Url, false); return generated; }; DialMediaSink.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.ipAddress = mutator_.mutateStruct(net.interfaces.IPAddress, false); } if (mutator_.chooseMutateField()) { this.modelName = mutator_.mutateString(this.modelName, false); } if (mutator_.chooseMutateField()) { this.appUrl = mutator_.mutateStruct(url.mojom.Url, false); } return this; }; DialMediaSink.prototype.getHandleDeps = function() { var handles = []; return handles; }; DialMediaSink.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; DialMediaSink.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; DialMediaSink.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate DialMediaSink.ipAddress err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, ip_address$.IPAddress, false); if (err !== validator.validationError.NONE) return err; // validate DialMediaSink.modelName err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate DialMediaSink.appUrl err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, url$.Url, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; DialMediaSink.encodedSize = codec.kStructHeaderSize + 24; DialMediaSink.decode = function(decoder) { var packed; var val = new DialMediaSink(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.ipAddress = decoder.decodeStructPointer(ip_address$.IPAddress); val.modelName = decoder.decodeStruct(codec.String); val.appUrl = decoder.decodeStructPointer(url$.Url); return val; }; DialMediaSink.encode = function(encoder, val) { var packed; encoder.writeUint32(DialMediaSink.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(ip_address$.IPAddress, val.ipAddress); encoder.encodeStruct(codec.String, val.modelName); encoder.encodeStructPointer(url$.Url, val.appUrl); }; function CastMediaSink(values) { this.initDefaults_(); this.initFields_(values); } CastMediaSink.prototype.initDefaults_ = function() { this.ipEndpoint = null; this.modelName = null; this.capabilities = 0; this.castChannelId = 0; }; CastMediaSink.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; CastMediaSink.generate = function(generator_) { var generated = new CastMediaSink; generated.ipEndpoint = generator_.generateStruct(net.interfaces.IPEndPoint, false); generated.modelName = generator_.generateString(false); generated.capabilities = generator_.generateUint8(); generated.castChannelId = generator_.generateInt32(); return generated; }; CastMediaSink.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.ipEndpoint = mutator_.mutateStruct(net.interfaces.IPEndPoint, false); } if (mutator_.chooseMutateField()) { this.modelName = mutator_.mutateString(this.modelName, false); } if (mutator_.chooseMutateField()) { this.capabilities = mutator_.mutateUint8(this.capabilities); } if (mutator_.chooseMutateField()) { this.castChannelId = mutator_.mutateInt32(this.castChannelId); } return this; }; CastMediaSink.prototype.getHandleDeps = function() { var handles = []; return handles; }; CastMediaSink.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; CastMediaSink.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; CastMediaSink.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate CastMediaSink.ipEndpoint err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, ip_endpoint$.IPEndPoint, false); if (err !== validator.validationError.NONE) return err; // validate CastMediaSink.modelName err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; CastMediaSink.encodedSize = codec.kStructHeaderSize + 24; CastMediaSink.decode = function(decoder) { var packed; var val = new CastMediaSink(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.ipEndpoint = decoder.decodeStructPointer(ip_endpoint$.IPEndPoint); val.modelName = decoder.decodeStruct(codec.String); val.capabilities = decoder.decodeStruct(codec.Uint8); decoder.skip(1); decoder.skip(1); decoder.skip(1); val.castChannelId = decoder.decodeStruct(codec.Int32); return val; }; CastMediaSink.encode = function(encoder, val) { var packed; encoder.writeUint32(CastMediaSink.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(ip_endpoint$.IPEndPoint, val.ipEndpoint); encoder.encodeStruct(codec.String, val.modelName); encoder.encodeStruct(codec.Uint8, val.capabilities); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.Int32, val.castChannelId); }; function MediaRoute(values) { this.initDefaults_(); this.initFields_(values); } MediaRoute.prototype.initDefaults_ = function() { this.mediaRouteId = null; this.presentationId = null; this.mediaSource = null; this.mediaSinkId = null; this.description = null; this.isLocal = false; this.forDisplay = false; this.isIncognito = false; this.isLocalPresentation = false; this.controllerType = 0; }; MediaRoute.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRoute.generate = function(generator_) { var generated = new MediaRoute; generated.mediaRouteId = generator_.generateString(false); generated.presentationId = generator_.generateString(false); generated.mediaSource = generator_.generateString(true); generated.mediaSinkId = generator_.generateString(false); generated.description = generator_.generateString(false); generated.isLocal = generator_.generateBool(); generated.controllerType = generator_.generateEnum(0, 3); generated.forDisplay = generator_.generateBool(); generated.isIncognito = generator_.generateBool(); generated.isLocalPresentation = generator_.generateBool(); return generated; }; MediaRoute.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaRouteId = mutator_.mutateString(this.mediaRouteId, false); } if (mutator_.chooseMutateField()) { this.presentationId = mutator_.mutateString(this.presentationId, false); } if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, true); } if (mutator_.chooseMutateField()) { this.mediaSinkId = mutator_.mutateString(this.mediaSinkId, false); } if (mutator_.chooseMutateField()) { this.description = mutator_.mutateString(this.description, false); } if (mutator_.chooseMutateField()) { this.isLocal = mutator_.mutateBool(this.isLocal); } if (mutator_.chooseMutateField()) { this.controllerType = mutator_.mutateEnum(this.controllerType, 0, 3); } if (mutator_.chooseMutateField()) { this.forDisplay = mutator_.mutateBool(this.forDisplay); } if (mutator_.chooseMutateField()) { this.isIncognito = mutator_.mutateBool(this.isIncognito); } if (mutator_.chooseMutateField()) { this.isLocalPresentation = mutator_.mutateBool(this.isLocalPresentation); } return this; }; MediaRoute.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRoute.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRoute.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRoute.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 56} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRoute.mediaRouteId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRoute.presentationId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRoute.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, true) if (err !== validator.validationError.NONE) return err; // validate MediaRoute.mediaSinkId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, false) if (err !== validator.validationError.NONE) return err; // validate MediaRoute.description err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 32, false) if (err !== validator.validationError.NONE) return err; // validate MediaRoute.controllerType err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 44, RouteControllerType); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRoute.encodedSize = codec.kStructHeaderSize + 48; MediaRoute.decode = function(decoder) { var packed; var val = new MediaRoute(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaRouteId = decoder.decodeStruct(codec.String); val.presentationId = decoder.decodeStruct(codec.String); val.mediaSource = decoder.decodeStruct(codec.NullableString); val.mediaSinkId = decoder.decodeStruct(codec.String); val.description = decoder.decodeStruct(codec.String); packed = decoder.readUint8(); val.isLocal = (packed >> 0) & 1 ? true : false; val.forDisplay = (packed >> 1) & 1 ? true : false; val.isIncognito = (packed >> 2) & 1 ? true : false; val.isLocalPresentation = (packed >> 3) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); val.controllerType = decoder.decodeStruct(codec.Int32); return val; }; MediaRoute.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRoute.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaRouteId); encoder.encodeStruct(codec.String, val.presentationId); encoder.encodeStruct(codec.NullableString, val.mediaSource); encoder.encodeStruct(codec.String, val.mediaSinkId); encoder.encodeStruct(codec.String, val.description); packed = 0; packed |= (val.isLocal & 1) << 0 packed |= (val.forDisplay & 1) << 1 packed |= (val.isIncognito & 1) << 2 packed |= (val.isLocalPresentation & 1) << 3 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.Int32, val.controllerType); }; function Issue(values) { this.initDefaults_(); this.initFields_(values); } Issue.Severity = {}; Issue.Severity.FATAL = 0; Issue.Severity.WARNING = Issue.Severity.FATAL + 1; Issue.Severity.NOTIFICATION = Issue.Severity.WARNING + 1; Issue.Severity.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: return true; } return false; }; Issue.Severity.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; Issue.ActionType = {}; Issue.ActionType.DISMISS = 0; Issue.ActionType.LEARN_MORE = Issue.ActionType.DISMISS + 1; Issue.ActionType.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: return true; } return false; }; Issue.ActionType.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; Issue.prototype.initDefaults_ = function() { this.routeId = null; this.severity = 0; this.isBlocking = false; this.title = null; this.message = null; this.defaultAction = 0; this.helpPageId = 0; this.secondaryActions = null; }; Issue.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; Issue.generate = function(generator_) { var generated = new Issue; generated.routeId = generator_.generateString(true); generated.severity = generator_.generateEnum(0, 2); generated.isBlocking = generator_.generateBool(); generated.title = generator_.generateString(false); generated.message = generator_.generateString(true); generated.defaultAction = generator_.generateEnum(0, 1); generated.secondaryActions = generator_.generateArray(function() { return generator_.generateEnum(0, 1); }); generated.helpPageId = generator_.generateInt32(); return generated; }; Issue.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, true); } if (mutator_.chooseMutateField()) { this.severity = mutator_.mutateEnum(this.severity, 0, 2); } if (mutator_.chooseMutateField()) { this.isBlocking = mutator_.mutateBool(this.isBlocking); } if (mutator_.chooseMutateField()) { this.title = mutator_.mutateString(this.title, false); } if (mutator_.chooseMutateField()) { this.message = mutator_.mutateString(this.message, true); } if (mutator_.chooseMutateField()) { this.defaultAction = mutator_.mutateEnum(this.defaultAction, 0, 1); } if (mutator_.chooseMutateField()) { this.secondaryActions = mutator_.mutateArray(this.secondaryActions, function(val) { return mutator_.mutateEnum(val, 0, 1); }); } if (mutator_.chooseMutateField()) { this.helpPageId = mutator_.mutateInt32(this.helpPageId); } return this; }; Issue.prototype.getHandleDeps = function() { var handles = []; return handles; }; Issue.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; Issue.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; Issue.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 56} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate Issue.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, true) if (err !== validator.validationError.NONE) return err; // validate Issue.severity err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, Issue.Severity); if (err !== validator.validationError.NONE) return err; // validate Issue.title err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) if (err !== validator.validationError.NONE) return err; // validate Issue.message err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, true) if (err !== validator.validationError.NONE) return err; // validate Issue.defaultAction err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 32, Issue.ActionType); if (err !== validator.validationError.NONE) return err; // validate Issue.secondaryActions err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 40, 4, new codec.Enum(Issue.ActionType), false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; Issue.encodedSize = codec.kStructHeaderSize + 48; Issue.decode = function(decoder) { var packed; var val = new Issue(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.NullableString); val.severity = decoder.decodeStruct(codec.Int32); packed = decoder.readUint8(); val.isBlocking = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); val.title = decoder.decodeStruct(codec.String); val.message = decoder.decodeStruct(codec.NullableString); val.defaultAction = decoder.decodeStruct(codec.Int32); val.helpPageId = decoder.decodeStruct(codec.Int32); val.secondaryActions = decoder.decodeArrayPointer(new codec.Enum(Issue.ActionType)); return val; }; Issue.encode = function(encoder, val) { var packed; encoder.writeUint32(Issue.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.NullableString, val.routeId); encoder.encodeStruct(codec.Int32, val.severity); packed = 0; packed |= (val.isBlocking & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.String, val.title); encoder.encodeStruct(codec.NullableString, val.message); encoder.encodeStruct(codec.Int32, val.defaultAction); encoder.encodeStruct(codec.Int32, val.helpPageId); encoder.encodeArrayPointer(new codec.Enum(Issue.ActionType), val.secondaryActions); }; function RouteMessage(values) { this.initDefaults_(); this.initFields_(values); } RouteMessage.Type = {}; RouteMessage.Type.TEXT = 0; RouteMessage.Type.BINARY = RouteMessage.Type.TEXT + 1; RouteMessage.Type.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: return true; } return false; }; RouteMessage.Type.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; RouteMessage.prototype.initDefaults_ = function() { this.type = 0; this.message = null; this.data = null; }; RouteMessage.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; RouteMessage.generate = function(generator_) { var generated = new RouteMessage; generated.type = generator_.generateEnum(0, 1); generated.message = generator_.generateString(true); generated.data = generator_.generateArray(function() { return generator_.generateUint8(); }); return generated; }; RouteMessage.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.type = mutator_.mutateEnum(this.type, 0, 1); } if (mutator_.chooseMutateField()) { this.message = mutator_.mutateString(this.message, true); } if (mutator_.chooseMutateField()) { this.data = mutator_.mutateArray(this.data, function(val) { return mutator_.mutateUint8(val); }); } return this; }; RouteMessage.prototype.getHandleDeps = function() { var handles = []; return handles; }; RouteMessage.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; RouteMessage.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; RouteMessage.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate RouteMessage.type err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, RouteMessage.Type); if (err !== validator.validationError.NONE) return err; // validate RouteMessage.message err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, true) if (err !== validator.validationError.NONE) return err; // validate RouteMessage.data err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 1, codec.Uint8, true, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; RouteMessage.encodedSize = codec.kStructHeaderSize + 24; RouteMessage.decode = function(decoder) { var packed; var val = new RouteMessage(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.type = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); val.message = decoder.decodeStruct(codec.NullableString); val.data = decoder.decodeArrayPointer(codec.Uint8); return val; }; RouteMessage.encode = function(encoder, val) { var packed; encoder.writeUint32(RouteMessage.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.type); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.NullableString, val.message); encoder.encodeArrayPointer(codec.Uint8, val.data); }; function SinkSearchCriteria(values) { this.initDefaults_(); this.initFields_(values); } SinkSearchCriteria.prototype.initDefaults_ = function() { this.input = null; this.domain = null; }; SinkSearchCriteria.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; SinkSearchCriteria.generate = function(generator_) { var generated = new SinkSearchCriteria; generated.input = generator_.generateString(false); generated.domain = generator_.generateString(false); return generated; }; SinkSearchCriteria.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.input = mutator_.mutateString(this.input, false); } if (mutator_.chooseMutateField()) { this.domain = mutator_.mutateString(this.domain, false); } return this; }; SinkSearchCriteria.prototype.getHandleDeps = function() { var handles = []; return handles; }; SinkSearchCriteria.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; SinkSearchCriteria.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; SinkSearchCriteria.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate SinkSearchCriteria.input err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate SinkSearchCriteria.domain err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; SinkSearchCriteria.encodedSize = codec.kStructHeaderSize + 16; SinkSearchCriteria.decode = function(decoder) { var packed; var val = new SinkSearchCriteria(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.input = decoder.decodeStruct(codec.String); val.domain = decoder.decodeStruct(codec.String); return val; }; SinkSearchCriteria.encode = function(encoder, val) { var packed; encoder.writeUint32(SinkSearchCriteria.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.input); encoder.encodeStruct(codec.String, val.domain); }; function MediaRouteProviderConfig(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProviderConfig.prototype.initDefaults_ = function() { this.enableDialDiscovery = false; this.enableCastDiscovery = false; this.enableDialSinkQuery = false; this.enableCastSinkQuery = false; }; MediaRouteProviderConfig.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProviderConfig.generate = function(generator_) { var generated = new MediaRouteProviderConfig; generated.enableDialDiscovery = generator_.generateBool(); generated.enableCastDiscovery = generator_.generateBool(); generated.enableDialSinkQuery = generator_.generateBool(); generated.enableCastSinkQuery = generator_.generateBool(); return generated; }; MediaRouteProviderConfig.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.enableDialDiscovery = mutator_.mutateBool(this.enableDialDiscovery); } if (mutator_.chooseMutateField()) { this.enableCastDiscovery = mutator_.mutateBool(this.enableCastDiscovery); } if (mutator_.chooseMutateField()) { this.enableDialSinkQuery = mutator_.mutateBool(this.enableDialSinkQuery); } if (mutator_.chooseMutateField()) { this.enableCastSinkQuery = mutator_.mutateBool(this.enableCastSinkQuery); } return this; }; MediaRouteProviderConfig.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProviderConfig.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProviderConfig.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProviderConfig.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProviderConfig.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProviderConfig.decode = function(decoder) { var packed; var val = new MediaRouteProviderConfig(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.enableDialDiscovery = (packed >> 0) & 1 ? true : false; val.enableCastDiscovery = (packed >> 1) & 1 ? true : false; val.enableDialSinkQuery = (packed >> 2) & 1 ? true : false; val.enableCastSinkQuery = (packed >> 3) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProviderConfig.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProviderConfig.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.enableDialDiscovery & 1) << 0 packed |= (val.enableCastDiscovery & 1) << 1 packed |= (val.enableDialSinkQuery & 1) << 2 packed |= (val.enableCastSinkQuery & 1) << 3 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_CreateRoute_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_CreateRoute_Params.prototype.initDefaults_ = function() { this.mediaSource = null; this.sinkId = null; this.originalPresentationId = null; this.origin = null; this.tabId = 0; this.incognito = false; this.timeout = null; }; MediaRouteProvider_CreateRoute_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_CreateRoute_Params.generate = function(generator_) { var generated = new MediaRouteProvider_CreateRoute_Params; generated.mediaSource = generator_.generateString(false); generated.sinkId = generator_.generateString(false); generated.originalPresentationId = generator_.generateString(false); generated.origin = generator_.generateStruct(url.mojom.Origin, false); generated.tabId = generator_.generateInt32(); generated.timeout = generator_.generateStruct(mojoBase.mojom.TimeDelta, false); generated.incognito = generator_.generateBool(); return generated; }; MediaRouteProvider_CreateRoute_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } if (mutator_.chooseMutateField()) { this.sinkId = mutator_.mutateString(this.sinkId, false); } if (mutator_.chooseMutateField()) { this.originalPresentationId = mutator_.mutateString(this.originalPresentationId, false); } if (mutator_.chooseMutateField()) { this.origin = mutator_.mutateStruct(url.mojom.Origin, false); } if (mutator_.chooseMutateField()) { this.tabId = mutator_.mutateInt32(this.tabId); } if (mutator_.chooseMutateField()) { this.timeout = mutator_.mutateStruct(mojoBase.mojom.TimeDelta, false); } if (mutator_.chooseMutateField()) { this.incognito = mutator_.mutateBool(this.incognito); } return this; }; MediaRouteProvider_CreateRoute_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_CreateRoute_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_CreateRoute_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_CreateRoute_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 56} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_Params.sinkId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_Params.originalPresentationId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_Params.origin err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, origin$.Origin, false); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_Params.timeout err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, time$.TimeDelta, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_CreateRoute_Params.encodedSize = codec.kStructHeaderSize + 48; MediaRouteProvider_CreateRoute_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_CreateRoute_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); val.sinkId = decoder.decodeStruct(codec.String); val.originalPresentationId = decoder.decodeStruct(codec.String); val.origin = decoder.decodeStructPointer(origin$.Origin); val.tabId = decoder.decodeStruct(codec.Int32); packed = decoder.readUint8(); val.incognito = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); val.timeout = decoder.decodeStructPointer(time$.TimeDelta); return val; }; MediaRouteProvider_CreateRoute_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_CreateRoute_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); encoder.encodeStruct(codec.String, val.sinkId); encoder.encodeStruct(codec.String, val.originalPresentationId); encoder.encodeStructPointer(origin$.Origin, val.origin); encoder.encodeStruct(codec.Int32, val.tabId); packed = 0; packed |= (val.incognito & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStructPointer(time$.TimeDelta, val.timeout); }; function MediaRouteProvider_CreateRoute_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_CreateRoute_ResponseParams.prototype.initDefaults_ = function() { this.route = null; this.errorText = null; this.resultCode = 0; }; MediaRouteProvider_CreateRoute_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_CreateRoute_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_CreateRoute_ResponseParams; generated.route = generator_.generateStruct(mediaRouter.mojom.MediaRoute, true); generated.errorText = generator_.generateString(true); generated.resultCode = generator_.generateEnum(0, 9); return generated; }; MediaRouteProvider_CreateRoute_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.route = mutator_.mutateStruct(mediaRouter.mojom.MediaRoute, true); } if (mutator_.chooseMutateField()) { this.errorText = mutator_.mutateString(this.errorText, true); } if (mutator_.chooseMutateField()) { this.resultCode = mutator_.mutateEnum(this.resultCode, 0, 9); } return this; }; MediaRouteProvider_CreateRoute_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_CreateRoute_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_CreateRoute_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_CreateRoute_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_ResponseParams.route err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, MediaRoute, true); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_ResponseParams.errorText err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, true) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateRoute_ResponseParams.resultCode err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 16, RouteRequestResultCode); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_CreateRoute_ResponseParams.encodedSize = codec.kStructHeaderSize + 24; MediaRouteProvider_CreateRoute_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_CreateRoute_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.route = decoder.decodeStructPointer(MediaRoute); val.errorText = decoder.decodeStruct(codec.NullableString); val.resultCode = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_CreateRoute_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_CreateRoute_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(MediaRoute, val.route); encoder.encodeStruct(codec.NullableString, val.errorText); encoder.encodeStruct(codec.Int32, val.resultCode); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_JoinRoute_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_JoinRoute_Params.prototype.initDefaults_ = function() { this.mediaSource = null; this.presentationId = null; this.origin = null; this.tabId = 0; this.incognito = false; this.timeout = null; }; MediaRouteProvider_JoinRoute_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_JoinRoute_Params.generate = function(generator_) { var generated = new MediaRouteProvider_JoinRoute_Params; generated.mediaSource = generator_.generateString(false); generated.presentationId = generator_.generateString(false); generated.origin = generator_.generateStruct(url.mojom.Origin, false); generated.tabId = generator_.generateInt32(); generated.timeout = generator_.generateStruct(mojoBase.mojom.TimeDelta, false); generated.incognito = generator_.generateBool(); return generated; }; MediaRouteProvider_JoinRoute_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } if (mutator_.chooseMutateField()) { this.presentationId = mutator_.mutateString(this.presentationId, false); } if (mutator_.chooseMutateField()) { this.origin = mutator_.mutateStruct(url.mojom.Origin, false); } if (mutator_.chooseMutateField()) { this.tabId = mutator_.mutateInt32(this.tabId); } if (mutator_.chooseMutateField()) { this.timeout = mutator_.mutateStruct(mojoBase.mojom.TimeDelta, false); } if (mutator_.chooseMutateField()) { this.incognito = mutator_.mutateBool(this.incognito); } return this; }; MediaRouteProvider_JoinRoute_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_JoinRoute_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_JoinRoute_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_JoinRoute_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 48} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_Params.presentationId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_Params.origin err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, origin$.Origin, false); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_Params.timeout err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, time$.TimeDelta, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_JoinRoute_Params.encodedSize = codec.kStructHeaderSize + 40; MediaRouteProvider_JoinRoute_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_JoinRoute_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); val.presentationId = decoder.decodeStruct(codec.String); val.origin = decoder.decodeStructPointer(origin$.Origin); val.tabId = decoder.decodeStruct(codec.Int32); packed = decoder.readUint8(); val.incognito = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); val.timeout = decoder.decodeStructPointer(time$.TimeDelta); return val; }; MediaRouteProvider_JoinRoute_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_JoinRoute_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); encoder.encodeStruct(codec.String, val.presentationId); encoder.encodeStructPointer(origin$.Origin, val.origin); encoder.encodeStruct(codec.Int32, val.tabId); packed = 0; packed |= (val.incognito & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStructPointer(time$.TimeDelta, val.timeout); }; function MediaRouteProvider_JoinRoute_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_JoinRoute_ResponseParams.prototype.initDefaults_ = function() { this.route = null; this.errorText = null; this.resultCode = 0; }; MediaRouteProvider_JoinRoute_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_JoinRoute_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_JoinRoute_ResponseParams; generated.route = generator_.generateStruct(mediaRouter.mojom.MediaRoute, true); generated.errorText = generator_.generateString(true); generated.resultCode = generator_.generateEnum(0, 9); return generated; }; MediaRouteProvider_JoinRoute_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.route = mutator_.mutateStruct(mediaRouter.mojom.MediaRoute, true); } if (mutator_.chooseMutateField()) { this.errorText = mutator_.mutateString(this.errorText, true); } if (mutator_.chooseMutateField()) { this.resultCode = mutator_.mutateEnum(this.resultCode, 0, 9); } return this; }; MediaRouteProvider_JoinRoute_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_JoinRoute_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_JoinRoute_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_JoinRoute_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_ResponseParams.route err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, MediaRoute, true); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_ResponseParams.errorText err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, true) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_JoinRoute_ResponseParams.resultCode err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 16, RouteRequestResultCode); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_JoinRoute_ResponseParams.encodedSize = codec.kStructHeaderSize + 24; MediaRouteProvider_JoinRoute_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_JoinRoute_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.route = decoder.decodeStructPointer(MediaRoute); val.errorText = decoder.decodeStruct(codec.NullableString); val.resultCode = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_JoinRoute_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_JoinRoute_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(MediaRoute, val.route); encoder.encodeStruct(codec.NullableString, val.errorText); encoder.encodeStruct(codec.Int32, val.resultCode); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_ConnectRouteByRouteId_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_ConnectRouteByRouteId_Params.prototype.initDefaults_ = function() { this.mediaSource = null; this.routeId = null; this.presentationId = null; this.origin = null; this.tabId = 0; this.incognito = false; this.timeout = null; }; MediaRouteProvider_ConnectRouteByRouteId_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_ConnectRouteByRouteId_Params.generate = function(generator_) { var generated = new MediaRouteProvider_ConnectRouteByRouteId_Params; generated.mediaSource = generator_.generateString(false); generated.routeId = generator_.generateString(false); generated.presentationId = generator_.generateString(false); generated.origin = generator_.generateStruct(url.mojom.Origin, false); generated.tabId = generator_.generateInt32(); generated.timeout = generator_.generateStruct(mojoBase.mojom.TimeDelta, false); generated.incognito = generator_.generateBool(); return generated; }; MediaRouteProvider_ConnectRouteByRouteId_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } if (mutator_.chooseMutateField()) { this.presentationId = mutator_.mutateString(this.presentationId, false); } if (mutator_.chooseMutateField()) { this.origin = mutator_.mutateStruct(url.mojom.Origin, false); } if (mutator_.chooseMutateField()) { this.tabId = mutator_.mutateInt32(this.tabId); } if (mutator_.chooseMutateField()) { this.timeout = mutator_.mutateStruct(mojoBase.mojom.TimeDelta, false); } if (mutator_.chooseMutateField()) { this.incognito = mutator_.mutateBool(this.incognito); } return this; }; MediaRouteProvider_ConnectRouteByRouteId_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_ConnectRouteByRouteId_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_ConnectRouteByRouteId_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_ConnectRouteByRouteId_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 56} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_Params.presentationId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_Params.origin err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, origin$.Origin, false); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_Params.timeout err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, time$.TimeDelta, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_ConnectRouteByRouteId_Params.encodedSize = codec.kStructHeaderSize + 48; MediaRouteProvider_ConnectRouteByRouteId_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_ConnectRouteByRouteId_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); val.routeId = decoder.decodeStruct(codec.String); val.presentationId = decoder.decodeStruct(codec.String); val.origin = decoder.decodeStructPointer(origin$.Origin); val.tabId = decoder.decodeStruct(codec.Int32); packed = decoder.readUint8(); val.incognito = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); val.timeout = decoder.decodeStructPointer(time$.TimeDelta); return val; }; MediaRouteProvider_ConnectRouteByRouteId_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_ConnectRouteByRouteId_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); encoder.encodeStruct(codec.String, val.routeId); encoder.encodeStruct(codec.String, val.presentationId); encoder.encodeStructPointer(origin$.Origin, val.origin); encoder.encodeStruct(codec.Int32, val.tabId); packed = 0; packed |= (val.incognito & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStructPointer(time$.TimeDelta, val.timeout); }; function MediaRouteProvider_ConnectRouteByRouteId_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.prototype.initDefaults_ = function() { this.route = null; this.errorText = null; this.resultCode = 0; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_ConnectRouteByRouteId_ResponseParams; generated.route = generator_.generateStruct(mediaRouter.mojom.MediaRoute, true); generated.errorText = generator_.generateString(true); generated.resultCode = generator_.generateEnum(0, 9); return generated; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.route = mutator_.mutateStruct(mediaRouter.mojom.MediaRoute, true); } if (mutator_.chooseMutateField()) { this.errorText = mutator_.mutateString(this.errorText, true); } if (mutator_.chooseMutateField()) { this.resultCode = mutator_.mutateEnum(this.resultCode, 0, 9); } return this; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.route err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, MediaRoute, true); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.errorText err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, true) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.resultCode err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 16, RouteRequestResultCode); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.encodedSize = codec.kStructHeaderSize + 24; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_ConnectRouteByRouteId_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.route = decoder.decodeStructPointer(MediaRoute); val.errorText = decoder.decodeStruct(codec.NullableString); val.resultCode = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(MediaRoute, val.route); encoder.encodeStruct(codec.NullableString, val.errorText); encoder.encodeStruct(codec.Int32, val.resultCode); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_TerminateRoute_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_TerminateRoute_Params.prototype.initDefaults_ = function() { this.routeId = null; }; MediaRouteProvider_TerminateRoute_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_TerminateRoute_Params.generate = function(generator_) { var generated = new MediaRouteProvider_TerminateRoute_Params; generated.routeId = generator_.generateString(false); return generated; }; MediaRouteProvider_TerminateRoute_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } return this; }; MediaRouteProvider_TerminateRoute_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_TerminateRoute_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_TerminateRoute_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_TerminateRoute_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_TerminateRoute_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_TerminateRoute_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_TerminateRoute_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_TerminateRoute_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_TerminateRoute_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_TerminateRoute_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); }; function MediaRouteProvider_TerminateRoute_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_TerminateRoute_ResponseParams.prototype.initDefaults_ = function() { this.errorText = null; this.resultCode = 0; }; MediaRouteProvider_TerminateRoute_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_TerminateRoute_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_TerminateRoute_ResponseParams; generated.errorText = generator_.generateString(true); generated.resultCode = generator_.generateEnum(0, 9); return generated; }; MediaRouteProvider_TerminateRoute_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.errorText = mutator_.mutateString(this.errorText, true); } if (mutator_.chooseMutateField()) { this.resultCode = mutator_.mutateEnum(this.resultCode, 0, 9); } return this; }; MediaRouteProvider_TerminateRoute_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_TerminateRoute_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_TerminateRoute_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_TerminateRoute_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_TerminateRoute_ResponseParams.errorText err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, true) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_TerminateRoute_ResponseParams.resultCode err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, RouteRequestResultCode); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_TerminateRoute_ResponseParams.encodedSize = codec.kStructHeaderSize + 16; MediaRouteProvider_TerminateRoute_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_TerminateRoute_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.errorText = decoder.decodeStruct(codec.NullableString); val.resultCode = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_TerminateRoute_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_TerminateRoute_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.NullableString, val.errorText); encoder.encodeStruct(codec.Int32, val.resultCode); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_SendRouteMessage_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_SendRouteMessage_Params.prototype.initDefaults_ = function() { this.mediaRouteId = null; this.message = null; }; MediaRouteProvider_SendRouteMessage_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_SendRouteMessage_Params.generate = function(generator_) { var generated = new MediaRouteProvider_SendRouteMessage_Params; generated.mediaRouteId = generator_.generateString(false); generated.message = generator_.generateString(false); return generated; }; MediaRouteProvider_SendRouteMessage_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaRouteId = mutator_.mutateString(this.mediaRouteId, false); } if (mutator_.chooseMutateField()) { this.message = mutator_.mutateString(this.message, false); } return this; }; MediaRouteProvider_SendRouteMessage_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_SendRouteMessage_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_SendRouteMessage_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_SendRouteMessage_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SendRouteMessage_Params.mediaRouteId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SendRouteMessage_Params.message err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_SendRouteMessage_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouteProvider_SendRouteMessage_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_SendRouteMessage_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaRouteId = decoder.decodeStruct(codec.String); val.message = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_SendRouteMessage_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_SendRouteMessage_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaRouteId); encoder.encodeStruct(codec.String, val.message); }; function MediaRouteProvider_SendRouteMessage_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_SendRouteMessage_ResponseParams.prototype.initDefaults_ = function() { this.sent = false; }; MediaRouteProvider_SendRouteMessage_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_SendRouteMessage_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_SendRouteMessage_ResponseParams; generated.sent = generator_.generateBool(); return generated; }; MediaRouteProvider_SendRouteMessage_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.sent = mutator_.mutateBool(this.sent); } return this; }; MediaRouteProvider_SendRouteMessage_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_SendRouteMessage_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_SendRouteMessage_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_SendRouteMessage_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_SendRouteMessage_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_SendRouteMessage_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_SendRouteMessage_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.sent = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_SendRouteMessage_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_SendRouteMessage_ResponseParams.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.sent & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_SendRouteBinaryMessage_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_SendRouteBinaryMessage_Params.prototype.initDefaults_ = function() { this.mediaRouteId = null; this.data = null; }; MediaRouteProvider_SendRouteBinaryMessage_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_SendRouteBinaryMessage_Params.generate = function(generator_) { var generated = new MediaRouteProvider_SendRouteBinaryMessage_Params; generated.mediaRouteId = generator_.generateString(false); generated.data = generator_.generateArray(function() { return generator_.generateUint8(); }); return generated; }; MediaRouteProvider_SendRouteBinaryMessage_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaRouteId = mutator_.mutateString(this.mediaRouteId, false); } if (mutator_.chooseMutateField()) { this.data = mutator_.mutateArray(this.data, function(val) { return mutator_.mutateUint8(val); }); } return this; }; MediaRouteProvider_SendRouteBinaryMessage_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_SendRouteBinaryMessage_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_SendRouteBinaryMessage_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_SendRouteBinaryMessage_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SendRouteBinaryMessage_Params.mediaRouteId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SendRouteBinaryMessage_Params.data err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_SendRouteBinaryMessage_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouteProvider_SendRouteBinaryMessage_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_SendRouteBinaryMessage_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaRouteId = decoder.decodeStruct(codec.String); val.data = decoder.decodeArrayPointer(codec.Uint8); return val; }; MediaRouteProvider_SendRouteBinaryMessage_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_SendRouteBinaryMessage_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaRouteId); encoder.encodeArrayPointer(codec.Uint8, val.data); }; function MediaRouteProvider_SendRouteBinaryMessage_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.prototype.initDefaults_ = function() { this.sent = false; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_SendRouteBinaryMessage_ResponseParams; generated.sent = generator_.generateBool(); return generated; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.sent = mutator_.mutateBool(this.sent); } return this; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_SendRouteBinaryMessage_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.sent = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.sent & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_StartObservingMediaSinks_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_StartObservingMediaSinks_Params.prototype.initDefaults_ = function() { this.mediaSource = null; }; MediaRouteProvider_StartObservingMediaSinks_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_StartObservingMediaSinks_Params.generate = function(generator_) { var generated = new MediaRouteProvider_StartObservingMediaSinks_Params; generated.mediaSource = generator_.generateString(false); return generated; }; MediaRouteProvider_StartObservingMediaSinks_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } return this; }; MediaRouteProvider_StartObservingMediaSinks_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_StartObservingMediaSinks_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_StartObservingMediaSinks_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_StartObservingMediaSinks_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_StartObservingMediaSinks_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_StartObservingMediaSinks_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_StartObservingMediaSinks_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_StartObservingMediaSinks_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_StartObservingMediaSinks_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_StartObservingMediaSinks_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); }; function MediaRouteProvider_StopObservingMediaSinks_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_StopObservingMediaSinks_Params.prototype.initDefaults_ = function() { this.mediaSource = null; }; MediaRouteProvider_StopObservingMediaSinks_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_StopObservingMediaSinks_Params.generate = function(generator_) { var generated = new MediaRouteProvider_StopObservingMediaSinks_Params; generated.mediaSource = generator_.generateString(false); return generated; }; MediaRouteProvider_StopObservingMediaSinks_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } return this; }; MediaRouteProvider_StopObservingMediaSinks_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_StopObservingMediaSinks_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_StopObservingMediaSinks_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_StopObservingMediaSinks_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_StopObservingMediaSinks_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_StopObservingMediaSinks_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_StopObservingMediaSinks_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_StopObservingMediaSinks_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_StopObservingMediaSinks_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_StopObservingMediaSinks_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); }; function MediaRouteProvider_StartObservingMediaRoutes_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_StartObservingMediaRoutes_Params.prototype.initDefaults_ = function() { this.mediaSource = null; }; MediaRouteProvider_StartObservingMediaRoutes_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_StartObservingMediaRoutes_Params.generate = function(generator_) { var generated = new MediaRouteProvider_StartObservingMediaRoutes_Params; generated.mediaSource = generator_.generateString(false); return generated; }; MediaRouteProvider_StartObservingMediaRoutes_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } return this; }; MediaRouteProvider_StartObservingMediaRoutes_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_StartObservingMediaRoutes_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_StartObservingMediaRoutes_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_StartObservingMediaRoutes_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_StartObservingMediaRoutes_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_StartObservingMediaRoutes_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_StartObservingMediaRoutes_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_StartObservingMediaRoutes_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_StartObservingMediaRoutes_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_StartObservingMediaRoutes_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); }; function MediaRouteProvider_StopObservingMediaRoutes_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_StopObservingMediaRoutes_Params.prototype.initDefaults_ = function() { this.mediaSource = null; }; MediaRouteProvider_StopObservingMediaRoutes_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_StopObservingMediaRoutes_Params.generate = function(generator_) { var generated = new MediaRouteProvider_StopObservingMediaRoutes_Params; generated.mediaSource = generator_.generateString(false); return generated; }; MediaRouteProvider_StopObservingMediaRoutes_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } return this; }; MediaRouteProvider_StopObservingMediaRoutes_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_StopObservingMediaRoutes_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_StopObservingMediaRoutes_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_StopObservingMediaRoutes_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_StopObservingMediaRoutes_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_StopObservingMediaRoutes_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_StopObservingMediaRoutes_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_StopObservingMediaRoutes_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_StopObservingMediaRoutes_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_StopObservingMediaRoutes_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); }; function MediaRouteProvider_StartListeningForRouteMessages_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_StartListeningForRouteMessages_Params.prototype.initDefaults_ = function() { this.routeId = null; }; MediaRouteProvider_StartListeningForRouteMessages_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_StartListeningForRouteMessages_Params.generate = function(generator_) { var generated = new MediaRouteProvider_StartListeningForRouteMessages_Params; generated.routeId = generator_.generateString(false); return generated; }; MediaRouteProvider_StartListeningForRouteMessages_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } return this; }; MediaRouteProvider_StartListeningForRouteMessages_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_StartListeningForRouteMessages_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_StartListeningForRouteMessages_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_StartListeningForRouteMessages_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_StartListeningForRouteMessages_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_StartListeningForRouteMessages_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_StartListeningForRouteMessages_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_StartListeningForRouteMessages_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_StartListeningForRouteMessages_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_StartListeningForRouteMessages_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); }; function MediaRouteProvider_StopListeningForRouteMessages_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_StopListeningForRouteMessages_Params.prototype.initDefaults_ = function() { this.routeId = null; }; MediaRouteProvider_StopListeningForRouteMessages_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_StopListeningForRouteMessages_Params.generate = function(generator_) { var generated = new MediaRouteProvider_StopListeningForRouteMessages_Params; generated.routeId = generator_.generateString(false); return generated; }; MediaRouteProvider_StopListeningForRouteMessages_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } return this; }; MediaRouteProvider_StopListeningForRouteMessages_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_StopListeningForRouteMessages_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_StopListeningForRouteMessages_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_StopListeningForRouteMessages_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_StopListeningForRouteMessages_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_StopListeningForRouteMessages_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_StopListeningForRouteMessages_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_StopListeningForRouteMessages_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_StopListeningForRouteMessages_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_StopListeningForRouteMessages_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); }; function MediaRouteProvider_DetachRoute_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_DetachRoute_Params.prototype.initDefaults_ = function() { this.routeId = null; }; MediaRouteProvider_DetachRoute_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_DetachRoute_Params.generate = function(generator_) { var generated = new MediaRouteProvider_DetachRoute_Params; generated.routeId = generator_.generateString(false); return generated; }; MediaRouteProvider_DetachRoute_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } return this; }; MediaRouteProvider_DetachRoute_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_DetachRoute_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_DetachRoute_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_DetachRoute_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_DetachRoute_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_DetachRoute_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_DetachRoute_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_DetachRoute_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_DetachRoute_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_DetachRoute_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); }; function MediaRouteProvider_EnableMdnsDiscovery_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_EnableMdnsDiscovery_Params.prototype.initDefaults_ = function() { }; MediaRouteProvider_EnableMdnsDiscovery_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_EnableMdnsDiscovery_Params.generate = function(generator_) { var generated = new MediaRouteProvider_EnableMdnsDiscovery_Params; return generated; }; MediaRouteProvider_EnableMdnsDiscovery_Params.prototype.mutate = function(mutator_) { return this; }; MediaRouteProvider_EnableMdnsDiscovery_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_EnableMdnsDiscovery_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_EnableMdnsDiscovery_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_EnableMdnsDiscovery_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_EnableMdnsDiscovery_Params.encodedSize = codec.kStructHeaderSize + 0; MediaRouteProvider_EnableMdnsDiscovery_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_EnableMdnsDiscovery_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MediaRouteProvider_EnableMdnsDiscovery_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_EnableMdnsDiscovery_Params.encodedSize); encoder.writeUint32(0); }; function MediaRouteProvider_UpdateMediaSinks_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_UpdateMediaSinks_Params.prototype.initDefaults_ = function() { this.mediaSource = null; }; MediaRouteProvider_UpdateMediaSinks_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_UpdateMediaSinks_Params.generate = function(generator_) { var generated = new MediaRouteProvider_UpdateMediaSinks_Params; generated.mediaSource = generator_.generateString(false); return generated; }; MediaRouteProvider_UpdateMediaSinks_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } return this; }; MediaRouteProvider_UpdateMediaSinks_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_UpdateMediaSinks_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_UpdateMediaSinks_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_UpdateMediaSinks_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_UpdateMediaSinks_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_UpdateMediaSinks_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_UpdateMediaSinks_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_UpdateMediaSinks_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.mediaSource = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_UpdateMediaSinks_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_UpdateMediaSinks_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.mediaSource); }; function MediaRouteProvider_SearchSinks_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_SearchSinks_Params.prototype.initDefaults_ = function() { this.sinkId = null; this.mediaSource = null; this.searchCriteria = null; }; MediaRouteProvider_SearchSinks_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_SearchSinks_Params.generate = function(generator_) { var generated = new MediaRouteProvider_SearchSinks_Params; generated.sinkId = generator_.generateString(false); generated.mediaSource = generator_.generateString(false); generated.searchCriteria = generator_.generateStruct(mediaRouter.mojom.SinkSearchCriteria, false); return generated; }; MediaRouteProvider_SearchSinks_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.sinkId = mutator_.mutateString(this.sinkId, false); } if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } if (mutator_.chooseMutateField()) { this.searchCriteria = mutator_.mutateStruct(mediaRouter.mojom.SinkSearchCriteria, false); } return this; }; MediaRouteProvider_SearchSinks_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_SearchSinks_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_SearchSinks_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_SearchSinks_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SearchSinks_Params.sinkId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SearchSinks_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SearchSinks_Params.searchCriteria err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, SinkSearchCriteria, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_SearchSinks_Params.encodedSize = codec.kStructHeaderSize + 24; MediaRouteProvider_SearchSinks_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_SearchSinks_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.sinkId = decoder.decodeStruct(codec.String); val.mediaSource = decoder.decodeStruct(codec.String); val.searchCriteria = decoder.decodeStructPointer(SinkSearchCriteria); return val; }; MediaRouteProvider_SearchSinks_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_SearchSinks_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.sinkId); encoder.encodeStruct(codec.String, val.mediaSource); encoder.encodeStructPointer(SinkSearchCriteria, val.searchCriteria); }; function MediaRouteProvider_SearchSinks_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_SearchSinks_ResponseParams.prototype.initDefaults_ = function() { this.sinkId = null; }; MediaRouteProvider_SearchSinks_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_SearchSinks_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_SearchSinks_ResponseParams; generated.sinkId = generator_.generateString(false); return generated; }; MediaRouteProvider_SearchSinks_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.sinkId = mutator_.mutateString(this.sinkId, false); } return this; }; MediaRouteProvider_SearchSinks_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_SearchSinks_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_SearchSinks_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_SearchSinks_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_SearchSinks_ResponseParams.sinkId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_SearchSinks_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_SearchSinks_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_SearchSinks_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.sinkId = decoder.decodeStruct(codec.String); return val; }; MediaRouteProvider_SearchSinks_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_SearchSinks_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.sinkId); }; function MediaRouteProvider_ProvideSinks_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_ProvideSinks_Params.prototype.initDefaults_ = function() { this.providerName = null; this.sinks = null; }; MediaRouteProvider_ProvideSinks_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_ProvideSinks_Params.generate = function(generator_) { var generated = new MediaRouteProvider_ProvideSinks_Params; generated.providerName = generator_.generateString(false); generated.sinks = generator_.generateArray(function() { return generator_.generateStruct(mediaRouter.mojom.MediaSink, false); }); return generated; }; MediaRouteProvider_ProvideSinks_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.providerName = mutator_.mutateString(this.providerName, false); } if (mutator_.chooseMutateField()) { this.sinks = mutator_.mutateArray(this.sinks, function(val) { return mutator_.mutateStruct(mediaRouter.mojom.MediaSink, false); }); } return this; }; MediaRouteProvider_ProvideSinks_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_ProvideSinks_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_ProvideSinks_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_ProvideSinks_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ProvideSinks_Params.providerName err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_ProvideSinks_Params.sinks err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(MediaSink), false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_ProvideSinks_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouteProvider_ProvideSinks_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_ProvideSinks_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.providerName = decoder.decodeStruct(codec.String); val.sinks = decoder.decodeArrayPointer(new codec.PointerTo(MediaSink)); return val; }; MediaRouteProvider_ProvideSinks_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_ProvideSinks_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.providerName); encoder.encodeArrayPointer(new codec.PointerTo(MediaSink), val.sinks); }; function MediaRouteProvider_CreateMediaRouteController_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_CreateMediaRouteController_Params.prototype.initDefaults_ = function() { this.routeId = null; this.mediaController = new bindings.InterfaceRequest(); this.observer = new media_status$.MediaStatusObserverPtr(); }; MediaRouteProvider_CreateMediaRouteController_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_CreateMediaRouteController_Params.generate = function(generator_) { var generated = new MediaRouteProvider_CreateMediaRouteController_Params; generated.routeId = generator_.generateString(false); generated.mediaController = generator_.generateInterfaceRequest("mediaRouter.mojom.MediaController", false); generated.observer = generator_.generateInterface("mediaRouter.mojom.MediaStatusObserver", false); return generated; }; MediaRouteProvider_CreateMediaRouteController_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } if (mutator_.chooseMutateField()) { this.mediaController = mutator_.mutateInterfaceRequest(this.mediaController, "mediaRouter.mojom.MediaController", false); } if (mutator_.chooseMutateField()) { this.observer = mutator_.mutateInterface(this.observer, "mediaRouter.mojom.MediaStatusObserver", false); } return this; }; MediaRouteProvider_CreateMediaRouteController_Params.prototype.getHandleDeps = function() { var handles = []; if (this.mediaController !== null) { Array.prototype.push.apply(handles, ["mediaRouter.mojom.MediaControllerRequest"]); } if (this.observer !== null) { Array.prototype.push.apply(handles, ["mediaRouter.mojom.MediaStatusObserverPtr"]); } return handles; }; MediaRouteProvider_CreateMediaRouteController_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_CreateMediaRouteController_Params.prototype.setHandlesInternal_ = function(handles, idx) { this.mediaController = handles[idx++];; this.observer = handles[idx++];; return idx; }; MediaRouteProvider_CreateMediaRouteController_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateMediaRouteController_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateMediaRouteController_Params.mediaController err = messageValidator.validateInterfaceRequest(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouteProvider_CreateMediaRouteController_Params.observer err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 12, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_CreateMediaRouteController_Params.encodedSize = codec.kStructHeaderSize + 24; MediaRouteProvider_CreateMediaRouteController_Params.decode = function(decoder) { var packed; var val = new MediaRouteProvider_CreateMediaRouteController_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); val.mediaController = decoder.decodeStruct(codec.InterfaceRequest); val.observer = decoder.decodeStruct(new codec.Interface(media_status$.MediaStatusObserverPtr)); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_CreateMediaRouteController_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_CreateMediaRouteController_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); encoder.encodeStruct(codec.InterfaceRequest, val.mediaController); encoder.encodeStruct(new codec.Interface(media_status$.MediaStatusObserverPtr), val.observer); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouteProvider_CreateMediaRouteController_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouteProvider_CreateMediaRouteController_ResponseParams.prototype.initDefaults_ = function() { this.success = false; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.generate = function(generator_) { var generated = new MediaRouteProvider_CreateMediaRouteController_ResponseParams; generated.success = generator_.generateBool(); return generated; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.success = mutator_.mutateBool(this.success); } return this; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MediaRouteProvider_CreateMediaRouteController_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouteProvider_CreateMediaRouteController_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.success = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouteProvider_CreateMediaRouteController_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouteProvider_CreateMediaRouteController_ResponseParams.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.success & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouter_RegisterMediaRouteProvider_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_RegisterMediaRouteProvider_Params.prototype.initDefaults_ = function() { this.providerId = 0; this.mediaRouterProvider = new MediaRouteProviderPtr(); }; MediaRouter_RegisterMediaRouteProvider_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_RegisterMediaRouteProvider_Params.generate = function(generator_) { var generated = new MediaRouter_RegisterMediaRouteProvider_Params; generated.providerId = generator_.generateEnum(0, 3); generated.mediaRouterProvider = generator_.generateInterface("mediaRouter.mojom.MediaRouteProvider", false); return generated; }; MediaRouter_RegisterMediaRouteProvider_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.providerId = mutator_.mutateEnum(this.providerId, 0, 3); } if (mutator_.chooseMutateField()) { this.mediaRouterProvider = mutator_.mutateInterface(this.mediaRouterProvider, "mediaRouter.mojom.MediaRouteProvider", false); } return this; }; MediaRouter_RegisterMediaRouteProvider_Params.prototype.getHandleDeps = function() { var handles = []; if (this.mediaRouterProvider !== null) { Array.prototype.push.apply(handles, ["mediaRouter.mojom.MediaRouteProviderPtr"]); } return handles; }; MediaRouter_RegisterMediaRouteProvider_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_RegisterMediaRouteProvider_Params.prototype.setHandlesInternal_ = function(handles, idx) { this.mediaRouterProvider = handles[idx++];; return idx; }; MediaRouter_RegisterMediaRouteProvider_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_RegisterMediaRouteProvider_Params.providerId err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, MediaRouteProvider.Id); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_RegisterMediaRouteProvider_Params.mediaRouterProvider err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 4, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_RegisterMediaRouteProvider_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouter_RegisterMediaRouteProvider_Params.decode = function(decoder) { var packed; var val = new MediaRouter_RegisterMediaRouteProvider_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.providerId = decoder.decodeStruct(codec.Int32); val.mediaRouterProvider = decoder.decodeStruct(new codec.Interface(MediaRouteProviderPtr)); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouter_RegisterMediaRouteProvider_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_RegisterMediaRouteProvider_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.providerId); encoder.encodeStruct(new codec.Interface(MediaRouteProviderPtr), val.mediaRouterProvider); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouter_RegisterMediaRouteProvider_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_RegisterMediaRouteProvider_ResponseParams.prototype.initDefaults_ = function() { this.instanceId = null; this.config = null; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.generate = function(generator_) { var generated = new MediaRouter_RegisterMediaRouteProvider_ResponseParams; generated.instanceId = generator_.generateString(false); generated.config = generator_.generateStruct(mediaRouter.mojom.MediaRouteProviderConfig, false); return generated; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.instanceId = mutator_.mutateString(this.instanceId, false); } if (mutator_.chooseMutateField()) { this.config = mutator_.mutateStruct(mediaRouter.mojom.MediaRouteProviderConfig, false); } return this; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_RegisterMediaRouteProvider_ResponseParams.instanceId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouter_RegisterMediaRouteProvider_ResponseParams.config err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, MediaRouteProviderConfig, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.encodedSize = codec.kStructHeaderSize + 16; MediaRouter_RegisterMediaRouteProvider_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouter_RegisterMediaRouteProvider_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.instanceId = decoder.decodeStruct(codec.String); val.config = decoder.decodeStructPointer(MediaRouteProviderConfig); return val; }; MediaRouter_RegisterMediaRouteProvider_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_RegisterMediaRouteProvider_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.instanceId); encoder.encodeStructPointer(MediaRouteProviderConfig, val.config); }; function MediaRouter_OnSinksReceived_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnSinksReceived_Params.prototype.initDefaults_ = function() { this.providerId = 0; this.mediaSource = null; this.sinks = null; this.origins = null; }; MediaRouter_OnSinksReceived_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnSinksReceived_Params.generate = function(generator_) { var generated = new MediaRouter_OnSinksReceived_Params; generated.providerId = generator_.generateEnum(0, 3); generated.mediaSource = generator_.generateString(false); generated.sinks = generator_.generateArray(function() { return generator_.generateStruct(mediaRouter.mojom.MediaSink, false); }); generated.origins = generator_.generateArray(function() { return generator_.generateStruct(url.mojom.Origin, false); }); return generated; }; MediaRouter_OnSinksReceived_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.providerId = mutator_.mutateEnum(this.providerId, 0, 3); } if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } if (mutator_.chooseMutateField()) { this.sinks = mutator_.mutateArray(this.sinks, function(val) { return mutator_.mutateStruct(mediaRouter.mojom.MediaSink, false); }); } if (mutator_.chooseMutateField()) { this.origins = mutator_.mutateArray(this.origins, function(val) { return mutator_.mutateStruct(url.mojom.Origin, false); }); } return this; }; MediaRouter_OnSinksReceived_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnSinksReceived_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnSinksReceived_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnSinksReceived_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 40} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnSinksReceived_Params.providerId err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, MediaRouteProvider.Id); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnSinksReceived_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnSinksReceived_Params.sinks err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 8, new codec.PointerTo(MediaSink), false, [0], 0); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnSinksReceived_Params.origins err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 24, 8, new codec.PointerTo(origin$.Origin), false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnSinksReceived_Params.encodedSize = codec.kStructHeaderSize + 32; MediaRouter_OnSinksReceived_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnSinksReceived_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.providerId = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); val.mediaSource = decoder.decodeStruct(codec.String); val.sinks = decoder.decodeArrayPointer(new codec.PointerTo(MediaSink)); val.origins = decoder.decodeArrayPointer(new codec.PointerTo(origin$.Origin)); return val; }; MediaRouter_OnSinksReceived_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnSinksReceived_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.providerId); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.String, val.mediaSource); encoder.encodeArrayPointer(new codec.PointerTo(MediaSink), val.sinks); encoder.encodeArrayPointer(new codec.PointerTo(origin$.Origin), val.origins); }; function MediaRouter_OnIssue_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnIssue_Params.prototype.initDefaults_ = function() { this.issue = null; }; MediaRouter_OnIssue_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnIssue_Params.generate = function(generator_) { var generated = new MediaRouter_OnIssue_Params; generated.issue = generator_.generateStruct(mediaRouter.mojom.Issue, false); return generated; }; MediaRouter_OnIssue_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.issue = mutator_.mutateStruct(mediaRouter.mojom.Issue, false); } return this; }; MediaRouter_OnIssue_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnIssue_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnIssue_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnIssue_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnIssue_Params.issue err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, Issue, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnIssue_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouter_OnIssue_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnIssue_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.issue = decoder.decodeStructPointer(Issue); return val; }; MediaRouter_OnIssue_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnIssue_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(Issue, val.issue); }; function MediaRouter_OnRoutesUpdated_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnRoutesUpdated_Params.prototype.initDefaults_ = function() { this.providerId = 0; this.routes = null; this.mediaSource = null; this.joinableRouteIds = null; }; MediaRouter_OnRoutesUpdated_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnRoutesUpdated_Params.generate = function(generator_) { var generated = new MediaRouter_OnRoutesUpdated_Params; generated.providerId = generator_.generateEnum(0, 3); generated.routes = generator_.generateArray(function() { return generator_.generateStruct(mediaRouter.mojom.MediaRoute, false); }); generated.mediaSource = generator_.generateString(false); generated.joinableRouteIds = generator_.generateArray(function() { return generator_.generateString(false); }); return generated; }; MediaRouter_OnRoutesUpdated_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.providerId = mutator_.mutateEnum(this.providerId, 0, 3); } if (mutator_.chooseMutateField()) { this.routes = mutator_.mutateArray(this.routes, function(val) { return mutator_.mutateStruct(mediaRouter.mojom.MediaRoute, false); }); } if (mutator_.chooseMutateField()) { this.mediaSource = mutator_.mutateString(this.mediaSource, false); } if (mutator_.chooseMutateField()) { this.joinableRouteIds = mutator_.mutateArray(this.joinableRouteIds, function(val) { return mutator_.mutateString(val, false); }); } return this; }; MediaRouter_OnRoutesUpdated_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnRoutesUpdated_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnRoutesUpdated_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnRoutesUpdated_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 40} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnRoutesUpdated_Params.providerId err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, MediaRouteProvider.Id); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnRoutesUpdated_Params.routes err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(MediaRoute), false, [0], 0); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnRoutesUpdated_Params.mediaSource err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnRoutesUpdated_Params.joinableRouteIds err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 24, 8, codec.String, false, [0, 0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnRoutesUpdated_Params.encodedSize = codec.kStructHeaderSize + 32; MediaRouter_OnRoutesUpdated_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnRoutesUpdated_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.providerId = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); val.routes = decoder.decodeArrayPointer(new codec.PointerTo(MediaRoute)); val.mediaSource = decoder.decodeStruct(codec.String); val.joinableRouteIds = decoder.decodeArrayPointer(codec.String); return val; }; MediaRouter_OnRoutesUpdated_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnRoutesUpdated_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.providerId); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeArrayPointer(new codec.PointerTo(MediaRoute), val.routes); encoder.encodeStruct(codec.String, val.mediaSource); encoder.encodeArrayPointer(codec.String, val.joinableRouteIds); }; function MediaRouter_OnSinkAvailabilityUpdated_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnSinkAvailabilityUpdated_Params.prototype.initDefaults_ = function() { this.providerId = 0; this.availability = 0; }; MediaRouter_OnSinkAvailabilityUpdated_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnSinkAvailabilityUpdated_Params.generate = function(generator_) { var generated = new MediaRouter_OnSinkAvailabilityUpdated_Params; generated.providerId = generator_.generateEnum(0, 3); generated.availability = generator_.generateEnum(0, 2); return generated; }; MediaRouter_OnSinkAvailabilityUpdated_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.providerId = mutator_.mutateEnum(this.providerId, 0, 3); } if (mutator_.chooseMutateField()) { this.availability = mutator_.mutateEnum(this.availability, 0, 2); } return this; }; MediaRouter_OnSinkAvailabilityUpdated_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnSinkAvailabilityUpdated_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnSinkAvailabilityUpdated_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnSinkAvailabilityUpdated_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnSinkAvailabilityUpdated_Params.providerId err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, MediaRouteProvider.Id); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnSinkAvailabilityUpdated_Params.availability err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 4, MediaRouter.SinkAvailability); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnSinkAvailabilityUpdated_Params.encodedSize = codec.kStructHeaderSize + 8; MediaRouter_OnSinkAvailabilityUpdated_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnSinkAvailabilityUpdated_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.providerId = decoder.decodeStruct(codec.Int32); val.availability = decoder.decodeStruct(codec.Int32); return val; }; MediaRouter_OnSinkAvailabilityUpdated_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnSinkAvailabilityUpdated_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.providerId); encoder.encodeStruct(codec.Int32, val.availability); }; function MediaRouter_OnPresentationConnectionStateChanged_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnPresentationConnectionStateChanged_Params.prototype.initDefaults_ = function() { this.routeId = null; this.state = 0; }; MediaRouter_OnPresentationConnectionStateChanged_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnPresentationConnectionStateChanged_Params.generate = function(generator_) { var generated = new MediaRouter_OnPresentationConnectionStateChanged_Params; generated.routeId = generator_.generateString(false); generated.state = generator_.generateEnum(0, 3); return generated; }; MediaRouter_OnPresentationConnectionStateChanged_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } if (mutator_.chooseMutateField()) { this.state = mutator_.mutateEnum(this.state, 0, 3); } return this; }; MediaRouter_OnPresentationConnectionStateChanged_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnPresentationConnectionStateChanged_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnPresentationConnectionStateChanged_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnPresentationConnectionStateChanged_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnPresentationConnectionStateChanged_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnPresentationConnectionStateChanged_Params.state err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, MediaRouter.PresentationConnectionState); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnPresentationConnectionStateChanged_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouter_OnPresentationConnectionStateChanged_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnPresentationConnectionStateChanged_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); val.state = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MediaRouter_OnPresentationConnectionStateChanged_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnPresentationConnectionStateChanged_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); encoder.encodeStruct(codec.Int32, val.state); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaRouter_OnPresentationConnectionClosed_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnPresentationConnectionClosed_Params.prototype.initDefaults_ = function() { this.routeId = null; this.reason = 0; this.message = null; }; MediaRouter_OnPresentationConnectionClosed_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnPresentationConnectionClosed_Params.generate = function(generator_) { var generated = new MediaRouter_OnPresentationConnectionClosed_Params; generated.routeId = generator_.generateString(false); generated.reason = generator_.generateEnum(0, 2); generated.message = generator_.generateString(false); return generated; }; MediaRouter_OnPresentationConnectionClosed_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } if (mutator_.chooseMutateField()) { this.reason = mutator_.mutateEnum(this.reason, 0, 2); } if (mutator_.chooseMutateField()) { this.message = mutator_.mutateString(this.message, false); } return this; }; MediaRouter_OnPresentationConnectionClosed_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnPresentationConnectionClosed_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnPresentationConnectionClosed_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnPresentationConnectionClosed_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnPresentationConnectionClosed_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnPresentationConnectionClosed_Params.reason err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, MediaRouter.PresentationConnectionCloseReason); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnPresentationConnectionClosed_Params.message err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnPresentationConnectionClosed_Params.encodedSize = codec.kStructHeaderSize + 24; MediaRouter_OnPresentationConnectionClosed_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnPresentationConnectionClosed_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); val.reason = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); val.message = decoder.decodeStruct(codec.String); return val; }; MediaRouter_OnPresentationConnectionClosed_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnPresentationConnectionClosed_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); encoder.encodeStruct(codec.Int32, val.reason); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.String, val.message); }; function MediaRouter_OnRouteMessagesReceived_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnRouteMessagesReceived_Params.prototype.initDefaults_ = function() { this.routeId = null; this.messages = null; }; MediaRouter_OnRouteMessagesReceived_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnRouteMessagesReceived_Params.generate = function(generator_) { var generated = new MediaRouter_OnRouteMessagesReceived_Params; generated.routeId = generator_.generateString(false); generated.messages = generator_.generateArray(function() { return generator_.generateStruct(mediaRouter.mojom.RouteMessage, false); }); return generated; }; MediaRouter_OnRouteMessagesReceived_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.routeId = mutator_.mutateString(this.routeId, false); } if (mutator_.chooseMutateField()) { this.messages = mutator_.mutateArray(this.messages, function(val) { return mutator_.mutateStruct(mediaRouter.mojom.RouteMessage, false); }); } return this; }; MediaRouter_OnRouteMessagesReceived_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_OnRouteMessagesReceived_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnRouteMessagesReceived_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_OnRouteMessagesReceived_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnRouteMessagesReceived_Params.routeId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnRouteMessagesReceived_Params.messages err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(RouteMessage), false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnRouteMessagesReceived_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouter_OnRouteMessagesReceived_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnRouteMessagesReceived_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.routeId = decoder.decodeStruct(codec.String); val.messages = decoder.decodeArrayPointer(new codec.PointerTo(RouteMessage)); return val; }; MediaRouter_OnRouteMessagesReceived_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnRouteMessagesReceived_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.routeId); encoder.encodeArrayPointer(new codec.PointerTo(RouteMessage), val.messages); }; function MediaRouter_OnMediaRemoterCreated_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_OnMediaRemoterCreated_Params.prototype.initDefaults_ = function() { this.tabId = 0; this.remoter = new mirror_service_remoting$.MirrorServiceRemoterPtr(); this.remotingSource = new bindings.InterfaceRequest(); }; MediaRouter_OnMediaRemoterCreated_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_OnMediaRemoterCreated_Params.generate = function(generator_) { var generated = new MediaRouter_OnMediaRemoterCreated_Params; generated.tabId = generator_.generateInt32(); generated.remoter = generator_.generateInterface("media.mojom.MirrorServiceRemoter", false); generated.remotingSource = generator_.generateInterfaceRequest("media.mojom.MirrorServiceRemotingSource", false); return generated; }; MediaRouter_OnMediaRemoterCreated_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.tabId = mutator_.mutateInt32(this.tabId); } if (mutator_.chooseMutateField()) { this.remoter = mutator_.mutateInterface(this.remoter, "media.mojom.MirrorServiceRemoter", false); } if (mutator_.chooseMutateField()) { this.remotingSource = mutator_.mutateInterfaceRequest(this.remotingSource, "media.mojom.MirrorServiceRemotingSource", false); } return this; }; MediaRouter_OnMediaRemoterCreated_Params.prototype.getHandleDeps = function() { var handles = []; if (this.remoter !== null) { Array.prototype.push.apply(handles, ["media.mojom.MirrorServiceRemoterPtr"]); } if (this.remotingSource !== null) { Array.prototype.push.apply(handles, ["media.mojom.MirrorServiceRemotingSourceRequest"]); } return handles; }; MediaRouter_OnMediaRemoterCreated_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_OnMediaRemoterCreated_Params.prototype.setHandlesInternal_ = function(handles, idx) { this.remoter = handles[idx++];; this.remotingSource = handles[idx++];; return idx; }; MediaRouter_OnMediaRemoterCreated_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnMediaRemoterCreated_Params.remoter err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 4, false); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_OnMediaRemoterCreated_Params.remotingSource err = messageValidator.validateInterfaceRequest(offset + codec.kStructHeaderSize + 12, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_OnMediaRemoterCreated_Params.encodedSize = codec.kStructHeaderSize + 16; MediaRouter_OnMediaRemoterCreated_Params.decode = function(decoder) { var packed; var val = new MediaRouter_OnMediaRemoterCreated_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.tabId = decoder.decodeStruct(codec.Int32); val.remoter = decoder.decodeStruct(new codec.Interface(mirror_service_remoting$.MirrorServiceRemoterPtr)); val.remotingSource = decoder.decodeStruct(codec.InterfaceRequest); return val; }; MediaRouter_OnMediaRemoterCreated_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_OnMediaRemoterCreated_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.tabId); encoder.encodeStruct(new codec.Interface(mirror_service_remoting$.MirrorServiceRemoterPtr), val.remoter); encoder.encodeStruct(codec.InterfaceRequest, val.remotingSource); }; function MediaRouter_GetMediaSinkServiceStatus_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_GetMediaSinkServiceStatus_Params.prototype.initDefaults_ = function() { }; MediaRouter_GetMediaSinkServiceStatus_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_GetMediaSinkServiceStatus_Params.generate = function(generator_) { var generated = new MediaRouter_GetMediaSinkServiceStatus_Params; return generated; }; MediaRouter_GetMediaSinkServiceStatus_Params.prototype.mutate = function(mutator_) { return this; }; MediaRouter_GetMediaSinkServiceStatus_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_GetMediaSinkServiceStatus_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_GetMediaSinkServiceStatus_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_GetMediaSinkServiceStatus_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_GetMediaSinkServiceStatus_Params.encodedSize = codec.kStructHeaderSize + 0; MediaRouter_GetMediaSinkServiceStatus_Params.decode = function(decoder) { var packed; var val = new MediaRouter_GetMediaSinkServiceStatus_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MediaRouter_GetMediaSinkServiceStatus_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_GetMediaSinkServiceStatus_Params.encodedSize); encoder.writeUint32(0); }; function MediaRouter_GetMediaSinkServiceStatus_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MediaRouter_GetMediaSinkServiceStatus_ResponseParams.prototype.initDefaults_ = function() { this.status = null; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.generate = function(generator_) { var generated = new MediaRouter_GetMediaSinkServiceStatus_ResponseParams; generated.status = generator_.generateString(false); return generated; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.status = mutator_.mutateString(this.status, false); } return this; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaRouter_GetMediaSinkServiceStatus_ResponseParams.status err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.decode = function(decoder) { var packed; var val = new MediaRouter_GetMediaSinkServiceStatus_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.status = decoder.decodeStruct(codec.String); return val; }; MediaRouter_GetMediaSinkServiceStatus_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaRouter_GetMediaSinkServiceStatus_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.status); }; function MediaSinkExtraData(value) { this.initDefault_(); this.initValue_(value); } MediaSinkExtraData.Tags = { dialMediaSink: 0, castMediaSink: 1, }; MediaSinkExtraData.prototype.initDefault_ = function() { this.$data = null; this.$tag = undefined; } MediaSinkExtraData.prototype.initValue_ = function(value) { if (value == undefined) { return; } var keys = Object.keys(value); if (keys.length == 0) { return; } if (keys.length > 1) { throw new TypeError("You may set only one member on a union."); } var fields = [ "dialMediaSink", "castMediaSink", ]; if (fields.indexOf(keys[0]) < 0) { throw new ReferenceError(keys[0] + " is not a MediaSinkExtraData member."); } this[keys[0]] = value[keys[0]]; } MediaSinkExtraData.generate = function(generator_) { var generated = new MediaSinkExtraData; var generators = [ { field: "dialMediaSink", generator: function() { return generator_.generateStruct(mediaRouter.mojom.DialMediaSink, false); }, }, { field: "castMediaSink", generator: function() { return generator_.generateStruct(mediaRouter.mojom.CastMediaSink, false); }, }, ]; var result = generator_.generateUnionField(generators); generated[result.field] = result.value; return generated; } MediaSinkExtraData.prototype.mutate = function(mutator_) { var mutators = [ { field: "dialMediaSink", mutator: function() { return mutator_.mutateStruct(mediaRouter.mojom.DialMediaSink, false); }, }, { field: "castMediaSink", mutator: function() { return mutator_.mutateStruct(mediaRouter.mojom.CastMediaSink, false); }, }, ]; var result = mutator_.mutateUnionField(this, mutators); generated[result.field] = result.value; return this; } MediaSinkExtraData.prototype.getHandleDeps = function() { return []; } MediaSinkExtraData.prototype.setHandles = function() { return []; } Object.defineProperty(MediaSinkExtraData.prototype, "dialMediaSink", { get: function() { if (this.$tag != MediaSinkExtraData.Tags.dialMediaSink) { throw new ReferenceError( "MediaSinkExtraData.dialMediaSink is not currently set."); } return this.$data; }, set: function(value) { this.$tag = MediaSinkExtraData.Tags.dialMediaSink; this.$data = value; } }); Object.defineProperty(MediaSinkExtraData.prototype, "castMediaSink", { get: function() { if (this.$tag != MediaSinkExtraData.Tags.castMediaSink) { throw new ReferenceError( "MediaSinkExtraData.castMediaSink is not currently set."); } return this.$data; }, set: function(value) { this.$tag = MediaSinkExtraData.Tags.castMediaSink; this.$data = value; } }); MediaSinkExtraData.encode = function(encoder, val) { if (val == null) { encoder.writeUint64(0); encoder.writeUint64(0); return; } if (val.$tag == undefined) { throw new TypeError("Cannot encode unions with an unknown member set."); } encoder.writeUint32(16); encoder.writeUint32(val.$tag); switch (val.$tag) { case MediaSinkExtraData.Tags.dialMediaSink: encoder.encodeStructPointer(DialMediaSink, val.dialMediaSink); break; case MediaSinkExtraData.Tags.castMediaSink: encoder.encodeStructPointer(CastMediaSink, val.castMediaSink); break; } encoder.align(); }; MediaSinkExtraData.decode = function(decoder) { var size = decoder.readUint32(); if (size == 0) { decoder.readUint32(); decoder.readUint64(); return null; } var result = new MediaSinkExtraData(); var tag = decoder.readUint32(); switch (tag) { case MediaSinkExtraData.Tags.dialMediaSink: result.dialMediaSink = decoder.decodeStructPointer(DialMediaSink); break; case MediaSinkExtraData.Tags.castMediaSink: result.castMediaSink = decoder.decodeStructPointer(CastMediaSink); break; } decoder.align(); return result; }; MediaSinkExtraData.validate = function(messageValidator, offset) { var size = messageValidator.decodeUnionSize(offset); if (size != 16) { return validator.validationError.INVALID_UNION_SIZE; } var tag = messageValidator.decodeUnionTag(offset); var data_offset = offset + 8; var err; switch (tag) { case MediaSinkExtraData.Tags.dialMediaSink: // validate MediaSinkExtraData.dialMediaSink err = messageValidator.validateStructPointer(data_offset, DialMediaSink, false); if (err !== validator.validationError.NONE) return err; break; case MediaSinkExtraData.Tags.castMediaSink: // validate MediaSinkExtraData.castMediaSink err = messageValidator.validateStructPointer(data_offset, CastMediaSink, false); if (err !== validator.validationError.NONE) return err; break; } return validator.validationError.NONE; }; MediaSinkExtraData.encodedSize = 16; var kMediaRouteProvider_CreateRoute_Name = 1159832376; var kMediaRouteProvider_JoinRoute_Name = 1848554502; var kMediaRouteProvider_ConnectRouteByRouteId_Name = 1539417656; var kMediaRouteProvider_TerminateRoute_Name = 290854950; var kMediaRouteProvider_SendRouteMessage_Name = 2140364105; var kMediaRouteProvider_SendRouteBinaryMessage_Name = 1843210406; var kMediaRouteProvider_StartObservingMediaSinks_Name = 367999144; var kMediaRouteProvider_StopObservingMediaSinks_Name = 722188687; var kMediaRouteProvider_StartObservingMediaRoutes_Name = 547235970; var kMediaRouteProvider_StopObservingMediaRoutes_Name = 233564276; var kMediaRouteProvider_StartListeningForRouteMessages_Name = 1445933955; var kMediaRouteProvider_StopListeningForRouteMessages_Name = 760280017; var kMediaRouteProvider_DetachRoute_Name = 1775110787; var kMediaRouteProvider_EnableMdnsDiscovery_Name = 2015390229; var kMediaRouteProvider_UpdateMediaSinks_Name = 1009300429; var kMediaRouteProvider_SearchSinks_Name = 1410497384; var kMediaRouteProvider_ProvideSinks_Name = 1948467077; var kMediaRouteProvider_CreateMediaRouteController_Name = 585358999; function MediaRouteProviderPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(MediaRouteProvider, handleOrPtrInfo); } function MediaRouteProviderAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( MediaRouteProvider, associatedInterfacePtrInfo); } MediaRouteProviderAssociatedPtr.prototype = Object.create(MediaRouteProviderPtr.prototype); MediaRouteProviderAssociatedPtr.prototype.constructor = MediaRouteProviderAssociatedPtr; function MediaRouteProviderProxy(receiver) { this.receiver_ = receiver; } MediaRouteProviderPtr.prototype.createRoute = function() { return MediaRouteProviderProxy.prototype.createRoute .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.createRoute = function(mediaSource, sinkId, originalPresentationId, origin, tabId, timeout, incognito) { var params_ = new MediaRouteProvider_CreateRoute_Params(); params_.mediaSource = mediaSource; params_.sinkId = sinkId; params_.originalPresentationId = originalPresentationId; params_.origin = origin; params_.tabId = tabId; params_.timeout = timeout; params_.incognito = incognito; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_CreateRoute_Name, codec.align(MediaRouteProvider_CreateRoute_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_CreateRoute_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_CreateRoute_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.joinRoute = function() { return MediaRouteProviderProxy.prototype.joinRoute .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.joinRoute = function(mediaSource, presentationId, origin, tabId, timeout, incognito) { var params_ = new MediaRouteProvider_JoinRoute_Params(); params_.mediaSource = mediaSource; params_.presentationId = presentationId; params_.origin = origin; params_.tabId = tabId; params_.timeout = timeout; params_.incognito = incognito; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_JoinRoute_Name, codec.align(MediaRouteProvider_JoinRoute_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_JoinRoute_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_JoinRoute_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.connectRouteByRouteId = function() { return MediaRouteProviderProxy.prototype.connectRouteByRouteId .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.connectRouteByRouteId = function(mediaSource, routeId, presentationId, origin, tabId, timeout, incognito) { var params_ = new MediaRouteProvider_ConnectRouteByRouteId_Params(); params_.mediaSource = mediaSource; params_.routeId = routeId; params_.presentationId = presentationId; params_.origin = origin; params_.tabId = tabId; params_.timeout = timeout; params_.incognito = incognito; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_ConnectRouteByRouteId_Name, codec.align(MediaRouteProvider_ConnectRouteByRouteId_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_ConnectRouteByRouteId_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_ConnectRouteByRouteId_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.terminateRoute = function() { return MediaRouteProviderProxy.prototype.terminateRoute .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.terminateRoute = function(routeId) { var params_ = new MediaRouteProvider_TerminateRoute_Params(); params_.routeId = routeId; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_TerminateRoute_Name, codec.align(MediaRouteProvider_TerminateRoute_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_TerminateRoute_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_TerminateRoute_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.sendRouteMessage = function() { return MediaRouteProviderProxy.prototype.sendRouteMessage .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.sendRouteMessage = function(mediaRouteId, message) { var params_ = new MediaRouteProvider_SendRouteMessage_Params(); params_.mediaRouteId = mediaRouteId; params_.message = message; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_SendRouteMessage_Name, codec.align(MediaRouteProvider_SendRouteMessage_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_SendRouteMessage_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_SendRouteMessage_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.sendRouteBinaryMessage = function() { return MediaRouteProviderProxy.prototype.sendRouteBinaryMessage .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.sendRouteBinaryMessage = function(mediaRouteId, data) { var params_ = new MediaRouteProvider_SendRouteBinaryMessage_Params(); params_.mediaRouteId = mediaRouteId; params_.data = data; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_SendRouteBinaryMessage_Name, codec.align(MediaRouteProvider_SendRouteBinaryMessage_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_SendRouteBinaryMessage_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_SendRouteBinaryMessage_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.startObservingMediaSinks = function() { return MediaRouteProviderProxy.prototype.startObservingMediaSinks .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.startObservingMediaSinks = function(mediaSource) { var params_ = new MediaRouteProvider_StartObservingMediaSinks_Params(); params_.mediaSource = mediaSource; var builder = new codec.MessageV0Builder( kMediaRouteProvider_StartObservingMediaSinks_Name, codec.align(MediaRouteProvider_StartObservingMediaSinks_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_StartObservingMediaSinks_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.stopObservingMediaSinks = function() { return MediaRouteProviderProxy.prototype.stopObservingMediaSinks .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.stopObservingMediaSinks = function(mediaSource) { var params_ = new MediaRouteProvider_StopObservingMediaSinks_Params(); params_.mediaSource = mediaSource; var builder = new codec.MessageV0Builder( kMediaRouteProvider_StopObservingMediaSinks_Name, codec.align(MediaRouteProvider_StopObservingMediaSinks_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_StopObservingMediaSinks_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.startObservingMediaRoutes = function() { return MediaRouteProviderProxy.prototype.startObservingMediaRoutes .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.startObservingMediaRoutes = function(mediaSource) { var params_ = new MediaRouteProvider_StartObservingMediaRoutes_Params(); params_.mediaSource = mediaSource; var builder = new codec.MessageV0Builder( kMediaRouteProvider_StartObservingMediaRoutes_Name, codec.align(MediaRouteProvider_StartObservingMediaRoutes_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_StartObservingMediaRoutes_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.stopObservingMediaRoutes = function() { return MediaRouteProviderProxy.prototype.stopObservingMediaRoutes .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.stopObservingMediaRoutes = function(mediaSource) { var params_ = new MediaRouteProvider_StopObservingMediaRoutes_Params(); params_.mediaSource = mediaSource; var builder = new codec.MessageV0Builder( kMediaRouteProvider_StopObservingMediaRoutes_Name, codec.align(MediaRouteProvider_StopObservingMediaRoutes_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_StopObservingMediaRoutes_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.startListeningForRouteMessages = function() { return MediaRouteProviderProxy.prototype.startListeningForRouteMessages .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.startListeningForRouteMessages = function(routeId) { var params_ = new MediaRouteProvider_StartListeningForRouteMessages_Params(); params_.routeId = routeId; var builder = new codec.MessageV0Builder( kMediaRouteProvider_StartListeningForRouteMessages_Name, codec.align(MediaRouteProvider_StartListeningForRouteMessages_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_StartListeningForRouteMessages_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.stopListeningForRouteMessages = function() { return MediaRouteProviderProxy.prototype.stopListeningForRouteMessages .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.stopListeningForRouteMessages = function(routeId) { var params_ = new MediaRouteProvider_StopListeningForRouteMessages_Params(); params_.routeId = routeId; var builder = new codec.MessageV0Builder( kMediaRouteProvider_StopListeningForRouteMessages_Name, codec.align(MediaRouteProvider_StopListeningForRouteMessages_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_StopListeningForRouteMessages_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.detachRoute = function() { return MediaRouteProviderProxy.prototype.detachRoute .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.detachRoute = function(routeId) { var params_ = new MediaRouteProvider_DetachRoute_Params(); params_.routeId = routeId; var builder = new codec.MessageV0Builder( kMediaRouteProvider_DetachRoute_Name, codec.align(MediaRouteProvider_DetachRoute_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_DetachRoute_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.enableMdnsDiscovery = function() { return MediaRouteProviderProxy.prototype.enableMdnsDiscovery .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.enableMdnsDiscovery = function() { var params_ = new MediaRouteProvider_EnableMdnsDiscovery_Params(); var builder = new codec.MessageV0Builder( kMediaRouteProvider_EnableMdnsDiscovery_Name, codec.align(MediaRouteProvider_EnableMdnsDiscovery_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_EnableMdnsDiscovery_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.updateMediaSinks = function() { return MediaRouteProviderProxy.prototype.updateMediaSinks .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.updateMediaSinks = function(mediaSource) { var params_ = new MediaRouteProvider_UpdateMediaSinks_Params(); params_.mediaSource = mediaSource; var builder = new codec.MessageV0Builder( kMediaRouteProvider_UpdateMediaSinks_Name, codec.align(MediaRouteProvider_UpdateMediaSinks_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_UpdateMediaSinks_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.searchSinks = function() { return MediaRouteProviderProxy.prototype.searchSinks .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.searchSinks = function(sinkId, mediaSource, searchCriteria) { var params_ = new MediaRouteProvider_SearchSinks_Params(); params_.sinkId = sinkId; params_.mediaSource = mediaSource; params_.searchCriteria = searchCriteria; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_SearchSinks_Name, codec.align(MediaRouteProvider_SearchSinks_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_SearchSinks_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_SearchSinks_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouteProviderPtr.prototype.provideSinks = function() { return MediaRouteProviderProxy.prototype.provideSinks .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.provideSinks = function(providerName, sinks) { var params_ = new MediaRouteProvider_ProvideSinks_Params(); params_.providerName = providerName; params_.sinks = sinks; var builder = new codec.MessageV0Builder( kMediaRouteProvider_ProvideSinks_Name, codec.align(MediaRouteProvider_ProvideSinks_Params.encodedSize)); builder.encodeStruct(MediaRouteProvider_ProvideSinks_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouteProviderPtr.prototype.createMediaRouteController = function() { return MediaRouteProviderProxy.prototype.createMediaRouteController .apply(this.ptr.getProxy(), arguments); }; MediaRouteProviderProxy.prototype.createMediaRouteController = function(routeId, mediaController, observer) { var params_ = new MediaRouteProvider_CreateMediaRouteController_Params(); params_.routeId = routeId; params_.mediaController = mediaController; params_.observer = observer; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouteProvider_CreateMediaRouteController_Name, codec.align(MediaRouteProvider_CreateMediaRouteController_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouteProvider_CreateMediaRouteController_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouteProvider_CreateMediaRouteController_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; function MediaRouteProviderStub(delegate) { this.delegate_ = delegate; } MediaRouteProviderStub.prototype.createRoute = function(mediaSource, sinkId, originalPresentationId, origin, tabId, timeout, incognito) { return this.delegate_ && this.delegate_.createRoute && this.delegate_.createRoute(mediaSource, sinkId, originalPresentationId, origin, tabId, timeout, incognito); } MediaRouteProviderStub.prototype.joinRoute = function(mediaSource, presentationId, origin, tabId, timeout, incognito) { return this.delegate_ && this.delegate_.joinRoute && this.delegate_.joinRoute(mediaSource, presentationId, origin, tabId, timeout, incognito); } MediaRouteProviderStub.prototype.connectRouteByRouteId = function(mediaSource, routeId, presentationId, origin, tabId, timeout, incognito) { return this.delegate_ && this.delegate_.connectRouteByRouteId && this.delegate_.connectRouteByRouteId(mediaSource, routeId, presentationId, origin, tabId, timeout, incognito); } MediaRouteProviderStub.prototype.terminateRoute = function(routeId) { return this.delegate_ && this.delegate_.terminateRoute && this.delegate_.terminateRoute(routeId); } MediaRouteProviderStub.prototype.sendRouteMessage = function(mediaRouteId, message) { return this.delegate_ && this.delegate_.sendRouteMessage && this.delegate_.sendRouteMessage(mediaRouteId, message); } MediaRouteProviderStub.prototype.sendRouteBinaryMessage = function(mediaRouteId, data) { return this.delegate_ && this.delegate_.sendRouteBinaryMessage && this.delegate_.sendRouteBinaryMessage(mediaRouteId, data); } MediaRouteProviderStub.prototype.startObservingMediaSinks = function(mediaSource) { return this.delegate_ && this.delegate_.startObservingMediaSinks && this.delegate_.startObservingMediaSinks(mediaSource); } MediaRouteProviderStub.prototype.stopObservingMediaSinks = function(mediaSource) { return this.delegate_ && this.delegate_.stopObservingMediaSinks && this.delegate_.stopObservingMediaSinks(mediaSource); } MediaRouteProviderStub.prototype.startObservingMediaRoutes = function(mediaSource) { return this.delegate_ && this.delegate_.startObservingMediaRoutes && this.delegate_.startObservingMediaRoutes(mediaSource); } MediaRouteProviderStub.prototype.stopObservingMediaRoutes = function(mediaSource) { return this.delegate_ && this.delegate_.stopObservingMediaRoutes && this.delegate_.stopObservingMediaRoutes(mediaSource); } MediaRouteProviderStub.prototype.startListeningForRouteMessages = function(routeId) { return this.delegate_ && this.delegate_.startListeningForRouteMessages && this.delegate_.startListeningForRouteMessages(routeId); } MediaRouteProviderStub.prototype.stopListeningForRouteMessages = function(routeId) { return this.delegate_ && this.delegate_.stopListeningForRouteMessages && this.delegate_.stopListeningForRouteMessages(routeId); } MediaRouteProviderStub.prototype.detachRoute = function(routeId) { return this.delegate_ && this.delegate_.detachRoute && this.delegate_.detachRoute(routeId); } MediaRouteProviderStub.prototype.enableMdnsDiscovery = function() { return this.delegate_ && this.delegate_.enableMdnsDiscovery && this.delegate_.enableMdnsDiscovery(); } MediaRouteProviderStub.prototype.updateMediaSinks = function(mediaSource) { return this.delegate_ && this.delegate_.updateMediaSinks && this.delegate_.updateMediaSinks(mediaSource); } MediaRouteProviderStub.prototype.searchSinks = function(sinkId, mediaSource, searchCriteria) { return this.delegate_ && this.delegate_.searchSinks && this.delegate_.searchSinks(sinkId, mediaSource, searchCriteria); } MediaRouteProviderStub.prototype.provideSinks = function(providerName, sinks) { return this.delegate_ && this.delegate_.provideSinks && this.delegate_.provideSinks(providerName, sinks); } MediaRouteProviderStub.prototype.createMediaRouteController = function(routeId, mediaController, observer) { return this.delegate_ && this.delegate_.createMediaRouteController && this.delegate_.createMediaRouteController(routeId, mediaController, observer); } MediaRouteProviderStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMediaRouteProvider_StartObservingMediaSinks_Name: var params = reader.decodeStruct(MediaRouteProvider_StartObservingMediaSinks_Params); this.startObservingMediaSinks(params.mediaSource); return true; case kMediaRouteProvider_StopObservingMediaSinks_Name: var params = reader.decodeStruct(MediaRouteProvider_StopObservingMediaSinks_Params); this.stopObservingMediaSinks(params.mediaSource); return true; case kMediaRouteProvider_StartObservingMediaRoutes_Name: var params = reader.decodeStruct(MediaRouteProvider_StartObservingMediaRoutes_Params); this.startObservingMediaRoutes(params.mediaSource); return true; case kMediaRouteProvider_StopObservingMediaRoutes_Name: var params = reader.decodeStruct(MediaRouteProvider_StopObservingMediaRoutes_Params); this.stopObservingMediaRoutes(params.mediaSource); return true; case kMediaRouteProvider_StartListeningForRouteMessages_Name: var params = reader.decodeStruct(MediaRouteProvider_StartListeningForRouteMessages_Params); this.startListeningForRouteMessages(params.routeId); return true; case kMediaRouteProvider_StopListeningForRouteMessages_Name: var params = reader.decodeStruct(MediaRouteProvider_StopListeningForRouteMessages_Params); this.stopListeningForRouteMessages(params.routeId); return true; case kMediaRouteProvider_DetachRoute_Name: var params = reader.decodeStruct(MediaRouteProvider_DetachRoute_Params); this.detachRoute(params.routeId); return true; case kMediaRouteProvider_EnableMdnsDiscovery_Name: var params = reader.decodeStruct(MediaRouteProvider_EnableMdnsDiscovery_Params); this.enableMdnsDiscovery(); return true; case kMediaRouteProvider_UpdateMediaSinks_Name: var params = reader.decodeStruct(MediaRouteProvider_UpdateMediaSinks_Params); this.updateMediaSinks(params.mediaSource); return true; case kMediaRouteProvider_ProvideSinks_Name: var params = reader.decodeStruct(MediaRouteProvider_ProvideSinks_Params); this.provideSinks(params.providerName, params.sinks); return true; default: return false; } }; MediaRouteProviderStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMediaRouteProvider_CreateRoute_Name: var params = reader.decodeStruct(MediaRouteProvider_CreateRoute_Params); this.createRoute(params.mediaSource, params.sinkId, params.originalPresentationId, params.origin, params.tabId, params.timeout, params.incognito).then(function(response) { var responseParams = new MediaRouteProvider_CreateRoute_ResponseParams(); responseParams.route = response.route; responseParams.errorText = response.errorText; responseParams.resultCode = response.resultCode; var builder = new codec.MessageV1Builder( kMediaRouteProvider_CreateRoute_Name, codec.align(MediaRouteProvider_CreateRoute_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_CreateRoute_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_JoinRoute_Name: var params = reader.decodeStruct(MediaRouteProvider_JoinRoute_Params); this.joinRoute(params.mediaSource, params.presentationId, params.origin, params.tabId, params.timeout, params.incognito).then(function(response) { var responseParams = new MediaRouteProvider_JoinRoute_ResponseParams(); responseParams.route = response.route; responseParams.errorText = response.errorText; responseParams.resultCode = response.resultCode; var builder = new codec.MessageV1Builder( kMediaRouteProvider_JoinRoute_Name, codec.align(MediaRouteProvider_JoinRoute_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_JoinRoute_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_ConnectRouteByRouteId_Name: var params = reader.decodeStruct(MediaRouteProvider_ConnectRouteByRouteId_Params); this.connectRouteByRouteId(params.mediaSource, params.routeId, params.presentationId, params.origin, params.tabId, params.timeout, params.incognito).then(function(response) { var responseParams = new MediaRouteProvider_ConnectRouteByRouteId_ResponseParams(); responseParams.route = response.route; responseParams.errorText = response.errorText; responseParams.resultCode = response.resultCode; var builder = new codec.MessageV1Builder( kMediaRouteProvider_ConnectRouteByRouteId_Name, codec.align(MediaRouteProvider_ConnectRouteByRouteId_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_ConnectRouteByRouteId_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_TerminateRoute_Name: var params = reader.decodeStruct(MediaRouteProvider_TerminateRoute_Params); this.terminateRoute(params.routeId).then(function(response) { var responseParams = new MediaRouteProvider_TerminateRoute_ResponseParams(); responseParams.errorText = response.errorText; responseParams.resultCode = response.resultCode; var builder = new codec.MessageV1Builder( kMediaRouteProvider_TerminateRoute_Name, codec.align(MediaRouteProvider_TerminateRoute_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_TerminateRoute_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_SendRouteMessage_Name: var params = reader.decodeStruct(MediaRouteProvider_SendRouteMessage_Params); this.sendRouteMessage(params.mediaRouteId, params.message).then(function(response) { var responseParams = new MediaRouteProvider_SendRouteMessage_ResponseParams(); responseParams.sent = response.sent; var builder = new codec.MessageV1Builder( kMediaRouteProvider_SendRouteMessage_Name, codec.align(MediaRouteProvider_SendRouteMessage_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_SendRouteMessage_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_SendRouteBinaryMessage_Name: var params = reader.decodeStruct(MediaRouteProvider_SendRouteBinaryMessage_Params); this.sendRouteBinaryMessage(params.mediaRouteId, params.data).then(function(response) { var responseParams = new MediaRouteProvider_SendRouteBinaryMessage_ResponseParams(); responseParams.sent = response.sent; var builder = new codec.MessageV1Builder( kMediaRouteProvider_SendRouteBinaryMessage_Name, codec.align(MediaRouteProvider_SendRouteBinaryMessage_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_SendRouteBinaryMessage_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_SearchSinks_Name: var params = reader.decodeStruct(MediaRouteProvider_SearchSinks_Params); this.searchSinks(params.sinkId, params.mediaSource, params.searchCriteria).then(function(response) { var responseParams = new MediaRouteProvider_SearchSinks_ResponseParams(); responseParams.sinkId = response.sinkId; var builder = new codec.MessageV1Builder( kMediaRouteProvider_SearchSinks_Name, codec.align(MediaRouteProvider_SearchSinks_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_SearchSinks_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouteProvider_CreateMediaRouteController_Name: var params = reader.decodeStruct(MediaRouteProvider_CreateMediaRouteController_Params); this.createMediaRouteController(params.routeId, params.mediaController, params.observer).then(function(response) { var responseParams = new MediaRouteProvider_CreateMediaRouteController_ResponseParams(); responseParams.success = response.success; var builder = new codec.MessageV1Builder( kMediaRouteProvider_CreateMediaRouteController_Name, codec.align(MediaRouteProvider_CreateMediaRouteController_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouteProvider_CreateMediaRouteController_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; default: return false; } }; function validateMediaRouteProviderRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMediaRouteProvider_CreateRoute_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_CreateRoute_Params; break; case kMediaRouteProvider_JoinRoute_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_JoinRoute_Params; break; case kMediaRouteProvider_ConnectRouteByRouteId_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_ConnectRouteByRouteId_Params; break; case kMediaRouteProvider_TerminateRoute_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_TerminateRoute_Params; break; case kMediaRouteProvider_SendRouteMessage_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_SendRouteMessage_Params; break; case kMediaRouteProvider_SendRouteBinaryMessage_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_SendRouteBinaryMessage_Params; break; case kMediaRouteProvider_StartObservingMediaSinks_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_StartObservingMediaSinks_Params; break; case kMediaRouteProvider_StopObservingMediaSinks_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_StopObservingMediaSinks_Params; break; case kMediaRouteProvider_StartObservingMediaRoutes_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_StartObservingMediaRoutes_Params; break; case kMediaRouteProvider_StopObservingMediaRoutes_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_StopObservingMediaRoutes_Params; break; case kMediaRouteProvider_StartListeningForRouteMessages_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_StartListeningForRouteMessages_Params; break; case kMediaRouteProvider_StopListeningForRouteMessages_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_StopListeningForRouteMessages_Params; break; case kMediaRouteProvider_DetachRoute_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_DetachRoute_Params; break; case kMediaRouteProvider_EnableMdnsDiscovery_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_EnableMdnsDiscovery_Params; break; case kMediaRouteProvider_UpdateMediaSinks_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_UpdateMediaSinks_Params; break; case kMediaRouteProvider_SearchSinks_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_SearchSinks_Params; break; case kMediaRouteProvider_ProvideSinks_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouteProvider_ProvideSinks_Params; break; case kMediaRouteProvider_CreateMediaRouteController_Name: if (message.expectsResponse()) paramsClass = MediaRouteProvider_CreateMediaRouteController_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateMediaRouteProviderResponse(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMediaRouteProvider_CreateRoute_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_CreateRoute_ResponseParams; break; case kMediaRouteProvider_JoinRoute_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_JoinRoute_ResponseParams; break; case kMediaRouteProvider_ConnectRouteByRouteId_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_ConnectRouteByRouteId_ResponseParams; break; case kMediaRouteProvider_TerminateRoute_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_TerminateRoute_ResponseParams; break; case kMediaRouteProvider_SendRouteMessage_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_SendRouteMessage_ResponseParams; break; case kMediaRouteProvider_SendRouteBinaryMessage_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_SendRouteBinaryMessage_ResponseParams; break; case kMediaRouteProvider_SearchSinks_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_SearchSinks_ResponseParams; break; case kMediaRouteProvider_CreateMediaRouteController_Name: if (message.isResponse()) paramsClass = MediaRouteProvider_CreateMediaRouteController_ResponseParams; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } var MediaRouteProvider = { name: 'media_router.mojom.MediaRouteProvider', kVersion: 0, ptrClass: MediaRouteProviderPtr, proxyClass: MediaRouteProviderProxy, stubClass: MediaRouteProviderStub, validateRequest: validateMediaRouteProviderRequest, validateResponse: validateMediaRouteProviderResponse, mojomId: 'chrome/common/media_router/mojo/media_router.mojom', fuzzMethods: { createRoute: { params: MediaRouteProvider_CreateRoute_Params, }, joinRoute: { params: MediaRouteProvider_JoinRoute_Params, }, connectRouteByRouteId: { params: MediaRouteProvider_ConnectRouteByRouteId_Params, }, terminateRoute: { params: MediaRouteProvider_TerminateRoute_Params, }, sendRouteMessage: { params: MediaRouteProvider_SendRouteMessage_Params, }, sendRouteBinaryMessage: { params: MediaRouteProvider_SendRouteBinaryMessage_Params, }, startObservingMediaSinks: { params: MediaRouteProvider_StartObservingMediaSinks_Params, }, stopObservingMediaSinks: { params: MediaRouteProvider_StopObservingMediaSinks_Params, }, startObservingMediaRoutes: { params: MediaRouteProvider_StartObservingMediaRoutes_Params, }, stopObservingMediaRoutes: { params: MediaRouteProvider_StopObservingMediaRoutes_Params, }, startListeningForRouteMessages: { params: MediaRouteProvider_StartListeningForRouteMessages_Params, }, stopListeningForRouteMessages: { params: MediaRouteProvider_StopListeningForRouteMessages_Params, }, detachRoute: { params: MediaRouteProvider_DetachRoute_Params, }, enableMdnsDiscovery: { params: MediaRouteProvider_EnableMdnsDiscovery_Params, }, updateMediaSinks: { params: MediaRouteProvider_UpdateMediaSinks_Params, }, searchSinks: { params: MediaRouteProvider_SearchSinks_Params, }, provideSinks: { params: MediaRouteProvider_ProvideSinks_Params, }, createMediaRouteController: { params: MediaRouteProvider_CreateMediaRouteController_Params, }, }, }; MediaRouteProvider.Id = {}; MediaRouteProvider.Id.EXTENSION = 0; MediaRouteProvider.Id.WIRED_DISPLAY = MediaRouteProvider.Id.EXTENSION + 1; MediaRouteProvider.Id.CAST = MediaRouteProvider.Id.WIRED_DISPLAY + 1; MediaRouteProvider.Id.DIAL = MediaRouteProvider.Id.CAST + 1; MediaRouteProvider.Id.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: return true; } return false; }; MediaRouteProvider.Id.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; MediaRouteProviderStub.prototype.validator = validateMediaRouteProviderRequest; MediaRouteProviderProxy.prototype.validator = validateMediaRouteProviderResponse; var kMediaRouter_RegisterMediaRouteProvider_Name = 111072298; var kMediaRouter_OnSinksReceived_Name = 2073161070; var kMediaRouter_OnIssue_Name = 1007204663; var kMediaRouter_OnRoutesUpdated_Name = 678726350; var kMediaRouter_OnSinkAvailabilityUpdated_Name = 430614635; var kMediaRouter_OnPresentationConnectionStateChanged_Name = 613222493; var kMediaRouter_OnPresentationConnectionClosed_Name = 1389619895; var kMediaRouter_OnRouteMessagesReceived_Name = 275740243; var kMediaRouter_OnMediaRemoterCreated_Name = 1827556450; var kMediaRouter_GetMediaSinkServiceStatus_Name = 1031521978; function MediaRouterPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(MediaRouter, handleOrPtrInfo); } function MediaRouterAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( MediaRouter, associatedInterfacePtrInfo); } MediaRouterAssociatedPtr.prototype = Object.create(MediaRouterPtr.prototype); MediaRouterAssociatedPtr.prototype.constructor = MediaRouterAssociatedPtr; function MediaRouterProxy(receiver) { this.receiver_ = receiver; } MediaRouterPtr.prototype.registerMediaRouteProvider = function() { return MediaRouterProxy.prototype.registerMediaRouteProvider .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.registerMediaRouteProvider = function(providerId, mediaRouterProvider) { var params_ = new MediaRouter_RegisterMediaRouteProvider_Params(); params_.providerId = providerId; params_.mediaRouterProvider = mediaRouterProvider; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouter_RegisterMediaRouteProvider_Name, codec.align(MediaRouter_RegisterMediaRouteProvider_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouter_RegisterMediaRouteProvider_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouter_RegisterMediaRouteProvider_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MediaRouterPtr.prototype.onSinksReceived = function() { return MediaRouterProxy.prototype.onSinksReceived .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onSinksReceived = function(providerId, mediaSource, sinks, origins) { var params_ = new MediaRouter_OnSinksReceived_Params(); params_.providerId = providerId; params_.mediaSource = mediaSource; params_.sinks = sinks; params_.origins = origins; var builder = new codec.MessageV0Builder( kMediaRouter_OnSinksReceived_Name, codec.align(MediaRouter_OnSinksReceived_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnSinksReceived_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onIssue = function() { return MediaRouterProxy.prototype.onIssue .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onIssue = function(issue) { var params_ = new MediaRouter_OnIssue_Params(); params_.issue = issue; var builder = new codec.MessageV0Builder( kMediaRouter_OnIssue_Name, codec.align(MediaRouter_OnIssue_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnIssue_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onRoutesUpdated = function() { return MediaRouterProxy.prototype.onRoutesUpdated .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onRoutesUpdated = function(providerId, routes, mediaSource, joinableRouteIds) { var params_ = new MediaRouter_OnRoutesUpdated_Params(); params_.providerId = providerId; params_.routes = routes; params_.mediaSource = mediaSource; params_.joinableRouteIds = joinableRouteIds; var builder = new codec.MessageV0Builder( kMediaRouter_OnRoutesUpdated_Name, codec.align(MediaRouter_OnRoutesUpdated_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnRoutesUpdated_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onSinkAvailabilityUpdated = function() { return MediaRouterProxy.prototype.onSinkAvailabilityUpdated .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onSinkAvailabilityUpdated = function(providerId, availability) { var params_ = new MediaRouter_OnSinkAvailabilityUpdated_Params(); params_.providerId = providerId; params_.availability = availability; var builder = new codec.MessageV0Builder( kMediaRouter_OnSinkAvailabilityUpdated_Name, codec.align(MediaRouter_OnSinkAvailabilityUpdated_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnSinkAvailabilityUpdated_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onPresentationConnectionStateChanged = function() { return MediaRouterProxy.prototype.onPresentationConnectionStateChanged .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onPresentationConnectionStateChanged = function(routeId, state) { var params_ = new MediaRouter_OnPresentationConnectionStateChanged_Params(); params_.routeId = routeId; params_.state = state; var builder = new codec.MessageV0Builder( kMediaRouter_OnPresentationConnectionStateChanged_Name, codec.align(MediaRouter_OnPresentationConnectionStateChanged_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnPresentationConnectionStateChanged_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onPresentationConnectionClosed = function() { return MediaRouterProxy.prototype.onPresentationConnectionClosed .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onPresentationConnectionClosed = function(routeId, reason, message) { var params_ = new MediaRouter_OnPresentationConnectionClosed_Params(); params_.routeId = routeId; params_.reason = reason; params_.message = message; var builder = new codec.MessageV0Builder( kMediaRouter_OnPresentationConnectionClosed_Name, codec.align(MediaRouter_OnPresentationConnectionClosed_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnPresentationConnectionClosed_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onRouteMessagesReceived = function() { return MediaRouterProxy.prototype.onRouteMessagesReceived .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onRouteMessagesReceived = function(routeId, messages) { var params_ = new MediaRouter_OnRouteMessagesReceived_Params(); params_.routeId = routeId; params_.messages = messages; var builder = new codec.MessageV0Builder( kMediaRouter_OnRouteMessagesReceived_Name, codec.align(MediaRouter_OnRouteMessagesReceived_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnRouteMessagesReceived_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.onMediaRemoterCreated = function() { return MediaRouterProxy.prototype.onMediaRemoterCreated .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.onMediaRemoterCreated = function(tabId, remoter, remotingSource) { var params_ = new MediaRouter_OnMediaRemoterCreated_Params(); params_.tabId = tabId; params_.remoter = remoter; params_.remotingSource = remotingSource; var builder = new codec.MessageV0Builder( kMediaRouter_OnMediaRemoterCreated_Name, codec.align(MediaRouter_OnMediaRemoterCreated_Params.encodedSize)); builder.encodeStruct(MediaRouter_OnMediaRemoterCreated_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MediaRouterPtr.prototype.getMediaSinkServiceStatus = function() { return MediaRouterProxy.prototype.getMediaSinkServiceStatus .apply(this.ptr.getProxy(), arguments); }; MediaRouterProxy.prototype.getMediaSinkServiceStatus = function() { var params_ = new MediaRouter_GetMediaSinkServiceStatus_Params(); return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMediaRouter_GetMediaSinkServiceStatus_Name, codec.align(MediaRouter_GetMediaSinkServiceStatus_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MediaRouter_GetMediaSinkServiceStatus_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MediaRouter_GetMediaSinkServiceStatus_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; function MediaRouterStub(delegate) { this.delegate_ = delegate; } MediaRouterStub.prototype.registerMediaRouteProvider = function(providerId, mediaRouterProvider) { return this.delegate_ && this.delegate_.registerMediaRouteProvider && this.delegate_.registerMediaRouteProvider(providerId, mediaRouterProvider); } MediaRouterStub.prototype.onSinksReceived = function(providerId, mediaSource, sinks, origins) { return this.delegate_ && this.delegate_.onSinksReceived && this.delegate_.onSinksReceived(providerId, mediaSource, sinks, origins); } MediaRouterStub.prototype.onIssue = function(issue) { return this.delegate_ && this.delegate_.onIssue && this.delegate_.onIssue(issue); } MediaRouterStub.prototype.onRoutesUpdated = function(providerId, routes, mediaSource, joinableRouteIds) { return this.delegate_ && this.delegate_.onRoutesUpdated && this.delegate_.onRoutesUpdated(providerId, routes, mediaSource, joinableRouteIds); } MediaRouterStub.prototype.onSinkAvailabilityUpdated = function(providerId, availability) { return this.delegate_ && this.delegate_.onSinkAvailabilityUpdated && this.delegate_.onSinkAvailabilityUpdated(providerId, availability); } MediaRouterStub.prototype.onPresentationConnectionStateChanged = function(routeId, state) { return this.delegate_ && this.delegate_.onPresentationConnectionStateChanged && this.delegate_.onPresentationConnectionStateChanged(routeId, state); } MediaRouterStub.prototype.onPresentationConnectionClosed = function(routeId, reason, message) { return this.delegate_ && this.delegate_.onPresentationConnectionClosed && this.delegate_.onPresentationConnectionClosed(routeId, reason, message); } MediaRouterStub.prototype.onRouteMessagesReceived = function(routeId, messages) { return this.delegate_ && this.delegate_.onRouteMessagesReceived && this.delegate_.onRouteMessagesReceived(routeId, messages); } MediaRouterStub.prototype.onMediaRemoterCreated = function(tabId, remoter, remotingSource) { return this.delegate_ && this.delegate_.onMediaRemoterCreated && this.delegate_.onMediaRemoterCreated(tabId, remoter, remotingSource); } MediaRouterStub.prototype.getMediaSinkServiceStatus = function() { return this.delegate_ && this.delegate_.getMediaSinkServiceStatus && this.delegate_.getMediaSinkServiceStatus(); } MediaRouterStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMediaRouter_OnSinksReceived_Name: var params = reader.decodeStruct(MediaRouter_OnSinksReceived_Params); this.onSinksReceived(params.providerId, params.mediaSource, params.sinks, params.origins); return true; case kMediaRouter_OnIssue_Name: var params = reader.decodeStruct(MediaRouter_OnIssue_Params); this.onIssue(params.issue); return true; case kMediaRouter_OnRoutesUpdated_Name: var params = reader.decodeStruct(MediaRouter_OnRoutesUpdated_Params); this.onRoutesUpdated(params.providerId, params.routes, params.mediaSource, params.joinableRouteIds); return true; case kMediaRouter_OnSinkAvailabilityUpdated_Name: var params = reader.decodeStruct(MediaRouter_OnSinkAvailabilityUpdated_Params); this.onSinkAvailabilityUpdated(params.providerId, params.availability); return true; case kMediaRouter_OnPresentationConnectionStateChanged_Name: var params = reader.decodeStruct(MediaRouter_OnPresentationConnectionStateChanged_Params); this.onPresentationConnectionStateChanged(params.routeId, params.state); return true; case kMediaRouter_OnPresentationConnectionClosed_Name: var params = reader.decodeStruct(MediaRouter_OnPresentationConnectionClosed_Params); this.onPresentationConnectionClosed(params.routeId, params.reason, params.message); return true; case kMediaRouter_OnRouteMessagesReceived_Name: var params = reader.decodeStruct(MediaRouter_OnRouteMessagesReceived_Params); this.onRouteMessagesReceived(params.routeId, params.messages); return true; case kMediaRouter_OnMediaRemoterCreated_Name: var params = reader.decodeStruct(MediaRouter_OnMediaRemoterCreated_Params); this.onMediaRemoterCreated(params.tabId, params.remoter, params.remotingSource); return true; default: return false; } }; MediaRouterStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMediaRouter_RegisterMediaRouteProvider_Name: var params = reader.decodeStruct(MediaRouter_RegisterMediaRouteProvider_Params); this.registerMediaRouteProvider(params.providerId, params.mediaRouterProvider).then(function(response) { var responseParams = new MediaRouter_RegisterMediaRouteProvider_ResponseParams(); responseParams.instanceId = response.instanceId; responseParams.config = response.config; var builder = new codec.MessageV1Builder( kMediaRouter_RegisterMediaRouteProvider_Name, codec.align(MediaRouter_RegisterMediaRouteProvider_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouter_RegisterMediaRouteProvider_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMediaRouter_GetMediaSinkServiceStatus_Name: var params = reader.decodeStruct(MediaRouter_GetMediaSinkServiceStatus_Params); this.getMediaSinkServiceStatus().then(function(response) { var responseParams = new MediaRouter_GetMediaSinkServiceStatus_ResponseParams(); responseParams.status = response.status; var builder = new codec.MessageV1Builder( kMediaRouter_GetMediaSinkServiceStatus_Name, codec.align(MediaRouter_GetMediaSinkServiceStatus_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MediaRouter_GetMediaSinkServiceStatus_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; default: return false; } }; function validateMediaRouterRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMediaRouter_RegisterMediaRouteProvider_Name: if (message.expectsResponse()) paramsClass = MediaRouter_RegisterMediaRouteProvider_Params; break; case kMediaRouter_OnSinksReceived_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnSinksReceived_Params; break; case kMediaRouter_OnIssue_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnIssue_Params; break; case kMediaRouter_OnRoutesUpdated_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnRoutesUpdated_Params; break; case kMediaRouter_OnSinkAvailabilityUpdated_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnSinkAvailabilityUpdated_Params; break; case kMediaRouter_OnPresentationConnectionStateChanged_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnPresentationConnectionStateChanged_Params; break; case kMediaRouter_OnPresentationConnectionClosed_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnPresentationConnectionClosed_Params; break; case kMediaRouter_OnRouteMessagesReceived_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnRouteMessagesReceived_Params; break; case kMediaRouter_OnMediaRemoterCreated_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaRouter_OnMediaRemoterCreated_Params; break; case kMediaRouter_GetMediaSinkServiceStatus_Name: if (message.expectsResponse()) paramsClass = MediaRouter_GetMediaSinkServiceStatus_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateMediaRouterResponse(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMediaRouter_RegisterMediaRouteProvider_Name: if (message.isResponse()) paramsClass = MediaRouter_RegisterMediaRouteProvider_ResponseParams; break; case kMediaRouter_GetMediaSinkServiceStatus_Name: if (message.isResponse()) paramsClass = MediaRouter_GetMediaSinkServiceStatus_ResponseParams; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } var MediaRouter = { name: 'media_router.mojom.MediaRouter', kVersion: 0, ptrClass: MediaRouterPtr, proxyClass: MediaRouterProxy, stubClass: MediaRouterStub, validateRequest: validateMediaRouterRequest, validateResponse: validateMediaRouterResponse, mojomId: 'chrome/common/media_router/mojo/media_router.mojom', fuzzMethods: { registerMediaRouteProvider: { params: MediaRouter_RegisterMediaRouteProvider_Params, }, onSinksReceived: { params: MediaRouter_OnSinksReceived_Params, }, onIssue: { params: MediaRouter_OnIssue_Params, }, onRoutesUpdated: { params: MediaRouter_OnRoutesUpdated_Params, }, onSinkAvailabilityUpdated: { params: MediaRouter_OnSinkAvailabilityUpdated_Params, }, onPresentationConnectionStateChanged: { params: MediaRouter_OnPresentationConnectionStateChanged_Params, }, onPresentationConnectionClosed: { params: MediaRouter_OnPresentationConnectionClosed_Params, }, onRouteMessagesReceived: { params: MediaRouter_OnRouteMessagesReceived_Params, }, onMediaRemoterCreated: { params: MediaRouter_OnMediaRemoterCreated_Params, }, getMediaSinkServiceStatus: { params: MediaRouter_GetMediaSinkServiceStatus_Params, }, }, }; MediaRouter.SinkAvailability = {}; MediaRouter.SinkAvailability.UNAVAILABLE = 0; MediaRouter.SinkAvailability.PER_SOURCE = MediaRouter.SinkAvailability.UNAVAILABLE + 1; MediaRouter.SinkAvailability.AVAILABLE = MediaRouter.SinkAvailability.PER_SOURCE + 1; MediaRouter.SinkAvailability.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: return true; } return false; }; MediaRouter.SinkAvailability.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; MediaRouter.PresentationConnectionState = {}; MediaRouter.PresentationConnectionState.CONNECTING = 0; MediaRouter.PresentationConnectionState.CONNECTED = MediaRouter.PresentationConnectionState.CONNECTING + 1; MediaRouter.PresentationConnectionState.CLOSED = MediaRouter.PresentationConnectionState.CONNECTED + 1; MediaRouter.PresentationConnectionState.TERMINATED = MediaRouter.PresentationConnectionState.CLOSED + 1; MediaRouter.PresentationConnectionState.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: return true; } return false; }; MediaRouter.PresentationConnectionState.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; MediaRouter.PresentationConnectionCloseReason = {}; MediaRouter.PresentationConnectionCloseReason.CONNECTION_ERROR = 0; MediaRouter.PresentationConnectionCloseReason.CLOSED = MediaRouter.PresentationConnectionCloseReason.CONNECTION_ERROR + 1; MediaRouter.PresentationConnectionCloseReason.WENT_AWAY = MediaRouter.PresentationConnectionCloseReason.CLOSED + 1; MediaRouter.PresentationConnectionCloseReason.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: return true; } return false; }; MediaRouter.PresentationConnectionCloseReason.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; MediaRouterStub.prototype.validator = validateMediaRouterRequest; MediaRouterProxy.prototype.validator = validateMediaRouterResponse; exports.SinkIconType = SinkIconType; exports.RouteControllerType = RouteControllerType; exports.RouteRequestResultCode = RouteRequestResultCode; exports.MediaSink = MediaSink; exports.DialMediaSink = DialMediaSink; exports.CastMediaSink = CastMediaSink; exports.MediaRoute = MediaRoute; exports.Issue = Issue; exports.RouteMessage = RouteMessage; exports.SinkSearchCriteria = SinkSearchCriteria; exports.MediaRouteProviderConfig = MediaRouteProviderConfig; exports.MediaSinkExtraData = MediaSinkExtraData; exports.MediaRouteProvider = MediaRouteProvider; exports.MediaRouteProviderPtr = MediaRouteProviderPtr; exports.MediaRouteProviderAssociatedPtr = MediaRouteProviderAssociatedPtr; exports.MediaRouter = MediaRouter; exports.MediaRouterPtr = MediaRouterPtr; exports.MediaRouterAssociatedPtr = MediaRouterAssociatedPtr; })();// Copyright 2015 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'; if ((typeof mojo === 'undefined') || !mojo.bindingsLibraryInitialized) { loadScript('mojo_bindings'); } mojo.config.autoLoadMojomDeps = false; loadScript('chrome/common/media_router/mojo/media_controller.mojom'); loadScript('chrome/common/media_router/mojo/media_router.mojom'); loadScript('chrome/common/media_router/mojo/media_status.mojom'); loadScript('extensions/common/mojo/keep_alive.mojom'); loadScript('media/mojo/interfaces/mirror_service_remoting.mojom'); loadScript('media/mojo/interfaces/remoting_common.mojom'); loadScript('mojo/public/mojom/base/time.mojom'); loadScript('net/interfaces/ip_address.mojom'); loadScript('net/interfaces/ip_endpoint.mojom'); loadScript('url/mojom/origin.mojom'); loadScript('url/mojom/url.mojom'); // The following adapter classes preserve backward compatibility for the media // router component extension. // TODO(crbug.com/787128): Remove these adapters. function assignFields(object, fields) { for(var field in fields) { if (object.hasOwnProperty(field)) object[field] = fields[field]; } } /** * Adapter for mediaRouter.mojom.DialMediaSink. * @constructor */ function DialMediaSinkAdapter(fields) { this.ip_address = null; this.model_name = null; this.app_url = null; assignFields(this, fields); } DialMediaSinkAdapter.fromNewVersion = function(other) { return new DialMediaSinkAdapter({ 'ip_address': IPAddressAdapter.fromNewVersion(other.ipAddress), 'model_name': other.modelName, 'app_url': other.appUrl, }); }; DialMediaSinkAdapter.prototype.toNewVersion = function() { return new mediaRouter.mojom.DialMediaSink({ 'ipAddress' : this.ip_address.toNewVersion(), 'modelName' : this.model_name, 'appUrl' : this.app_url, }); }; /** * Adapter for mediaRouter.mojom.CastMediaSink. * @constructor */ function CastMediaSinkAdapter(fields) { this.ip_endpoint = null; this.model_name = null; this.capabilities = 0; this.cast_channel_id = 0; assignFields(this, fields); } CastMediaSinkAdapter.fromNewVersion = function(other) { return new CastMediaSinkAdapter({ 'ip_endpoint': IPEndpointAdapter.fromNewVersion(other.ipEndpoint), 'model_name': other.modelName, 'capabilities': other.capabilities, 'cast_channel_id': other.castChannelId, }); }; CastMediaSinkAdapter.prototype.toNewVersion = function() { return new mediaRouter.mojom.CastMediaSink({ 'ipEndpoint': this.ip_endpoint.toNewVersion(), 'modelName': this.model_name, 'capabilities': this.capabilities, 'castChannelId': this.cast_channel_id, }); }; /** * Adapter for mediaRouter.mojom.HangoutsMediaStatusExtraData. * @constructor */ function HangoutsMediaStatusExtraDataAdapter(fields) { this.local_present = false; assignFields(this, fields); } HangoutsMediaStatusExtraDataAdapter.prototype.toNewVersion = function() { return new mediaRouter.mojom.HangoutsMediaStatusExtraData({ 'localPresent': this.local_present, }); }; /** * Adapter for net.interfaces.IPAddress. * @constructor */ function IPAddressAdapter(fields) { this.address_bytes = null; assignFields(this, fields); } IPAddressAdapter.fromNewVersion = function(other) { return new IPAddressAdapter({ 'address_bytes': other.addressBytes, }); }; IPAddressAdapter.prototype.toNewVersion = function() { return new net.interfaces.IPAddress({ 'addressBytes': this.address_bytes, }); }; /** * Adapter for net.interfaces.IPEndpoint. * @constructor */ function IPEndpointAdapter(fields) { this.address = null; this.port = 0; assignFields(this, fields); } IPEndpointAdapter.fromNewVersion = function(other) { return new IPEndpointAdapter({ 'address': IPAddressAdapter.fromNewVersion(other.address), 'port': other.port, }); }; IPEndpointAdapter.prototype.toNewVersion = function() { return new net.interfaces.IPEndpoint({ 'address': this.address.toNewVersion(), 'port': this.port, }); }; /** * Adapter for mediaRouter.mojom.MediaStatus. * @constructor */ function MediaStatusAdapter(fields) { this.title = null; this.can_play_pause = false; this.can_mute = false; this.can_set_volume = false; this.can_seek = false; this.is_muted = false; this.play_state = 0; this.volume = 0; this.duration = null; this.current_time = null; this.hangouts_extra_data = null; assignFields(this, fields); } MediaStatusAdapter.PlayState = mediaRouter.mojom.MediaStatus.PlayState; MediaStatusAdapter.prototype.toNewVersion = function() { return new mediaRouter.mojom.MediaStatus({ 'title': this.title, 'canPlayPause': this.can_play_pause, 'canMute': this.can_mute, 'canSetVolume': this.can_set_volume, 'canSeek': this.can_seek, 'isMuted': this.is_muted, 'playState': this.play_state, 'volume': this.volume, 'duration': this.duration, 'currentTime': this.current_time, 'hangoutsExtraData': this.hangouts_extra_data && this.hangouts_extra_data.toNewVersion(), }); }; /** * Adapter for media.mojom.RemotingSinkMetadata. * @constructor */ function RemotingSinkMetadataAdapter(fields) { this.features = null; this.audio_capabilities = null; this.video_capabilities = null; this.friendly_name = null; assignFields(this, fields); } RemotingSinkMetadataAdapter.fromNewVersion = function(other) { return new RemotingSinkMetadataAdapter({ 'features': other.features, 'audio_capabilities': other.audioCapabilities, 'video_capabilities': other.videoCapabilities, 'friendly_name': other.friendlyName, }); }; RemotingSinkMetadataAdapter.prototype.toNewVersion = function() { return new media.mojom.RemotingSinkMetadata({ 'features': this.features, 'audioCapabilities': this.audio_capabilities, 'videoCapabilities': this.video_capabilities, 'friendlyName': this.friendly_name, }); }; /** * Adapter for mediaRouter.mojom.MediaSink. * @constructor */ function MediaSinkAdapter(fields) { this.sink_id = null; this.name = null; this.description = null; this.domain = null; this.icon_type = 0; this.extra_data = null; assignFields(this, fields); } MediaSinkAdapter.fromNewVersion = function(other) { return new MediaSinkAdapter({ 'sink_id': other.sinkId, 'name': other.name, 'description': other.description, 'domain': other.domain, 'icon_type': other.iconType, 'extra_data': other.extraData && MediaSinkExtraDataAdapter.fromNewVersion(other.extraData), }); }; MediaSinkAdapter.prototype.toNewVersion = function() { return new mediaRouter.mojom.MediaSink({ 'sinkId': this.sink_id, 'name': this.name, 'description': this.description, 'domain': this.domain, 'iconType': this.icon_type, 'extraData': this.extra_data && this.extra_data.toNewVersion(), }); }; /** * Adapter for mediaRouter.mojom.MediaSinkExtraData. * @constructor */ function MediaSinkExtraDataAdapter(value) { this.$data = null; this.$tag = undefined; if (value == undefined) { return; } var keys = Object.keys(value); if (keys.length == 0) { return; } if (keys.length > 1) { throw new TypeError('You may set only one member on a union.'); } var fields = [ 'dial_media_sink', 'cast_media_sink', ]; if (fields.indexOf(keys[0]) < 0) { throw new ReferenceError(keys[0] + ' is not a MediaSinkExtraDataAdapter member.'); } this[keys[0]] = value[keys[0]]; } MediaSinkExtraDataAdapter.Tags = { dial_media_sink: 0, cast_media_sink: 1, }; Object.defineProperty(MediaSinkExtraDataAdapter.prototype, 'dial_media_sink', { get: function() { if (this.$tag != MediaSinkExtraDataAdapter.Tags.dial_media_sink) { throw new ReferenceError( 'MediaSinkExtraDataAdapter.dial_media_sink is not currently set.'); } return this.$data; }, set: function(value) { this.$tag = MediaSinkExtraDataAdapter.Tags.dial_media_sink; this.$data = value; } }); Object.defineProperty(MediaSinkExtraDataAdapter.prototype, 'cast_media_sink', { get: function() { if (this.$tag != MediaSinkExtraDataAdapter.Tags.cast_media_sink) { throw new ReferenceError( 'MediaSinkExtraDataAdapter.cast_media_sink is not currently set.'); } return this.$data; }, set: function(value) { this.$tag = MediaSinkExtraDataAdapter.Tags.cast_media_sink; this.$data = value; } }); MediaSinkExtraDataAdapter.fromNewVersion = function(other) { if (other.$tag == mediaRouter.mojom.MediaSinkExtraData.Tags.dialMediaSink) { return new MediaSinkExtraDataAdapter({ 'dial_media_sink': DialMediaSinkAdapter.fromNewVersion(other.dialMediaSink), }); } else { return new MediaSinkExtraDataAdapter({ 'cast_media_sink': CastMediaSinkAdapter.fromNewVersion(other.castMediaSink), }); } }; MediaSinkExtraDataAdapter.prototype.toNewVersion = function() { if (this.$tag == MediaSinkExtraDataAdapter.Tags.dial_media_sink) { return new mediaRouter.mojom.MediaSinkExtraData({ 'dialMediaSink': this.dial_media_sink.toNewVersion(), }); } else { return new mediaRouter.mojom.MediaSinkExtraData({ 'castMediaSink': this.cast_media_sink.toNewVersion(), }); } }; /** * Adapter for media.mojom.MirrorServiceRemoterPtr. * @constructor */ function MirrorServiceRemoterPtrAdapter(handleOrPtrInfo) { this.ptr = new mojo.InterfacePtrController(MirrorServiceRemoterAdapter, handleOrPtrInfo); } MirrorServiceRemoterPtrAdapter.prototype = Object.create(media.mojom.MirrorServiceRemoterPtr.prototype); MirrorServiceRemoterPtrAdapter.prototype.constructor = MirrorServiceRemoterPtrAdapter; MirrorServiceRemoterPtrAdapter.prototype.startDataStreams = function() { return MirrorServiceRemoterProxy.prototype.startDataStreams .apply(this.ptr.getProxy(), arguments).then(function(response) { return Promise.resolve({ 'audio_stream_id': response.audioStreamId, 'video_stream_id': response.videoStreamId, }); }); }; /** * Adapter for media.mojom.MirrorServiceRemoter.stubclass. * @constructor */ function MirrorServiceRemoterStubAdapter(delegate) { this.delegate_ = delegate; } MirrorServiceRemoterStubAdapter.prototype = Object.create( media.mojom.MirrorServiceRemoter.stubClass.prototype); MirrorServiceRemoterStubAdapter.prototype.constructor = MirrorServiceRemoterStubAdapter; MirrorServiceRemoterStubAdapter.prototype.startDataStreams = function(hasAudio, hasVideo) { return this.delegate_ && this.delegate_.startDataStreams && this.delegate_.startDataStreams(hasAudio, hasVideo).then( function(response) { return { 'audioStreamId': response.audio_stream_id, 'videoStreamId': response.video_stream_id, }; }); }; /** * Adapter for media.mojom.MirrorServiceRemoter. */ var MirrorServiceRemoterAdapter = { name: 'media.mojom.MirrorServiceRemoter', kVersion: 0, ptrClass: MirrorServiceRemoterPtrAdapter, proxyClass: media.mojom.MirrorServiceRemoter.proxyClass, stubClass: MirrorServiceRemoterStubAdapter, validateRequest: media.mojom.MirrorServiceRemoter.validateRequest, validateResponse: media.mojom.MirrorServiceRemoter.validateResponse, }; /** * Adapter for media.mojom.MirrorServiceRemotingSourcePtr. * @constructor */ function MirrorServiceRemotingSourcePtrAdapter(handleOrPtrInfo) { this.ptr = new mojo.InterfacePtrController(MirrorServiceRemotingSourceAdapter, handleOrPtrInfo); } MirrorServiceRemotingSourcePtrAdapter.prototype = Object.create(media.mojom.MirrorServiceRemotingSourcePtr.prototype); MirrorServiceRemotingSourcePtrAdapter.prototype.constructor = MirrorServiceRemotingSourcePtrAdapter; MirrorServiceRemotingSourcePtrAdapter.prototype.onSinkAvailable = function(metadata) { return this.ptr.getProxy().onSinkAvailable(metadata.toNewVersion()); }; /** * Adapter for media.mojom.MirrorServiceRemotingSource. */ var MirrorServiceRemotingSourceAdapter = { name: 'media.mojom.MirrorServiceRemotingSource', kVersion: 0, ptrClass: MirrorServiceRemotingSourcePtrAdapter, proxyClass: media.mojom.MirrorServiceRemotingSource.proxyClass, stubClass: null, validateRequest: media.mojom.MirrorServiceRemotingSource.validateRequest, validateResponse: null, }; /** * Adapter for mediaRouter.mojom.MediaStatusObserver. * @constructor */ function MediaStatusObserverPtrAdapter(handleOrPtrInfo) { this.ptr = new mojo.InterfacePtrController(MediaStatusObserverAdapter, handleOrPtrInfo); } MediaStatusObserverPtrAdapter.prototype = Object.create(mediaRouter.mojom.MediaStatusObserverPtr.prototype); MediaStatusObserverPtrAdapter.prototype.constructor = MediaStatusObserverPtrAdapter; MediaStatusObserverPtrAdapter.prototype.onMediaStatusUpdated = function(status) { return this.ptr.getProxy().onMediaStatusUpdated(status.toNewVersion()); }; /** * Adapter for mediaRouter.mojom.MediaStatusObserver. */ var MediaStatusObserverAdapter = { name: 'mediaRouter.mojom.MediaStatusObserver', kVersion: 0, ptrClass: MediaStatusObserverPtrAdapter, proxyClass: mediaRouter.mojom.MediaStatusObserver.proxyClass, stubClass: null, validateRequest: mediaRouter.mojom.MediaStatusObserver.validateRequest, validateResponse: null, }; /** * Converts a media sink to a MediaSink Mojo object. * @param {!MediaSink} sink A media sink. * @return {!mediaRouter.mojom.MediaSink} A Mojo MediaSink object. */ function sinkToMojo_(sink) { return new mediaRouter.mojom.MediaSink({ 'name': sink.friendlyName, 'description': sink.description, 'domain': sink.domain, 'sinkId': sink.id, 'iconType': sinkIconTypeToMojo(sink.iconType), 'providerId': mediaRouter.mojom.MediaRouteProvider.Id.EXTENSION, }); } /** * Converts a media sink's icon type to a MediaSink.IconType Mojo object. * @param {!MediaSink.IconType} type A media sink's icon type. * @return {!mediaRouter.mojom.MediaSink.IconType} A Mojo MediaSink.IconType * object. */ function sinkIconTypeToMojo(type) { switch (type) { case 'cast': return mediaRouter.mojom.SinkIconType.CAST; case 'cast_audio_group': return mediaRouter.mojom.SinkIconType.CAST_AUDIO_GROUP; case 'cast_audio': return mediaRouter.mojom.SinkIconType.CAST_AUDIO; case 'meeting': return mediaRouter.mojom.SinkIconType.MEETING; case 'hangout': return mediaRouter.mojom.SinkIconType.HANGOUT; case 'education': return mediaRouter.mojom.SinkIconType.EDUCATION; case 'generic': return mediaRouter.mojom.SinkIconType.GENERIC; default: console.error('Unknown sink icon type : ' + type); return mediaRouter.mojom.SinkIconType.GENERIC; } } /** * Returns a Mojo MediaRoute object given a MediaRoute and a * media sink name. * @param {!MediaRoute} route * @return {!mediaRouter.mojom.MediaRoute} */ function routeToMojo_(route) { return new mediaRouter.mojom.MediaRoute({ 'mediaRouteId': route.id, 'mediaSource': route.mediaSource, 'mediaSinkId': route.sinkId, 'description': route.description, 'iconUrl': route.iconUrl, 'isLocal': route.isLocal, 'forDisplay': route.forDisplay, 'isIncognito': route.offTheRecord, 'isLocalPresentation': route.isOffscreenPresentation, 'controllerType': route.controllerType, // Begin newly added properties, followed by the milestone they were // added. The guard should be safe to remove N+2 milestones later. 'presentationId': route.presentationId || '' // M64 }); } /** * Converts a route message to a RouteMessage Mojo object. * @param {!RouteMessage} message * @return {!mediaRouter.mojom.RouteMessage} A Mojo RouteMessage object. */ function messageToMojo_(message) { if ("string" == typeof message.message) { return new mediaRouter.mojom.RouteMessage({ 'type': mediaRouter.mojom.RouteMessage.Type.TEXT, 'message': message.message, }); } else { return new mediaRouter.mojom.RouteMessage({ 'type': mediaRouter.mojom.RouteMessage.Type.BINARY, 'data': message.message, }); } } /** * Converts presentation connection state to Mojo enum value. * @param {!string} state * @return {!mediaRouter.mojom.MediaRouter.PresentationConnectionState} */ function presentationConnectionStateToMojo_(state) { var PresentationConnectionState = mediaRouter.mojom.MediaRouter.PresentationConnectionState; switch (state) { case 'connecting': return PresentationConnectionState.CONNECTING; case 'connected': return PresentationConnectionState.CONNECTED; case 'closed': return PresentationConnectionState.CLOSED; case 'terminated': return PresentationConnectionState.TERMINATED; default: console.error('Unknown presentation connection state: ' + state); return PresentationConnectionState.TERMINATED; } } /** * Converts presentation connection close reason to Mojo enum value. * @param {!string} reason * @return {!mediaRouter.mojom.MediaRouter.PresentationConnectionCloseReason} */ function presentationConnectionCloseReasonToMojo_(reason) { var PresentationConnectionCloseReason = mediaRouter.mojom.MediaRouter.PresentationConnectionCloseReason; switch (reason) { case 'error': return PresentationConnectionCloseReason.CONNECTION_ERROR; case 'closed': return PresentationConnectionCloseReason.CLOSED; case 'went_away': return PresentationConnectionCloseReason.WENT_AWAY; default: console.error('Unknown presentation connection close reason : ' + reason); return PresentationConnectionCloseReason.CONNECTION_ERROR; } } /** * Converts string to Mojo origin. * @param {string|!url.mojom.Origin} origin * @return {!url.mojom.Origin} */ function stringToMojoOrigin_(origin) { if (origin instanceof url.mojom.Origin) { return origin; } var originUrl = new URL(origin); var mojoOrigin = {}; mojoOrigin.scheme = originUrl.protocol.replace(':', ''); mojoOrigin.host = originUrl.hostname; var port = originUrl.port ? Number.parseInt(originUrl.port) : 0; switch (mojoOrigin.scheme) { case 'http': mojoOrigin.port = port || 80; break; case 'https': mojoOrigin.port = port || 443; break; default: throw new Error('Scheme must be http or https'); } mojoOrigin.suborigin = ''; return new url.mojom.Origin(mojoOrigin); } /** * Parses the given route request Error object and converts it to the * corresponding result code. * @param {!Error} error * @return {!mediaRouter.mojom.RouteRequestResultCode} */ function getRouteRequestResultCode_(error) { return error.errorCode ? error.errorCode : mediaRouter.mojom.RouteRequestResultCode.UNKNOWN_ERROR; } /** * Creates and returns a successful route response from given route. * @param {!MediaRoute} route * @return {!Object} */ function toSuccessRouteResponse_(route) { return { route: routeToMojo_(route), resultCode: mediaRouter.mojom.RouteRequestResultCode.OK }; } /** * Creates and returns a error route response from given Error object. * @param {!Error} error * @return {!Object} */ function toErrorRouteResponse_(error) { return { errorText: error.message, resultCode: getRouteRequestResultCode_(error) }; } /** * Creates a new MediaRouter. * Converts a route struct to its Mojo form. * @param {!mediaRouter.mojom.MediaRouterPtr} service * @constructor */ function MediaRouter(service) { /** * The Mojo service proxy. Allows extension code to call methods that reside * in the browser. * @type {!mediaRouter.mojom.MediaRouterPtr} */ this.service_ = service; /** * The provider manager service delegate. Its methods are called by the * browser-resident Mojo service. * @type {!MediaRouter} */ this.mrpm_ = new MediaRouteProvider(this); /** * Handle to a KeepAlive service object, which prevents the extension from * being suspended as long as it remains in scope. * @type {boolean} */ this.keepAlive_ = null; /** * The bindings to bind the service delegate to the Mojo interface. * Object must remain in scope for the lifetime of the connection to * prevent the connection from closing automatically. * @type {!mojo.Binding} */ this.mediaRouteProviderBinding_ = new mojo.Binding( mediaRouter.mojom.MediaRouteProvider, this.mrpm_); } /** * Returns definitions of Mojo core and generated Mojom classes that can be * used directly by the component. * @return {!Object} * TODO(imcheng): We should export these along with MediaRouter. This requires * us to modify the component to handle multiple exports. When that logic is * baked in for a couple of milestones, we should be able to remove this * method. * TODO(imcheng): We should stop exporting mojo bindings classes that the * Media Router extension doesn't directly use, such as * mojo.AssociatedInterfacePtrInfo, mojo.InterfacePtrController and * mojo.interfaceControl. */ MediaRouter.prototype.getMojoExports = function() { return { AssociatedInterfacePtrInfo: mojo.AssociatedInterfacePtrInfo, Binding: mojo.Binding, DialMediaSink: DialMediaSinkAdapter, CastMediaSink: CastMediaSinkAdapter, HangoutsMediaRouteController: mediaRouter.mojom.HangoutsMediaRouteController, HangoutsMediaStatusExtraData: HangoutsMediaStatusExtraDataAdapter, IPAddress: IPAddressAdapter, IPEndpoint: IPEndpointAdapter, InterfacePtrController: mojo.InterfacePtrController, InterfacePtrInfo: mojo.InterfacePtrInfo, InterfaceRequest: mojo.InterfaceRequest, MediaController: mediaRouter.mojom.MediaController, MediaStatus: MediaStatusAdapter, MediaStatusObserverPtr: mediaRouter.mojom.MediaStatusObserverPtr, MirrorServiceRemoter: MirrorServiceRemoterAdapter, MirrorServiceRemoterPtr: MirrorServiceRemoterPtrAdapter, MirrorServiceRemotingSourcePtr: MirrorServiceRemotingSourcePtrAdapter, RemotingStopReason: media.mojom.RemotingStopReason, RemotingStartFailReason: media.mojom.RemotingStartFailReason, RemotingSinkFeature: media.mojom.RemotingSinkFeature, RemotingSinkAudioCapability: media.mojom.RemotingSinkAudioCapability, RemotingSinkVideoCapability: media.mojom.RemotingSinkVideoCapability, RemotingSinkMetadata: RemotingSinkMetadataAdapter, RouteControllerType: mediaRouter.mojom.RouteControllerType, Origin: url.mojom.Origin, Sink: MediaSinkAdapter, SinkExtraData: MediaSinkExtraDataAdapter, TimeDelta: mojoBase.mojom.TimeDelta, Url: url.mojom.Url, interfaceControl: mojo.interfaceControl, makeRequest: mojo.makeRequest, }; }; /** * Registers the Media Router Provider Manager with the Media Router. * @return {!Promise} Instance ID and config for the Media Router. */ MediaRouter.prototype.start = function() { return this.service_.registerMediaRouteProvider( mediaRouter.mojom.MediaRouteProvider.Id.EXTENSION, this.mediaRouteProviderBinding_.createInterfacePtrAndBind()).then( function(response) { return { 'instance_id': response.instanceId, 'config': { 'enable_dial_discovery': response.config.enableDialDiscovery, 'enable_cast_discovery': response.config.enableCastDiscovery, 'enable_dial_sink_query': response.config.enableDialSinkQuery, 'enable_cast_sink_query': response.config.enableCastSinkQuery, } }; }); } /** * Sets the service delegate methods. * @param {Object} handlers */ MediaRouter.prototype.setHandlers = function(handlers) { this.mrpm_.setHandlers(handlers); } /** * The keep alive status. * @return {boolean} */ MediaRouter.prototype.getKeepAlive = function() { return this.keepAlive_ != null; }; /** * Called by the provider manager when a sink list for a given source is * updated. * @param {!string} sourceUrn * @param {!Array} sinks * @param {!Array} origins */ MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks, origins) { // |origins| is a string array if the Media Router component extension version // is 59 or older. Without the stringToMojoOrigin_() conversion, clients using // those extension versions would see a crash shown in // https://crbug.com/787427. this.service_.onSinksReceived( mediaRouter.mojom.MediaRouteProvider.Id.EXTENSION, sourceUrn, sinks.map(sinkToMojo_), origins.map(stringToMojoOrigin_)); }; /** * Called by the provider manager when a sink is found to notify the MR of the * sink's ID. The actual sink will be returned through the normal sink list * update process, so this helps the MR identify the search result in the * list. * @param {string} pseudoSinkId ID of the pseudo sink that started the * search. * @param {string} sinkId ID of the newly-found sink. */ MediaRouter.prototype.onSearchSinkIdReceived = function( pseudoSinkId, sinkId) { this.service_.onSearchSinkIdReceived(pseudoSinkId, sinkId); }; /** * Called by the provider manager to keep the extension from suspending * if it enters a state where suspension is undesirable (e.g. there is an * active MediaRoute.) * If keepAlive is true, the extension is kept alive. * If keepAlive is false, the extension is allowed to suspend. * @param {boolean} keepAlive */ MediaRouter.prototype.setKeepAlive = function(keepAlive) { if (keepAlive === false && this.keepAlive_) { this.keepAlive_.ptr.reset(); this.keepAlive_ = null; } else if (keepAlive === true && !this.keepAlive_) { this.keepAlive_ = new extensions.KeepAlivePtr; Mojo.bindInterface(extensions.KeepAlive.name, mojo.makeRequest(this.keepAlive_).handle); } }; /** * Called by the provider manager to send an issue from a media route * provider to the Media Router, to show the user. * @param {!Object} issue The issue object. */ MediaRouter.prototype.onIssue = function(issue) { function issueSeverityToMojo_(severity) { switch (severity) { case 'fatal': return mediaRouter.mojom.Issue.Severity.FATAL; case 'warning': return mediaRouter.mojom.Issue.Severity.WARNING; case 'notification': return mediaRouter.mojom.Issue.Severity.NOTIFICATION; default: console.error('Unknown issue severity: ' + severity); return mediaRouter.mojom.Issue.Severity.NOTIFICATION; } } function issueActionToMojo_(action) { switch (action) { case 'dismiss': return mediaRouter.mojom.Issue.ActionType.DISMISS; case 'learn_more': return mediaRouter.mojom.Issue.ActionType.LEARN_MORE; default: console.error('Unknown issue action type : ' + action); return mediaRouter.mojom.Issue.ActionType.OK; } } var secondaryActions = (issue.secondaryActions || []).map(issueActionToMojo_); this.service_.onIssue(new mediaRouter.mojom.Issue({ 'routeId': issue.routeId || '', 'severity': issueSeverityToMojo_(issue.severity), 'title': issue.title, 'message': issue.message || '', 'defaultAction': issueActionToMojo_(issue.defaultAction), 'secondaryActions': secondaryActions, 'helpPageId': issue.helpPageId, 'isBlocking': issue.isBlocking })); }; /** * Called by the provider manager when the set of active routes * has been updated. * @param {!Array} routes The active set of media routes. * @param {string=} sourceUrn The sourceUrn associated with this route * query. * @param {Array=} joinableRouteIds The active set of joinable * media routes. */ MediaRouter.prototype.onRoutesUpdated = function( routes, sourceUrn = '', joinableRouteIds = []) { this.service_.onRoutesUpdated( mediaRouter.mojom.MediaRouteProvider.Id.EXTENSION, routes.map(routeToMojo_), sourceUrn, joinableRouteIds); }; /** * Called by the provider manager when sink availability has been updated. * @param {!mediaRouter.mojom.MediaRouter.SinkAvailability} availability * The new sink availability. */ MediaRouter.prototype.onSinkAvailabilityUpdated = function(availability) { this.service_.onSinkAvailabilityUpdated( mediaRouter.mojom.MediaRouteProvider.Id.EXTENSION, availability); }; /** * Called by the provider manager when the state of a presentation connected * to a route has changed. * @param {string} routeId * @param {string} state */ MediaRouter.prototype.onPresentationConnectionStateChanged = function(routeId, state) { this.service_.onPresentationConnectionStateChanged( routeId, presentationConnectionStateToMojo_(state)); }; /** * Called by the provider manager when the state of a presentation connected * to a route has closed. * @param {string} routeId * @param {string} reason * @param {string} message */ MediaRouter.prototype.onPresentationConnectionClosed = function(routeId, reason, message) { this.service_.onPresentationConnectionClosed( routeId, presentationConnectionCloseReasonToMojo_(reason), message); }; /** * @param {string} routeId * @param {!Array} mesages */ MediaRouter.prototype.onRouteMessagesReceived = function(routeId, messages) { this.service_.onRouteMessagesReceived( routeId, messages.map(messageToMojo_)); }; /** * @param {number} tabId * @param {!media.mojom.MirrorServiceRemoterPtr} remoter * @param {!mojo.InterfaceRequest} remotingSource */ MediaRouter.prototype.onMediaRemoterCreated = function(tabId, remoter, remotingSource) { this.service_.onMediaRemoterCreated( tabId, new media.mojom.MirrorServiceRemoterPtr(remoter.ptr.passInterface()), remotingSource); } /** * Returns current status of media sink service in JSON format. * @return {!Promise} */ MediaRouter.prototype.getMediaSinkServiceStatus = function() { return this.service_.getMediaSinkServiceStatus(); } /** * Object containing callbacks set by the provider manager. * * @constructor * @struct */ function MediaRouterHandlers() { /** * @type {function(!string, !string, !string, !string, !number)} */ this.createRoute = null; /** * @type {function(!string, !string, !string, !number)} */ this.joinRoute = null; /** * @type {function(string): Promise} */ this.terminateRoute = null; /** * @type {function(string)} */ this.startObservingMediaSinks = null; /** * @type {function(string)} */ this.stopObservingMediaSinks = null; /** * @type {function(string, string): Promise} */ this.sendRouteMessage = null; /** * @type {function(string, Uint8Array): Promise} */ this.sendRouteBinaryMessage = null; /** * @type {function(string)} */ this.startListeningForRouteMessages = null; /** * @type {function(string)} */ this.stopListeningForRouteMessages = null; /** * @type {function(string)} */ this.detachRoute = null; /** * @type {function()} */ this.startObservingMediaRoutes = null; /** * @type {function()} */ this.stopObservingMediaRoutes = null; /** * @type {function()} */ this.connectRouteByRouteId = null; /** * @type {function()} */ this.enableMdnsDiscovery = null; /** * @type {function()} */ this.updateMediaSinks = null; /** * @type {function(string, string, !SinkSearchCriteria): string} */ this.searchSinks = null; /** * @type {function()} */ this.provideSinks = null; /** * @type {function(string, !mojo.InterfaceRequest, * !mediaRouter.mojom.MediaStatusObserverPtr): !Promise} */ this.createMediaRouteController = null; }; /** * Routes calls from Media Router to the provider manager extension. * Registered with the MediaRouter stub. * @param {!MediaRouter} MediaRouter proxy to call into the * Media Router mojo interface. * @constructor */ function MediaRouteProvider(mediaRouter) { /** * Object containing JS callbacks into Provider Manager code. * @type {!MediaRouterHandlers} */ this.handlers_ = new MediaRouterHandlers(); /** * Proxy class to the browser's Media Router Mojo service. * @type {!MediaRouter} */ this.mediaRouter_ = mediaRouter; } /* * Sets the callback handler used to invoke methods in the provider manager. * * @param {!MediaRouterHandlers} handlers */ MediaRouteProvider.prototype.setHandlers = function(handlers) { this.handlers_ = handlers; var requiredHandlers = [ 'stopObservingMediaRoutes', 'startObservingMediaRoutes', 'sendRouteMessage', 'sendRouteBinaryMessage', 'startListeningForRouteMessages', 'stopListeningForRouteMessages', 'detachRoute', 'terminateRoute', 'joinRoute', 'createRoute', 'stopObservingMediaSinks', 'startObservingMediaRoutes', 'connectRouteByRouteId', 'enableMdnsDiscovery', 'updateMediaSinks', 'searchSinks', 'provideSinks', 'createMediaRouteController', 'onBeforeInvokeHandler' ]; requiredHandlers.forEach(function(nextHandler) { if (handlers[nextHandler] === undefined) { console.error(nextHandler + ' handler not registered.'); } }); } /** * Starts querying for sinks capable of displaying the media source * designated by |sourceUrn|. Results are returned by calling * OnSinksReceived. * @param {!string} sourceUrn */ MediaRouteProvider.prototype.startObservingMediaSinks = function(sourceUrn) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.startObservingMediaSinks(sourceUrn); }; /** * Stops querying for sinks capable of displaying |sourceUrn|. * @param {!string} sourceUrn */ MediaRouteProvider.prototype.stopObservingMediaSinks = function(sourceUrn) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.stopObservingMediaSinks(sourceUrn); }; /** * Requests that |sinkId| render the media referenced by |sourceUrn|. If the * request is from the Presentation API, then origin and tabId will * be populated. * @param {!string} sourceUrn Media source to render. * @param {!string} sinkId Media sink ID. * @param {!string} presentationId Presentation ID from the site * requesting presentation. TODO(mfoltz): Remove. * @param {!url.mojom.Origin} origin Origin of site requesting presentation. * @param {!number} tabId ID of tab requesting presentation. * @param {!mojo_base.mojom.TimeDelta} timeout If positive, the timeout * duration for the request. Otherwise, the default duration will be used. * @param {!boolean} incognito If true, the route is being requested by * an incognito profile. * @return {!Promise.} A Promise resolving to an object describing * the newly created media route, or rejecting with an error message on * failure. */ MediaRouteProvider.prototype.createRoute = function(sourceUrn, sinkId, presentationId, origin, tabId, timeout, incognito) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.createRoute( sourceUrn, sinkId, presentationId, origin, tabId, Math.floor(timeout.microseconds / 1000), incognito) .then(function(route) { return toSuccessRouteResponse_(route); }, function(err) { return toErrorRouteResponse_(err); }); }; /** * Handles a request via the Presentation API to join an existing route given * by |sourceUrn| and |presentationId|. |origin| and |tabId| are used for * validating same-origin/tab scope. * @param {!string} sourceUrn Media source to render. * @param {!string} presentationId Presentation ID to join. * @param {!url.mojom.Origin} origin Origin of site requesting join. * @param {!number} tabId ID of tab requesting join. * @param {!mojo_base.mojom.TimeDelta} timeout If positive, the timeout * duration for the request. Otherwise, the default duration will be used. * @param {!boolean} incognito If true, the route is being requested by * an incognito profile. * @return {!Promise.} A Promise resolving to an object describing * the newly created media route, or rejecting with an error message on * failure. */ MediaRouteProvider.prototype.joinRoute = function(sourceUrn, presentationId, origin, tabId, timeout, incognito) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.joinRoute( sourceUrn, presentationId, origin, tabId, Math.floor(timeout.microseconds / 1000), incognito) .then(function(route) { return toSuccessRouteResponse_(route); }, function(err) { return toErrorRouteResponse_(err); }); }; /** * Handles a request via the Presentation API to join an existing route given * by |sourceUrn| and |routeId|. |origin| and |tabId| are used for * validating same-origin/tab scope. * @param {!string} sourceUrn Media source to render. * @param {!string} routeId Route ID to join. * @param {!string} presentationId Presentation ID to join. * @param {!url.mojom.Origin} origin Origin of site requesting join. * @param {!number} tabId ID of tab requesting join. * @param {!mojo_base.mojom.TimeDelta} timeout If positive, the timeout * duration for the request. Otherwise, the default duration will be used. * @param {!boolean} incognito If true, the route is being requested by * an incognito profile. * @return {!Promise.} A Promise resolving to an object describing * the newly created media route, or rejecting with an error message on * failure. */ MediaRouteProvider.prototype.connectRouteByRouteId = function(sourceUrn, routeId, presentationId, origin, tabId, timeout, incognito) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.connectRouteByRouteId( sourceUrn, routeId, presentationId, origin, tabId, Math.floor(timeout.microseconds / 1000), incognito) .then(function(route) { return toSuccessRouteResponse_(route); }, function(err) { return toErrorRouteResponse_(err); }); }; /** * Terminates the route specified by |routeId|. * @param {!string} routeId * @return {!Promise} A Promise resolving to an object describing * the result of the terminate operation, or rejecting with an error * message and code if the operation failed. */ MediaRouteProvider.prototype.terminateRoute = function(routeId) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.terminateRoute(routeId).then( () => ({resultCode: mediaRouter.mojom.RouteRequestResultCode.OK}), (err) => toErrorRouteResponse_(err)); }; /** * Posts a message to the route designated by |routeId|. * @param {!string} routeId * @param {!string} message * @return {!Promise.} Resolved with true if the message was sent, * or false on failure. */ MediaRouteProvider.prototype.sendRouteMessage = function( routeId, message) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.sendRouteMessage(routeId, message) .then(function() { return {'sent': true}; }, function() { return {'sent': false}; }); }; /** * Sends a binary message to the route designated by |routeId|. * @param {!string} routeId * @param {!Array} data * @return {!Promise.} Resolved with true if the data was sent, * or false on failure. */ MediaRouteProvider.prototype.sendRouteBinaryMessage = function( routeId, data) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.sendRouteBinaryMessage(routeId, new Uint8Array(data)) .then(function() { return {'sent': true}; }, function() { return {'sent': false}; }); }; /** * Listen for messages from a route. * @param {!string} routeId */ MediaRouteProvider.prototype.startListeningForRouteMessages = function( routeId) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.startListeningForRouteMessages(routeId); }; /** * @param {!string} routeId */ MediaRouteProvider.prototype.stopListeningForRouteMessages = function( routeId) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.stopListeningForRouteMessages(routeId); }; /** * Indicates that the presentation connection that was connected to |routeId| * is no longer connected to it. * @param {!string} routeId */ MediaRouteProvider.prototype.detachRoute = function( routeId) { this.handlers_.detachRoute(routeId); }; /** * Requests that the provider manager start sending information about active * media routes to the Media Router. * @param {!string} sourceUrn */ MediaRouteProvider.prototype.startObservingMediaRoutes = function(sourceUrn) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.startObservingMediaRoutes(sourceUrn); }; /** * Requests that the provider manager stop sending information about active * media routes to the Media Router. * @param {!string} sourceUrn */ MediaRouteProvider.prototype.stopObservingMediaRoutes = function(sourceUrn) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.stopObservingMediaRoutes(sourceUrn); }; /** * Enables mDNS device discovery. */ MediaRouteProvider.prototype.enableMdnsDiscovery = function() { this.handlers_.onBeforeInvokeHandler(); this.handlers_.enableMdnsDiscovery(); }; /** * Requests that the provider manager update media sinks. * @param {!string} sourceUrn */ MediaRouteProvider.prototype.updateMediaSinks = function(sourceUrn) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.updateMediaSinks(sourceUrn); }; /** * Requests that the provider manager search its providers for a sink matching * |searchCriteria| that is compatible with |sourceUrn|. If a sink is found * that can be used immediately for route creation, its ID is returned. * Otherwise the empty string is returned. * * @param {string} sinkId Sink ID of the pseudo sink generating the request. * @param {string} sourceUrn Media source to be used with the sink. * @param {!SinkSearchCriteria} searchCriteria Search criteria for the route * providers. * @return {!Promise.} A Promise resolving to either the * sink ID of the sink found by the search that can be used for route * creation, or the empty string if no route can be immediately created. */ MediaRouteProvider.prototype.searchSinks = function( sinkId, sourceUrn, searchCriteria) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.searchSinks(sinkId, sourceUrn, searchCriteria).then( sinkId => { return { 'sinkId': sinkId }; }, () => { return { 'sinkId': '' }; }); }; /** * Notifies the provider manager that MediaRouter has discovered a list of * sinks. * @param {string} providerName * @param {!Array} sinks */ MediaRouteProvider.prototype.provideSinks = function(providerName, sinks) { this.handlers_.onBeforeInvokeHandler(); this.handlers_.provideSinks(providerName, sinks.map(MediaSinkAdapter.fromNewVersion)); }; /** * Creates a controller for the given route and binds the given * InterfaceRequest to it, and registers an observer for media status updates * for the route. * @param {string} routeId * @param {!mojo.InterfaceRequest} controllerRequest * @param {!mediaRouter.mojom.MediaStatusObserverPtr} observer * @return {!Promise} Resolves to true if a controller * is created. Resolves to false if a controller cannot be created, or if * the controller is already bound. */ MediaRouteProvider.prototype.createMediaRouteController = function( routeId, controllerRequest, observer) { this.handlers_.onBeforeInvokeHandler(); return this.handlers_.createMediaRouteController( routeId, controllerRequest, new MediaStatusObserverPtrAdapter(observer.ptr.passInterface())).then( () => ({success: true}), e => ({success: false})); }; var ptr = new mediaRouter.mojom.MediaRouterPtr; Mojo.bindInterface(mediaRouter.mojom.MediaRouter.name, mojo.makeRequest(ptr).handle); exports.$set('returnValue', new MediaRouter(ptr)); // Copyright 2014 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'; (function() { var mojomId = 'chrome/common/media_router/mojo/media_status.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('mediaRouter.mojom'); var time$ = mojo.internal.exposeNamespace('mojoBase.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'mojo/public/mojom/base/time.mojom', '../../../../mojo/public/mojom/base/time.mojom.js'); } function MediaStatus(values) { this.initDefaults_(); this.initFields_(values); } MediaStatus.PlayState = {}; MediaStatus.PlayState.PLAYING = 0; MediaStatus.PlayState.PAUSED = MediaStatus.PlayState.PLAYING + 1; MediaStatus.PlayState.BUFFERING = MediaStatus.PlayState.PAUSED + 1; MediaStatus.PlayState.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: return true; } return false; }; MediaStatus.PlayState.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; MediaStatus.prototype.initDefaults_ = function() { this.title = null; this.canPlayPause = false; this.canMute = false; this.canSetVolume = false; this.canSeek = false; this.isMuted = false; this.playState = 0; this.volume = 0; this.duration = null; this.currentTime = null; this.hangoutsExtraData = null; }; MediaStatus.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaStatus.generate = function(generator_) { var generated = new MediaStatus; generated.title = generator_.generateString(false); generated.canPlayPause = generator_.generateBool(); generated.canMute = generator_.generateBool(); generated.canSetVolume = generator_.generateBool(); generated.canSeek = generator_.generateBool(); generated.playState = generator_.generateEnum(0, 2); generated.isMuted = generator_.generateBool(); generated.volume = generator_.generateFloat(); generated.duration = generator_.generateStruct(mojoBase.mojom.TimeDelta, false); generated.currentTime = generator_.generateStruct(mojoBase.mojom.TimeDelta, false); generated.hangoutsExtraData = generator_.generateStruct(mediaRouter.mojom.HangoutsMediaStatusExtraData, true); return generated; }; MediaStatus.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.title = mutator_.mutateString(this.title, false); } if (mutator_.chooseMutateField()) { this.canPlayPause = mutator_.mutateBool(this.canPlayPause); } if (mutator_.chooseMutateField()) { this.canMute = mutator_.mutateBool(this.canMute); } if (mutator_.chooseMutateField()) { this.canSetVolume = mutator_.mutateBool(this.canSetVolume); } if (mutator_.chooseMutateField()) { this.canSeek = mutator_.mutateBool(this.canSeek); } if (mutator_.chooseMutateField()) { this.playState = mutator_.mutateEnum(this.playState, 0, 2); } if (mutator_.chooseMutateField()) { this.isMuted = mutator_.mutateBool(this.isMuted); } if (mutator_.chooseMutateField()) { this.volume = mutator_.mutateFloat(this.volume); } if (mutator_.chooseMutateField()) { this.duration = mutator_.mutateStruct(mojoBase.mojom.TimeDelta, false); } if (mutator_.chooseMutateField()) { this.currentTime = mutator_.mutateStruct(mojoBase.mojom.TimeDelta, false); } if (mutator_.chooseMutateField()) { this.hangoutsExtraData = mutator_.mutateStruct(mediaRouter.mojom.HangoutsMediaStatusExtraData, true); } return this; }; MediaStatus.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaStatus.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaStatus.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaStatus.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 56} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaStatus.title err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate MediaStatus.playState err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 12, MediaStatus.PlayState); if (err !== validator.validationError.NONE) return err; // validate MediaStatus.duration err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, time$.TimeDelta, false); if (err !== validator.validationError.NONE) return err; // validate MediaStatus.currentTime err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, time$.TimeDelta, false); if (err !== validator.validationError.NONE) return err; // validate MediaStatus.hangoutsExtraData err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, HangoutsMediaStatusExtraData, true); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaStatus.encodedSize = codec.kStructHeaderSize + 48; MediaStatus.decode = function(decoder) { var packed; var val = new MediaStatus(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.title = decoder.decodeStruct(codec.String); packed = decoder.readUint8(); val.canPlayPause = (packed >> 0) & 1 ? true : false; val.canMute = (packed >> 1) & 1 ? true : false; val.canSetVolume = (packed >> 2) & 1 ? true : false; val.canSeek = (packed >> 3) & 1 ? true : false; val.isMuted = (packed >> 4) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); val.playState = decoder.decodeStruct(codec.Int32); val.volume = decoder.decodeStruct(codec.Float); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); val.duration = decoder.decodeStructPointer(time$.TimeDelta); val.currentTime = decoder.decodeStructPointer(time$.TimeDelta); val.hangoutsExtraData = decoder.decodeStructPointer(HangoutsMediaStatusExtraData); return val; }; MediaStatus.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaStatus.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.title); packed = 0; packed |= (val.canPlayPause & 1) << 0 packed |= (val.canMute & 1) << 1 packed |= (val.canSetVolume & 1) << 2 packed |= (val.canSeek & 1) << 3 packed |= (val.isMuted & 1) << 4 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStruct(codec.Int32, val.playState); encoder.encodeStruct(codec.Float, val.volume); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.encodeStructPointer(time$.TimeDelta, val.duration); encoder.encodeStructPointer(time$.TimeDelta, val.currentTime); encoder.encodeStructPointer(HangoutsMediaStatusExtraData, val.hangoutsExtraData); }; function HangoutsMediaStatusExtraData(values) { this.initDefaults_(); this.initFields_(values); } HangoutsMediaStatusExtraData.prototype.initDefaults_ = function() { this.localPresent = false; }; HangoutsMediaStatusExtraData.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; HangoutsMediaStatusExtraData.generate = function(generator_) { var generated = new HangoutsMediaStatusExtraData; generated.localPresent = generator_.generateBool(); return generated; }; HangoutsMediaStatusExtraData.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.localPresent = mutator_.mutateBool(this.localPresent); } return this; }; HangoutsMediaStatusExtraData.prototype.getHandleDeps = function() { var handles = []; return handles; }; HangoutsMediaStatusExtraData.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; HangoutsMediaStatusExtraData.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; HangoutsMediaStatusExtraData.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; HangoutsMediaStatusExtraData.encodedSize = codec.kStructHeaderSize + 8; HangoutsMediaStatusExtraData.decode = function(decoder) { var packed; var val = new HangoutsMediaStatusExtraData(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.localPresent = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; HangoutsMediaStatusExtraData.encode = function(encoder, val) { var packed; encoder.writeUint32(HangoutsMediaStatusExtraData.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.localPresent & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MediaStatusObserver_OnMediaStatusUpdated_Params(values) { this.initDefaults_(); this.initFields_(values); } MediaStatusObserver_OnMediaStatusUpdated_Params.prototype.initDefaults_ = function() { this.status = null; }; MediaStatusObserver_OnMediaStatusUpdated_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MediaStatusObserver_OnMediaStatusUpdated_Params.generate = function(generator_) { var generated = new MediaStatusObserver_OnMediaStatusUpdated_Params; generated.status = generator_.generateStruct(mediaRouter.mojom.MediaStatus, false); return generated; }; MediaStatusObserver_OnMediaStatusUpdated_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.status = mutator_.mutateStruct(mediaRouter.mojom.MediaStatus, false); } return this; }; MediaStatusObserver_OnMediaStatusUpdated_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MediaStatusObserver_OnMediaStatusUpdated_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MediaStatusObserver_OnMediaStatusUpdated_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MediaStatusObserver_OnMediaStatusUpdated_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MediaStatusObserver_OnMediaStatusUpdated_Params.status err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, MediaStatus, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MediaStatusObserver_OnMediaStatusUpdated_Params.encodedSize = codec.kStructHeaderSize + 8; MediaStatusObserver_OnMediaStatusUpdated_Params.decode = function(decoder) { var packed; var val = new MediaStatusObserver_OnMediaStatusUpdated_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.status = decoder.decodeStructPointer(MediaStatus); return val; }; MediaStatusObserver_OnMediaStatusUpdated_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MediaStatusObserver_OnMediaStatusUpdated_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(MediaStatus, val.status); }; var kMediaStatusObserver_OnMediaStatusUpdated_Name = 116829873; function MediaStatusObserverPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(MediaStatusObserver, handleOrPtrInfo); } function MediaStatusObserverAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( MediaStatusObserver, associatedInterfacePtrInfo); } MediaStatusObserverAssociatedPtr.prototype = Object.create(MediaStatusObserverPtr.prototype); MediaStatusObserverAssociatedPtr.prototype.constructor = MediaStatusObserverAssociatedPtr; function MediaStatusObserverProxy(receiver) { this.receiver_ = receiver; } MediaStatusObserverPtr.prototype.onMediaStatusUpdated = function() { return MediaStatusObserverProxy.prototype.onMediaStatusUpdated .apply(this.ptr.getProxy(), arguments); }; MediaStatusObserverProxy.prototype.onMediaStatusUpdated = function(status) { var params_ = new MediaStatusObserver_OnMediaStatusUpdated_Params(); params_.status = status; var builder = new codec.MessageV0Builder( kMediaStatusObserver_OnMediaStatusUpdated_Name, codec.align(MediaStatusObserver_OnMediaStatusUpdated_Params.encodedSize)); builder.encodeStruct(MediaStatusObserver_OnMediaStatusUpdated_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; function MediaStatusObserverStub(delegate) { this.delegate_ = delegate; } MediaStatusObserverStub.prototype.onMediaStatusUpdated = function(status) { return this.delegate_ && this.delegate_.onMediaStatusUpdated && this.delegate_.onMediaStatusUpdated(status); } MediaStatusObserverStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMediaStatusObserver_OnMediaStatusUpdated_Name: var params = reader.decodeStruct(MediaStatusObserver_OnMediaStatusUpdated_Params); this.onMediaStatusUpdated(params.status); return true; default: return false; } }; MediaStatusObserverStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { default: return false; } }; function validateMediaStatusObserverRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMediaStatusObserver_OnMediaStatusUpdated_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MediaStatusObserver_OnMediaStatusUpdated_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateMediaStatusObserverResponse(messageValidator) { return validator.validationError.NONE; } var MediaStatusObserver = { name: 'media_router.mojom.MediaStatusObserver', kVersion: 0, ptrClass: MediaStatusObserverPtr, proxyClass: MediaStatusObserverProxy, stubClass: MediaStatusObserverStub, validateRequest: validateMediaStatusObserverRequest, validateResponse: null, mojomId: 'chrome/common/media_router/mojo/media_status.mojom', fuzzMethods: { onMediaStatusUpdated: { params: MediaStatusObserver_OnMediaStatusUpdated_Params, }, }, }; MediaStatusObserverStub.prototype.validator = validateMediaStatusObserverRequest; MediaStatusObserverProxy.prototype.validator = null; exports.MediaStatus = MediaStatus; exports.HangoutsMediaStatusExtraData = HangoutsMediaStatusExtraData; exports.MediaStatusObserver = MediaStatusObserver; exports.MediaStatusObserverPtr = MediaStatusObserverPtr; exports.MediaStatusObserverAssociatedPtr = MediaStatusObserverAssociatedPtr; })();// Copyright 2014 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'; (function() { var mojomId = 'mojo/public/mojom/base/time.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('mojoBase.mojom'); function Time(values) { this.initDefaults_(); this.initFields_(values); } Time.prototype.initDefaults_ = function() { this.internalValue = 0; }; Time.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; Time.generate = function(generator_) { var generated = new Time; generated.internalValue = generator_.generateInt64(); return generated; }; Time.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.internalValue = mutator_.mutateInt64(this.internalValue); } return this; }; Time.prototype.getHandleDeps = function() { var handles = []; return handles; }; Time.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; Time.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; Time.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; Time.encodedSize = codec.kStructHeaderSize + 8; Time.decode = function(decoder) { var packed; var val = new Time(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.internalValue = decoder.decodeStruct(codec.Int64); return val; }; Time.encode = function(encoder, val) { var packed; encoder.writeUint32(Time.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int64, val.internalValue); }; function TimeDelta(values) { this.initDefaults_(); this.initFields_(values); } TimeDelta.prototype.initDefaults_ = function() { this.microseconds = 0; }; TimeDelta.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; TimeDelta.generate = function(generator_) { var generated = new TimeDelta; generated.microseconds = generator_.generateInt64(); return generated; }; TimeDelta.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.microseconds = mutator_.mutateInt64(this.microseconds); } return this; }; TimeDelta.prototype.getHandleDeps = function() { var handles = []; return handles; }; TimeDelta.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; TimeDelta.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; TimeDelta.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; TimeDelta.encodedSize = codec.kStructHeaderSize + 8; TimeDelta.decode = function(decoder) { var packed; var val = new TimeDelta(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.microseconds = decoder.decodeStruct(codec.Int64); return val; }; TimeDelta.encode = function(encoder, val) { var packed; encoder.writeUint32(TimeDelta.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int64, val.microseconds); }; function TimeTicks(values) { this.initDefaults_(); this.initFields_(values); } TimeTicks.prototype.initDefaults_ = function() { this.internalValue = 0; }; TimeTicks.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; TimeTicks.generate = function(generator_) { var generated = new TimeTicks; generated.internalValue = generator_.generateInt64(); return generated; }; TimeTicks.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.internalValue = mutator_.mutateInt64(this.internalValue); } return this; }; TimeTicks.prototype.getHandleDeps = function() { var handles = []; return handles; }; TimeTicks.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; TimeTicks.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; TimeTicks.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; TimeTicks.encodedSize = codec.kStructHeaderSize + 8; TimeTicks.decode = function(decoder) { var packed; var val = new TimeTicks(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.internalValue = decoder.decodeStruct(codec.Int64); return val; }; TimeTicks.encode = function(encoder, val) { var packed; encoder.writeUint32(TimeTicks.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int64, val.internalValue); }; exports.Time = Time; exports.TimeDelta = TimeDelta; exports.TimeTicks = TimeTicks; })();// Copyright 2014 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'; (function() { var mojomId = 'net/interfaces/ip_address.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('net.interfaces'); function IPAddress(values) { this.initDefaults_(); this.initFields_(values); } IPAddress.prototype.initDefaults_ = function() { this.addressBytes = null; }; IPAddress.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; IPAddress.generate = function(generator_) { var generated = new IPAddress; generated.addressBytes = generator_.generateArray(function() { return generator_.generateUint8(); }); return generated; }; IPAddress.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.addressBytes = mutator_.mutateArray(this.addressBytes, function(val) { return mutator_.mutateUint8(val); }); } return this; }; IPAddress.prototype.getHandleDeps = function() { var handles = []; return handles; }; IPAddress.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; IPAddress.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; IPAddress.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate IPAddress.addressBytes err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 1, codec.Uint8, false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; IPAddress.encodedSize = codec.kStructHeaderSize + 8; IPAddress.decode = function(decoder) { var packed; var val = new IPAddress(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.addressBytes = decoder.decodeArrayPointer(codec.Uint8); return val; }; IPAddress.encode = function(encoder, val) { var packed; encoder.writeUint32(IPAddress.encodedSize); encoder.writeUint32(0); encoder.encodeArrayPointer(codec.Uint8, val.addressBytes); }; exports.IPAddress = IPAddress; })();// Copyright 2014 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'; (function() { var mojomId = 'net/interfaces/ip_endpoint.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('net.interfaces'); var ip_address$ = mojo.internal.exposeNamespace('net.interfaces'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'net/interfaces/ip_address.mojom', 'ip_address.mojom.js'); } function IPEndPoint(values) { this.initDefaults_(); this.initFields_(values); } IPEndPoint.prototype.initDefaults_ = function() { this.address = null; this.port = 0; }; IPEndPoint.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; IPEndPoint.generate = function(generator_) { var generated = new IPEndPoint; generated.address = generator_.generateStruct(net.interfaces.IPAddress, false); generated.port = generator_.generateUint16(); return generated; }; IPEndPoint.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.address = mutator_.mutateStruct(net.interfaces.IPAddress, false); } if (mutator_.chooseMutateField()) { this.port = mutator_.mutateUint16(this.port); } return this; }; IPEndPoint.prototype.getHandleDeps = function() { var handles = []; return handles; }; IPEndPoint.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; IPEndPoint.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; IPEndPoint.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate IPEndPoint.address err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, ip_address$.IPAddress, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; IPEndPoint.encodedSize = codec.kStructHeaderSize + 16; IPEndPoint.decode = function(decoder) { var packed; var val = new IPEndPoint(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.address = decoder.decodeStructPointer(ip_address$.IPAddress); val.port = decoder.decodeStruct(codec.Uint16); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; IPEndPoint.encode = function(encoder, val) { var packed; encoder.writeUint32(IPEndPoint.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(ip_address$.IPAddress, val.address); encoder.encodeStruct(codec.Uint16, val.port); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; exports.IPEndPoint = IPEndPoint; })();// Copyright 2014 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'; (function() { var mojomId = 'url/mojom/origin.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('url.mojom'); function Origin(values) { this.initDefaults_(); this.initFields_(values); } Origin.prototype.initDefaults_ = function() { this.scheme = null; this.host = null; this.port = 0; this.unique = false; }; Origin.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; Origin.generate = function(generator_) { var generated = new Origin; generated.scheme = generator_.generateString(false); generated.host = generator_.generateString(false); generated.port = generator_.generateUint16(); generated.unique = generator_.generateBool(); return generated; }; Origin.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.scheme = mutator_.mutateString(this.scheme, false); } if (mutator_.chooseMutateField()) { this.host = mutator_.mutateString(this.host, false); } if (mutator_.chooseMutateField()) { this.port = mutator_.mutateUint16(this.port); } if (mutator_.chooseMutateField()) { this.unique = mutator_.mutateBool(this.unique); } return this; }; Origin.prototype.getHandleDeps = function() { var handles = []; return handles; }; Origin.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; Origin.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; Origin.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 32} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate Origin.scheme err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; // validate Origin.host err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; Origin.encodedSize = codec.kStructHeaderSize + 24; Origin.decode = function(decoder) { var packed; var val = new Origin(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.scheme = decoder.decodeStruct(codec.String); val.host = decoder.decodeStruct(codec.String); val.port = decoder.decodeStruct(codec.Uint16); packed = decoder.readUint8(); val.unique = (packed >> 0) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; Origin.encode = function(encoder, val) { var packed; encoder.writeUint32(Origin.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.scheme); encoder.encodeStruct(codec.String, val.host); encoder.encodeStruct(codec.Uint16, val.port); packed = 0; packed |= (val.unique & 1) << 0 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; exports.Origin = Origin; })();// Copyright 2014 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'; (function() { var mojomId = 'url/mojom/url.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('url.mojom'); function Url(values) { this.initDefaults_(); this.initFields_(values); } Url.prototype.initDefaults_ = function() { this.url = null; }; Url.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; Url.generate = function(generator_) { var generated = new Url; generated.url = generator_.generateString(false); return generated; }; Url.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.url = mutator_.mutateString(this.url, false); } return this; }; Url.prototype.getHandleDeps = function() { var handles = []; return handles; }; Url.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; Url.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; Url.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate Url.url err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; Url.encodedSize = codec.kStructHeaderSize + 8; Url.decode = function(decoder) { var packed; var val = new Url(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.url = decoder.decodeStruct(codec.String); return val; }; Url.encode = function(encoder, val) { var packed; encoder.writeUint32(Url.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.url); }; exports.Url = Url; })();// Copyright 2014 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'; (function() { var mojomId = 'media/mojo/interfaces/mirror_service_remoting.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('media.mojom'); var remoting_common$ = mojo.internal.exposeNamespace('media.mojom'); if (mojo.config.autoLoadMojomDeps) { mojo.internal.loadMojomIfNecessary( 'media/mojo/interfaces/remoting_common.mojom', 'remoting_common.mojom.js'); } function MirrorServiceRemoter_Start_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_Start_Params.prototype.initDefaults_ = function() { }; MirrorServiceRemoter_Start_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_Start_Params.generate = function(generator_) { var generated = new MirrorServiceRemoter_Start_Params; return generated; }; MirrorServiceRemoter_Start_Params.prototype.mutate = function(mutator_) { return this; }; MirrorServiceRemoter_Start_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_Start_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_Start_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_Start_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_Start_Params.encodedSize = codec.kStructHeaderSize + 0; MirrorServiceRemoter_Start_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_Start_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MirrorServiceRemoter_Start_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_Start_Params.encodedSize); encoder.writeUint32(0); }; function MirrorServiceRemoter_StartDataStreams_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_StartDataStreams_Params.prototype.initDefaults_ = function() { this.hasAudio = false; this.hasVideo = false; }; MirrorServiceRemoter_StartDataStreams_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_StartDataStreams_Params.generate = function(generator_) { var generated = new MirrorServiceRemoter_StartDataStreams_Params; generated.hasAudio = generator_.generateBool(); generated.hasVideo = generator_.generateBool(); return generated; }; MirrorServiceRemoter_StartDataStreams_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.hasAudio = mutator_.mutateBool(this.hasAudio); } if (mutator_.chooseMutateField()) { this.hasVideo = mutator_.mutateBool(this.hasVideo); } return this; }; MirrorServiceRemoter_StartDataStreams_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_StartDataStreams_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_StartDataStreams_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_StartDataStreams_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_StartDataStreams_Params.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemoter_StartDataStreams_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_StartDataStreams_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); val.hasAudio = (packed >> 0) & 1 ? true : false; val.hasVideo = (packed >> 1) & 1 ? true : false; decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MirrorServiceRemoter_StartDataStreams_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_StartDataStreams_Params.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.hasAudio & 1) << 0 packed |= (val.hasVideo & 1) << 1 encoder.writeUint8(packed); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MirrorServiceRemoter_StartDataStreams_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_StartDataStreams_ResponseParams.prototype.initDefaults_ = function() { this.audioStreamId = 0; this.videoStreamId = 0; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_StartDataStreams_ResponseParams.generate = function(generator_) { var generated = new MirrorServiceRemoter_StartDataStreams_ResponseParams; generated.audioStreamId = generator_.generateInt32(); generated.videoStreamId = generator_.generateInt32(); return generated; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.audioStreamId = mutator_.mutateInt32(this.audioStreamId); } if (mutator_.chooseMutateField()) { this.videoStreamId = mutator_.mutateInt32(this.videoStreamId); } return this; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_StartDataStreams_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemoter_StartDataStreams_ResponseParams.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_StartDataStreams_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.audioStreamId = decoder.decodeStruct(codec.Int32); val.videoStreamId = decoder.decodeStruct(codec.Int32); return val; }; MirrorServiceRemoter_StartDataStreams_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_StartDataStreams_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.audioStreamId); encoder.encodeStruct(codec.Int32, val.videoStreamId); }; function MirrorServiceRemoter_Stop_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_Stop_Params.prototype.initDefaults_ = function() { this.reason = 0; }; MirrorServiceRemoter_Stop_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_Stop_Params.generate = function(generator_) { var generated = new MirrorServiceRemoter_Stop_Params; generated.reason = generator_.generateEnum(0, 7); return generated; }; MirrorServiceRemoter_Stop_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.reason = mutator_.mutateEnum(this.reason, 0, 7); } return this; }; MirrorServiceRemoter_Stop_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_Stop_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_Stop_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_Stop_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MirrorServiceRemoter_Stop_Params.reason err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, remoting_common$.RemotingStopReason); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_Stop_Params.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemoter_Stop_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_Stop_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.reason = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MirrorServiceRemoter_Stop_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_Stop_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.reason); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MirrorServiceRemoter_SendMessageToSink_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_SendMessageToSink_Params.prototype.initDefaults_ = function() { this.message = null; }; MirrorServiceRemoter_SendMessageToSink_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_SendMessageToSink_Params.generate = function(generator_) { var generated = new MirrorServiceRemoter_SendMessageToSink_Params; generated.message = generator_.generateArray(function() { return generator_.generateUint8(); }); return generated; }; MirrorServiceRemoter_SendMessageToSink_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.message = mutator_.mutateArray(this.message, function(val) { return mutator_.mutateUint8(val); }); } return this; }; MirrorServiceRemoter_SendMessageToSink_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_SendMessageToSink_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_SendMessageToSink_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_SendMessageToSink_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MirrorServiceRemoter_SendMessageToSink_Params.message err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 1, codec.Uint8, false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_SendMessageToSink_Params.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemoter_SendMessageToSink_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_SendMessageToSink_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.message = decoder.decodeArrayPointer(codec.Uint8); return val; }; MirrorServiceRemoter_SendMessageToSink_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_SendMessageToSink_Params.encodedSize); encoder.writeUint32(0); encoder.encodeArrayPointer(codec.Uint8, val.message); }; function MirrorServiceRemoter_EstimateTransmissionCapacity_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_EstimateTransmissionCapacity_Params.prototype.initDefaults_ = function() { }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.generate = function(generator_) { var generated = new MirrorServiceRemoter_EstimateTransmissionCapacity_Params; return generated; }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.prototype.mutate = function(mutator_) { return this; }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.encodedSize = codec.kStructHeaderSize + 0; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_EstimateTransmissionCapacity_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MirrorServiceRemoter_EstimateTransmissionCapacity_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_EstimateTransmissionCapacity_Params.encodedSize); encoder.writeUint32(0); }; function MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.prototype.initDefaults_ = function() { this.rate = 0; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.generate = function(generator_) { var generated = new MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams; generated.rate = generator_.generateDouble(); return generated; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.rate = mutator_.mutateDouble(this.rate); } return this; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.decode = function(decoder) { var packed; var val = new MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.rate = decoder.decodeStruct(codec.Double); return val; }; MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Double, val.rate); }; function MirrorServiceRemotingSource_OnSinkAvailable_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemotingSource_OnSinkAvailable_Params.prototype.initDefaults_ = function() { this.metadata = null; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemotingSource_OnSinkAvailable_Params.generate = function(generator_) { var generated = new MirrorServiceRemotingSource_OnSinkAvailable_Params; generated.metadata = generator_.generateStruct(media.mojom.RemotingSinkMetadata, false); return generated; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.metadata = mutator_.mutateStruct(media.mojom.RemotingSinkMetadata, false); } return this; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemotingSource_OnSinkAvailable_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MirrorServiceRemotingSource_OnSinkAvailable_Params.metadata err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, remoting_common$.RemotingSinkMetadata, false); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemotingSource_OnSinkAvailable_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemotingSource_OnSinkAvailable_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.metadata = decoder.decodeStructPointer(remoting_common$.RemotingSinkMetadata); return val; }; MirrorServiceRemotingSource_OnSinkAvailable_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemotingSource_OnSinkAvailable_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStructPointer(remoting_common$.RemotingSinkMetadata, val.metadata); }; function MirrorServiceRemotingSource_OnMessageFromSink_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemotingSource_OnMessageFromSink_Params.prototype.initDefaults_ = function() { this.message = null; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemotingSource_OnMessageFromSink_Params.generate = function(generator_) { var generated = new MirrorServiceRemotingSource_OnMessageFromSink_Params; generated.message = generator_.generateArray(function() { return generator_.generateUint8(); }); return generated; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.message = mutator_.mutateArray(this.message, function(val) { return mutator_.mutateUint8(val); }); } return this; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemotingSource_OnMessageFromSink_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MirrorServiceRemotingSource_OnMessageFromSink_Params.message err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 1, codec.Uint8, false, [0], 0); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemotingSource_OnMessageFromSink_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemotingSource_OnMessageFromSink_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.message = decoder.decodeArrayPointer(codec.Uint8); return val; }; MirrorServiceRemotingSource_OnMessageFromSink_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemotingSource_OnMessageFromSink_Params.encodedSize); encoder.writeUint32(0); encoder.encodeArrayPointer(codec.Uint8, val.message); }; function MirrorServiceRemotingSource_OnStopped_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemotingSource_OnStopped_Params.prototype.initDefaults_ = function() { this.reason = 0; }; MirrorServiceRemotingSource_OnStopped_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemotingSource_OnStopped_Params.generate = function(generator_) { var generated = new MirrorServiceRemotingSource_OnStopped_Params; generated.reason = generator_.generateEnum(0, 7); return generated; }; MirrorServiceRemotingSource_OnStopped_Params.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.reason = mutator_.mutateEnum(this.reason, 0, 7); } return this; }; MirrorServiceRemotingSource_OnStopped_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemotingSource_OnStopped_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemotingSource_OnStopped_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemotingSource_OnStopped_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 16} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate MirrorServiceRemotingSource_OnStopped_Params.reason err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, remoting_common$.RemotingStopReason); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemotingSource_OnStopped_Params.encodedSize = codec.kStructHeaderSize + 8; MirrorServiceRemotingSource_OnStopped_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemotingSource_OnStopped_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.reason = decoder.decodeStruct(codec.Int32); decoder.skip(1); decoder.skip(1); decoder.skip(1); decoder.skip(1); return val; }; MirrorServiceRemotingSource_OnStopped_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemotingSource_OnStopped_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.Int32, val.reason); encoder.skip(1); encoder.skip(1); encoder.skip(1); encoder.skip(1); }; function MirrorServiceRemotingSource_OnError_Params(values) { this.initDefaults_(); this.initFields_(values); } MirrorServiceRemotingSource_OnError_Params.prototype.initDefaults_ = function() { }; MirrorServiceRemotingSource_OnError_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; MirrorServiceRemotingSource_OnError_Params.generate = function(generator_) { var generated = new MirrorServiceRemotingSource_OnError_Params; return generated; }; MirrorServiceRemotingSource_OnError_Params.prototype.mutate = function(mutator_) { return this; }; MirrorServiceRemotingSource_OnError_Params.prototype.getHandleDeps = function() { var handles = []; return handles; }; MirrorServiceRemotingSource_OnError_Params.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; MirrorServiceRemotingSource_OnError_Params.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; MirrorServiceRemotingSource_OnError_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 8} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; MirrorServiceRemotingSource_OnError_Params.encodedSize = codec.kStructHeaderSize + 0; MirrorServiceRemotingSource_OnError_Params.decode = function(decoder) { var packed; var val = new MirrorServiceRemotingSource_OnError_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); return val; }; MirrorServiceRemotingSource_OnError_Params.encode = function(encoder, val) { var packed; encoder.writeUint32(MirrorServiceRemotingSource_OnError_Params.encodedSize); encoder.writeUint32(0); }; var kMirrorServiceRemoter_Start_Name = 1376227237; var kMirrorServiceRemoter_StartDataStreams_Name = 1341983485; var kMirrorServiceRemoter_Stop_Name = 344039001; var kMirrorServiceRemoter_SendMessageToSink_Name = 1306730094; var kMirrorServiceRemoter_EstimateTransmissionCapacity_Name = 1004577409; function MirrorServiceRemoterPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(MirrorServiceRemoter, handleOrPtrInfo); } function MirrorServiceRemoterAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( MirrorServiceRemoter, associatedInterfacePtrInfo); } MirrorServiceRemoterAssociatedPtr.prototype = Object.create(MirrorServiceRemoterPtr.prototype); MirrorServiceRemoterAssociatedPtr.prototype.constructor = MirrorServiceRemoterAssociatedPtr; function MirrorServiceRemoterProxy(receiver) { this.receiver_ = receiver; } MirrorServiceRemoterPtr.prototype.start = function() { return MirrorServiceRemoterProxy.prototype.start .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemoterProxy.prototype.start = function() { var params_ = new MirrorServiceRemoter_Start_Params(); var builder = new codec.MessageV0Builder( kMirrorServiceRemoter_Start_Name, codec.align(MirrorServiceRemoter_Start_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemoter_Start_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MirrorServiceRemoterPtr.prototype.startDataStreams = function() { return MirrorServiceRemoterProxy.prototype.startDataStreams .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemoterProxy.prototype.startDataStreams = function(hasAudio, hasVideo) { var params_ = new MirrorServiceRemoter_StartDataStreams_Params(); params_.hasAudio = hasAudio; params_.hasVideo = hasVideo; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMirrorServiceRemoter_StartDataStreams_Name, codec.align(MirrorServiceRemoter_StartDataStreams_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MirrorServiceRemoter_StartDataStreams_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MirrorServiceRemoter_StartDataStreams_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; MirrorServiceRemoterPtr.prototype.stop = function() { return MirrorServiceRemoterProxy.prototype.stop .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemoterProxy.prototype.stop = function(reason) { var params_ = new MirrorServiceRemoter_Stop_Params(); params_.reason = reason; var builder = new codec.MessageV0Builder( kMirrorServiceRemoter_Stop_Name, codec.align(MirrorServiceRemoter_Stop_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemoter_Stop_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MirrorServiceRemoterPtr.prototype.sendMessageToSink = function() { return MirrorServiceRemoterProxy.prototype.sendMessageToSink .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemoterProxy.prototype.sendMessageToSink = function(message) { var params_ = new MirrorServiceRemoter_SendMessageToSink_Params(); params_.message = message; var builder = new codec.MessageV0Builder( kMirrorServiceRemoter_SendMessageToSink_Name, codec.align(MirrorServiceRemoter_SendMessageToSink_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemoter_SendMessageToSink_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MirrorServiceRemoterPtr.prototype.estimateTransmissionCapacity = function() { return MirrorServiceRemoterProxy.prototype.estimateTransmissionCapacity .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemoterProxy.prototype.estimateTransmissionCapacity = function() { var params_ = new MirrorServiceRemoter_EstimateTransmissionCapacity_Params(); return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( kMirrorServiceRemoter_EstimateTransmissionCapacity_Name, codec.align(MirrorServiceRemoter_EstimateTransmissionCapacity_Params.encodedSize), codec.kMessageExpectsResponse, 0); builder.encodeStruct(MirrorServiceRemoter_EstimateTransmissionCapacity_Params, params_); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = reader.decodeStruct(MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); }); }.bind(this)); }; function MirrorServiceRemoterStub(delegate) { this.delegate_ = delegate; } MirrorServiceRemoterStub.prototype.start = function() { return this.delegate_ && this.delegate_.start && this.delegate_.start(); } MirrorServiceRemoterStub.prototype.startDataStreams = function(hasAudio, hasVideo) { return this.delegate_ && this.delegate_.startDataStreams && this.delegate_.startDataStreams(hasAudio, hasVideo); } MirrorServiceRemoterStub.prototype.stop = function(reason) { return this.delegate_ && this.delegate_.stop && this.delegate_.stop(reason); } MirrorServiceRemoterStub.prototype.sendMessageToSink = function(message) { return this.delegate_ && this.delegate_.sendMessageToSink && this.delegate_.sendMessageToSink(message); } MirrorServiceRemoterStub.prototype.estimateTransmissionCapacity = function() { return this.delegate_ && this.delegate_.estimateTransmissionCapacity && this.delegate_.estimateTransmissionCapacity(); } MirrorServiceRemoterStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMirrorServiceRemoter_Start_Name: var params = reader.decodeStruct(MirrorServiceRemoter_Start_Params); this.start(); return true; case kMirrorServiceRemoter_Stop_Name: var params = reader.decodeStruct(MirrorServiceRemoter_Stop_Params); this.stop(params.reason); return true; case kMirrorServiceRemoter_SendMessageToSink_Name: var params = reader.decodeStruct(MirrorServiceRemoter_SendMessageToSink_Params); this.sendMessageToSink(params.message); return true; default: return false; } }; MirrorServiceRemoterStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMirrorServiceRemoter_StartDataStreams_Name: var params = reader.decodeStruct(MirrorServiceRemoter_StartDataStreams_Params); this.startDataStreams(params.hasAudio, params.hasVideo).then(function(response) { var responseParams = new MirrorServiceRemoter_StartDataStreams_ResponseParams(); responseParams.audioStreamId = response.audioStreamId; responseParams.videoStreamId = response.videoStreamId; var builder = new codec.MessageV1Builder( kMirrorServiceRemoter_StartDataStreams_Name, codec.align(MirrorServiceRemoter_StartDataStreams_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MirrorServiceRemoter_StartDataStreams_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; case kMirrorServiceRemoter_EstimateTransmissionCapacity_Name: var params = reader.decodeStruct(MirrorServiceRemoter_EstimateTransmissionCapacity_Params); this.estimateTransmissionCapacity().then(function(response) { var responseParams = new MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams(); responseParams.rate = response.rate; var builder = new codec.MessageV1Builder( kMirrorServiceRemoter_EstimateTransmissionCapacity_Name, codec.align(MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); builder.encodeStruct(MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); }); return true; default: return false; } }; function validateMirrorServiceRemoterRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMirrorServiceRemoter_Start_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemoter_Start_Params; break; case kMirrorServiceRemoter_StartDataStreams_Name: if (message.expectsResponse()) paramsClass = MirrorServiceRemoter_StartDataStreams_Params; break; case kMirrorServiceRemoter_Stop_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemoter_Stop_Params; break; case kMirrorServiceRemoter_SendMessageToSink_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemoter_SendMessageToSink_Params; break; case kMirrorServiceRemoter_EstimateTransmissionCapacity_Name: if (message.expectsResponse()) paramsClass = MirrorServiceRemoter_EstimateTransmissionCapacity_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateMirrorServiceRemoterResponse(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMirrorServiceRemoter_StartDataStreams_Name: if (message.isResponse()) paramsClass = MirrorServiceRemoter_StartDataStreams_ResponseParams; break; case kMirrorServiceRemoter_EstimateTransmissionCapacity_Name: if (message.isResponse()) paramsClass = MirrorServiceRemoter_EstimateTransmissionCapacity_ResponseParams; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } var MirrorServiceRemoter = { name: 'media.mojom.MirrorServiceRemoter', kVersion: 0, ptrClass: MirrorServiceRemoterPtr, proxyClass: MirrorServiceRemoterProxy, stubClass: MirrorServiceRemoterStub, validateRequest: validateMirrorServiceRemoterRequest, validateResponse: validateMirrorServiceRemoterResponse, mojomId: 'media/mojo/interfaces/mirror_service_remoting.mojom', fuzzMethods: { start: { params: MirrorServiceRemoter_Start_Params, }, startDataStreams: { params: MirrorServiceRemoter_StartDataStreams_Params, }, stop: { params: MirrorServiceRemoter_Stop_Params, }, sendMessageToSink: { params: MirrorServiceRemoter_SendMessageToSink_Params, }, estimateTransmissionCapacity: { params: MirrorServiceRemoter_EstimateTransmissionCapacity_Params, }, }, }; MirrorServiceRemoterStub.prototype.validator = validateMirrorServiceRemoterRequest; MirrorServiceRemoterProxy.prototype.validator = validateMirrorServiceRemoterResponse; var kMirrorServiceRemotingSource_OnSinkAvailable_Name = 2084178884; var kMirrorServiceRemotingSource_OnMessageFromSink_Name = 1942422950; var kMirrorServiceRemotingSource_OnStopped_Name = 1809108448; var kMirrorServiceRemotingSource_OnError_Name = 872743823; function MirrorServiceRemotingSourcePtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(MirrorServiceRemotingSource, handleOrPtrInfo); } function MirrorServiceRemotingSourceAssociatedPtr(associatedInterfacePtrInfo) { this.ptr = new associatedBindings.AssociatedInterfacePtrController( MirrorServiceRemotingSource, associatedInterfacePtrInfo); } MirrorServiceRemotingSourceAssociatedPtr.prototype = Object.create(MirrorServiceRemotingSourcePtr.prototype); MirrorServiceRemotingSourceAssociatedPtr.prototype.constructor = MirrorServiceRemotingSourceAssociatedPtr; function MirrorServiceRemotingSourceProxy(receiver) { this.receiver_ = receiver; } MirrorServiceRemotingSourcePtr.prototype.onSinkAvailable = function() { return MirrorServiceRemotingSourceProxy.prototype.onSinkAvailable .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemotingSourceProxy.prototype.onSinkAvailable = function(metadata) { var params_ = new MirrorServiceRemotingSource_OnSinkAvailable_Params(); params_.metadata = metadata; var builder = new codec.MessageV0Builder( kMirrorServiceRemotingSource_OnSinkAvailable_Name, codec.align(MirrorServiceRemotingSource_OnSinkAvailable_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemotingSource_OnSinkAvailable_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MirrorServiceRemotingSourcePtr.prototype.onMessageFromSink = function() { return MirrorServiceRemotingSourceProxy.prototype.onMessageFromSink .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemotingSourceProxy.prototype.onMessageFromSink = function(message) { var params_ = new MirrorServiceRemotingSource_OnMessageFromSink_Params(); params_.message = message; var builder = new codec.MessageV0Builder( kMirrorServiceRemotingSource_OnMessageFromSink_Name, codec.align(MirrorServiceRemotingSource_OnMessageFromSink_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemotingSource_OnMessageFromSink_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MirrorServiceRemotingSourcePtr.prototype.onStopped = function() { return MirrorServiceRemotingSourceProxy.prototype.onStopped .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemotingSourceProxy.prototype.onStopped = function(reason) { var params_ = new MirrorServiceRemotingSource_OnStopped_Params(); params_.reason = reason; var builder = new codec.MessageV0Builder( kMirrorServiceRemotingSource_OnStopped_Name, codec.align(MirrorServiceRemotingSource_OnStopped_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemotingSource_OnStopped_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; MirrorServiceRemotingSourcePtr.prototype.onError = function() { return MirrorServiceRemotingSourceProxy.prototype.onError .apply(this.ptr.getProxy(), arguments); }; MirrorServiceRemotingSourceProxy.prototype.onError = function() { var params_ = new MirrorServiceRemotingSource_OnError_Params(); var builder = new codec.MessageV0Builder( kMirrorServiceRemotingSource_OnError_Name, codec.align(MirrorServiceRemotingSource_OnError_Params.encodedSize)); builder.encodeStruct(MirrorServiceRemotingSource_OnError_Params, params_); var message = builder.finish(); this.receiver_.accept(message); }; function MirrorServiceRemotingSourceStub(delegate) { this.delegate_ = delegate; } MirrorServiceRemotingSourceStub.prototype.onSinkAvailable = function(metadata) { return this.delegate_ && this.delegate_.onSinkAvailable && this.delegate_.onSinkAvailable(metadata); } MirrorServiceRemotingSourceStub.prototype.onMessageFromSink = function(message) { return this.delegate_ && this.delegate_.onMessageFromSink && this.delegate_.onMessageFromSink(message); } MirrorServiceRemotingSourceStub.prototype.onStopped = function(reason) { return this.delegate_ && this.delegate_.onStopped && this.delegate_.onStopped(reason); } MirrorServiceRemotingSourceStub.prototype.onError = function() { return this.delegate_ && this.delegate_.onError && this.delegate_.onError(); } MirrorServiceRemotingSourceStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); switch (reader.messageName) { case kMirrorServiceRemotingSource_OnSinkAvailable_Name: var params = reader.decodeStruct(MirrorServiceRemotingSource_OnSinkAvailable_Params); this.onSinkAvailable(params.metadata); return true; case kMirrorServiceRemotingSource_OnMessageFromSink_Name: var params = reader.decodeStruct(MirrorServiceRemotingSource_OnMessageFromSink_Params); this.onMessageFromSink(params.message); return true; case kMirrorServiceRemotingSource_OnStopped_Name: var params = reader.decodeStruct(MirrorServiceRemotingSource_OnStopped_Params); this.onStopped(params.reason); return true; case kMirrorServiceRemotingSource_OnError_Name: var params = reader.decodeStruct(MirrorServiceRemotingSource_OnError_Params); this.onError(); return true; default: return false; } }; MirrorServiceRemotingSourceStub.prototype.acceptWithResponder = function(message, responder) { var reader = new codec.MessageReader(message); switch (reader.messageName) { default: return false; } }; function validateMirrorServiceRemotingSourceRequest(messageValidator) { var message = messageValidator.message; var paramsClass = null; switch (message.getName()) { case kMirrorServiceRemotingSource_OnSinkAvailable_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemotingSource_OnSinkAvailable_Params; break; case kMirrorServiceRemotingSource_OnMessageFromSink_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemotingSource_OnMessageFromSink_Params; break; case kMirrorServiceRemotingSource_OnStopped_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemotingSource_OnStopped_Params; break; case kMirrorServiceRemotingSource_OnError_Name: if (!message.expectsResponse() && !message.isResponse()) paramsClass = MirrorServiceRemotingSource_OnError_Params; break; } if (paramsClass === null) return validator.validationError.NONE; return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); } function validateMirrorServiceRemotingSourceResponse(messageValidator) { return validator.validationError.NONE; } var MirrorServiceRemotingSource = { name: 'media.mojom.MirrorServiceRemotingSource', kVersion: 0, ptrClass: MirrorServiceRemotingSourcePtr, proxyClass: MirrorServiceRemotingSourceProxy, stubClass: MirrorServiceRemotingSourceStub, validateRequest: validateMirrorServiceRemotingSourceRequest, validateResponse: null, mojomId: 'media/mojo/interfaces/mirror_service_remoting.mojom', fuzzMethods: { onSinkAvailable: { params: MirrorServiceRemotingSource_OnSinkAvailable_Params, }, onMessageFromSink: { params: MirrorServiceRemotingSource_OnMessageFromSink_Params, }, onStopped: { params: MirrorServiceRemotingSource_OnStopped_Params, }, onError: { params: MirrorServiceRemotingSource_OnError_Params, }, }, }; MirrorServiceRemotingSourceStub.prototype.validator = validateMirrorServiceRemotingSourceRequest; MirrorServiceRemotingSourceProxy.prototype.validator = null; exports.MirrorServiceRemoter = MirrorServiceRemoter; exports.MirrorServiceRemoterPtr = MirrorServiceRemoterPtr; exports.MirrorServiceRemoterAssociatedPtr = MirrorServiceRemoterAssociatedPtr; exports.MirrorServiceRemotingSource = MirrorServiceRemotingSource; exports.MirrorServiceRemotingSourcePtr = MirrorServiceRemotingSourcePtr; exports.MirrorServiceRemotingSourceAssociatedPtr = MirrorServiceRemotingSourceAssociatedPtr; })();// Copyright 2014 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'; (function() { var mojomId = 'media/mojo/interfaces/remoting_common.mojom'; if (mojo.internal.isMojomLoaded(mojomId)) { console.warn('The following mojom is loaded multiple times: ' + mojomId); return; } mojo.internal.markMojomLoaded(mojomId); var bindings = mojo; var associatedBindings = mojo; var codec = mojo.internal; var validator = mojo.internal; var exports = mojo.internal.exposeNamespace('media.mojom'); var RemotingStopReason = {}; RemotingStopReason.ROUTE_TERMINATED = 0; RemotingStopReason.LOCAL_PLAYBACK = RemotingStopReason.ROUTE_TERMINATED + 1; RemotingStopReason.SOURCE_GONE = RemotingStopReason.LOCAL_PLAYBACK + 1; RemotingStopReason.MESSAGE_SEND_FAILED = RemotingStopReason.SOURCE_GONE + 1; RemotingStopReason.DATA_SEND_FAILED = RemotingStopReason.MESSAGE_SEND_FAILED + 1; RemotingStopReason.UNEXPECTED_FAILURE = RemotingStopReason.DATA_SEND_FAILED + 1; RemotingStopReason.SERVICE_GONE = RemotingStopReason.UNEXPECTED_FAILURE + 1; RemotingStopReason.USER_DISABLED = RemotingStopReason.SERVICE_GONE + 1; RemotingStopReason.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: return true; } return false; }; RemotingStopReason.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; var RemotingStartFailReason = {}; RemotingStartFailReason.CANNOT_START_MULTIPLE = 0; RemotingStartFailReason.ROUTE_TERMINATED = RemotingStartFailReason.CANNOT_START_MULTIPLE + 1; RemotingStartFailReason.SERVICE_NOT_CONNECTED = RemotingStartFailReason.ROUTE_TERMINATED + 1; RemotingStartFailReason.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: return true; } return false; }; RemotingStartFailReason.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; var RemotingSinkFeature = {}; RemotingSinkFeature.RENDERING = 0; RemotingSinkFeature.CONTENT_DECRYPTION = RemotingSinkFeature.RENDERING + 1; RemotingSinkFeature.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: return true; } return false; }; RemotingSinkFeature.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; var RemotingSinkAudioCapability = {}; RemotingSinkAudioCapability.CODEC_BASELINE_SET = 0; RemotingSinkAudioCapability.CODEC_AAC = RemotingSinkAudioCapability.CODEC_BASELINE_SET + 1; RemotingSinkAudioCapability.CODEC_OPUS = RemotingSinkAudioCapability.CODEC_AAC + 1; RemotingSinkAudioCapability.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: return true; } return false; }; RemotingSinkAudioCapability.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; var RemotingSinkVideoCapability = {}; RemotingSinkVideoCapability.SUPPORT_4K = 0; RemotingSinkVideoCapability.CODEC_BASELINE_SET = RemotingSinkVideoCapability.SUPPORT_4K + 1; RemotingSinkVideoCapability.CODEC_H264 = RemotingSinkVideoCapability.CODEC_BASELINE_SET + 1; RemotingSinkVideoCapability.CODEC_VP8 = RemotingSinkVideoCapability.CODEC_H264 + 1; RemotingSinkVideoCapability.CODEC_VP9 = RemotingSinkVideoCapability.CODEC_VP8 + 1; RemotingSinkVideoCapability.CODEC_HEVC = RemotingSinkVideoCapability.CODEC_VP9 + 1; RemotingSinkVideoCapability.isKnownEnumValue = function(value) { switch (value) { case 0: case 1: case 2: case 3: case 4: case 5: return true; } return false; }; RemotingSinkVideoCapability.validate = function(enumValue) { var isExtensible = false; if (isExtensible || this.isKnownEnumValue(enumValue)) return validator.validationError.NONE; return validator.validationError.UNKNOWN_ENUM_VALUE; }; function RemotingSinkMetadata(values) { this.initDefaults_(); this.initFields_(values); } RemotingSinkMetadata.prototype.initDefaults_ = function() { this.features = null; this.audioCapabilities = null; this.videoCapabilities = null; this.friendlyName = null; }; RemotingSinkMetadata.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; RemotingSinkMetadata.generate = function(generator_) { var generated = new RemotingSinkMetadata; generated.features = generator_.generateArray(function() { return generator_.generateEnum(0, 1); }); generated.audioCapabilities = generator_.generateArray(function() { return generator_.generateEnum(0, 2); }); generated.videoCapabilities = generator_.generateArray(function() { return generator_.generateEnum(0, 5); }); generated.friendlyName = generator_.generateString(false); return generated; }; RemotingSinkMetadata.prototype.mutate = function(mutator_) { if (mutator_.chooseMutateField()) { this.features = mutator_.mutateArray(this.features, function(val) { return mutator_.mutateEnum(val, 0, 1); }); } if (mutator_.chooseMutateField()) { this.audioCapabilities = mutator_.mutateArray(this.audioCapabilities, function(val) { return mutator_.mutateEnum(val, 0, 2); }); } if (mutator_.chooseMutateField()) { this.videoCapabilities = mutator_.mutateArray(this.videoCapabilities, function(val) { return mutator_.mutateEnum(val, 0, 5); }); } if (mutator_.chooseMutateField()) { this.friendlyName = mutator_.mutateString(this.friendlyName, false); } return this; }; RemotingSinkMetadata.prototype.getHandleDeps = function() { var handles = []; return handles; }; RemotingSinkMetadata.prototype.setHandles = function() { this.setHandlesInternal_(arguments, 0); }; RemotingSinkMetadata.prototype.setHandlesInternal_ = function(handles, idx) { return idx; }; RemotingSinkMetadata.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) return err; var kVersionSizes = [ {version: 0, numBytes: 40} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) return err; // validate RemotingSinkMetadata.features err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 4, new codec.Enum(RemotingSinkFeature), false, [0], 0); if (err !== validator.validationError.NONE) return err; // validate RemotingSinkMetadata.audioCapabilities err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 4, new codec.Enum(RemotingSinkAudioCapability), false, [0], 0); if (err !== validator.validationError.NONE) return err; // validate RemotingSinkMetadata.videoCapabilities err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 4, new codec.Enum(RemotingSinkVideoCapability), false, [0], 0); if (err !== validator.validationError.NONE) return err; // validate RemotingSinkMetadata.friendlyName err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, false) if (err !== validator.validationError.NONE) return err; return validator.validationError.NONE; }; RemotingSinkMetadata.encodedSize = codec.kStructHeaderSize + 32; RemotingSinkMetadata.decode = function(decoder) { var packed; var val = new RemotingSinkMetadata(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.features = decoder.decodeArrayPointer(new codec.Enum(RemotingSinkFeature)); val.audioCapabilities = decoder.decodeArrayPointer(new codec.Enum(RemotingSinkAudioCapability)); val.videoCapabilities = decoder.decodeArrayPointer(new codec.Enum(RemotingSinkVideoCapability)); val.friendlyName = decoder.decodeStruct(codec.String); return val; }; RemotingSinkMetadata.encode = function(encoder, val) { var packed; encoder.writeUint32(RemotingSinkMetadata.encodedSize); encoder.writeUint32(0); encoder.encodeArrayPointer(new codec.Enum(RemotingSinkFeature), val.features); encoder.encodeArrayPointer(new codec.Enum(RemotingSinkAudioCapability), val.audioCapabilities); encoder.encodeArrayPointer(new codec.Enum(RemotingSinkVideoCapability), val.videoCapabilities); encoder.encodeStruct(codec.String, val.friendlyName); }; exports.RemotingStopReason = RemotingStopReason; exports.RemotingStartFailReason = RemotingStartFailReason; exports.RemotingSinkFeature = RemotingSinkFeature; exports.RemotingSinkAudioCapability = RemotingSinkAudioCapability; exports.RemotingSinkVideoCapability = RemotingSinkVideoCapability; exports.RemotingSinkMetadata = RemotingSinkMetadata; })();PNG  IHDR**o`IDATx^1 C n.3(A$ހC;ߎDŽ,`N3QlyJ Ag uJ!C7'*膟.Ms *IENDB`PNG  IHDRJAuIDATx^Qj1@Q! ## K($y ,;ltYvBzO(#DQ6&}ɝE'̲ ,9VF|۲&ï&~! jY͑aRoFZ7'!fg7m>w%Za--4ȿޤI]IENDB`PNG  IHDR ?OsRGBIDATH VN@vmv )P;@qU"U굗K%$ޡ}@_^9Jr M I0qclf%fQ…wwfovu7I|J1V圯JZ1 yUUd>*x-j)bcpPet{&G'sX2) n#̄9jI[ϛu{H+Њ.~8G|kG7c )6?ml)iL ʱ!eL5NjXyRBx$xp,KR }>QB~FJ oR7jppꝚqcu`Qo4:1&t%շVࢡ]a!EӉNHՅJ -f<ӣKx}Bu4xP`yЦLQ=FNtD. @5pGˤ_QGY_ Bb۶c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  IHDRJ'.IDATcto/H9m,lg{ afd`qt8@zFIENDB`PNG  IHDRJ' IDATxcG C8dE +`A}IENDB`PNG  IHDRJ' IDATc  2!ÏARq9IENDB`PNG  IHDRrH IDATcfIENDB`PNG  IHDRrH IDATcg@ BIENDB`PNG  IHDRrH IDATcx-iIENDB`PNG  IHDRW{IDATxc B,5 jIENDB`PNG  IHDRW{IDATc "<4SIENDB`PNG  IHDRW{IDATxc N?B+Tʹ_IENDB`PNG  IHDRآ, IDATc zݭjIENDB`PNG  IHDRآ, IDATcr IENDB`PNG  IHDR!D?jAIDATx^̱ @PFћ$L`VTkkGmMԊ|/E ~+IAIENDB`PNG  IHDR!D?jGIDATxڥ1@@@8J܏=R-72P+DŦ֐`| ֠$u4_#.IENDB`PNG  IHDR!D?j?IDATcX Rn df y9[&IENDB`PNG  IHDR!D?j\*SIENDB`PNG  IHDRJ'IDATxcπ'$οH8,.4IENDB`PNG  IHDRJ'IDATxcπ$οH?8,98>IENDB`PNG  IHDRJ'IDATxcπ'$έHg8$,IENDB`PNG  IHDRJ'(IDATcπ, FaM6l|0of6_z4IENDB`PNG  IHDRJ'-IDATcπ, Fau6 #\0e\`2=p.ZIENDB`PNG  IHDRJ'%IDATxcπFaM6(LMӽ h #"IENDB`PNG  IHDRJ'IDATxcπ'$οqƟp*,A7IENDB`PNG  IHDRJ'IDATxcπ$οq?p3*,?W&1IENDB`PNG  IHDRH'IDATxc,ĿK.bX%Ǫ)iEIENDB`PNG  IHDRH%IDATxc,ĿK.2$رIjvIENDB`PNG  IHDRH&IDATxc|,Ľ{K.'\ uWIENDB`PNG  IHDRHHIDATxc?[W߿?c6o^$  E^o^p!l@,b oBd>W*IENDB`PNG  IHDRHUIDATxc?[W߿cl_>} $ p VԓE_o^p.@,@,`J d3F3ǵIENDB`PNG  IHDRHEIDATxc? OX¹ǛrªP%){OşBp (bM fK`](%a!IENDB`PNG  IHDRH)IDATxct % C$ dž@ +ŠhtWVIENDB`PNG  IHDRH)IDATxct % C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