Commit e0790171 authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

[CastRunner] Allow Agent's enable-touch bindings to supercede the Runner's.

Prevents the CastRunner from clobbering the Agent's
setTouchSupportEnabled() platform API if it's already been installed.

Bug: 953796,953958
Change-Id: Ia1044a96209f04d792a8c671a8ac18eb98b2d9ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728445Reviewed-by: default avatarFabrice de Gans-Riberi <fdegans@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683227}
parent 086bfcee
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
'use strict'; 'use strict';
cast.__platform__.__touchInput__ = new class { // Don't supercede an Agent-provided API function.
if (!cast.__platform__.setTouchInputSupport) {
cast.__platform__.__touchInput__ = new class {
constructor() { constructor() {
this.port_ = cast.__platform__.PortConnector.bind( this.port_ = cast.__platform__.PortConnector.bind(
'cast.__platform__.__touchInput__'); 'cast.__platform__.__touchInput__');
...@@ -60,14 +62,15 @@ cast.__platform__.__touchInput__ = new class { ...@@ -60,14 +62,15 @@ cast.__platform__.__touchInput__ = new class {
// bindings layer. // bindings layer.
port_ = null; port_ = null;
// A dictionary relating inflight request IDs to their Promise resolve/reject // A dictionary relating inflight request IDs to their Promise
// functions. // resolve/reject functions.
pendingRequests_ = {}; pendingRequests_ = {};
// Unique ID of the next request. // Unique ID of the next request.
currentRequestId_ = 0; currentRequestId_ = 0;
}; };
cast.__platform__.setTouchInputSupport = cast.__platform__.setTouchInputSupport =
cast.__platform__.__touchInput__.setTouchInputSupport.bind( cast.__platform__.__touchInput__.setTouchInputSupport.bind(
cast.__platform__.__touchInput__); cast.__platform__.__touchInput__);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment