summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/resources
diff options
context:
space:
mode:
authorimcheng <imcheng@chromium.org>2015-08-21 08:16:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-21 15:16:52 +0000
commit3bc8fd204cdceaa06917937a4e5c71dd1b1d71ef (patch)
tree8a889f83511a1a4ddc9c7885a5fa3b46811adb95 /extensions/renderer/resources
parent1b54517e7c454a1c7e8dfaa0835b4a534ab7aaf3 (diff)
downloadchromium_src-3bc8fd204cdceaa06917937a4e5c71dd1b1d71ef.zip
chromium_src-3bc8fd204cdceaa06917937a4e5c71dd1b1d71ef.tar.gz
chromium_src-3bc8fd204cdceaa06917937a4e5c71dd1b1d71ef.tar.bz2
[Media Router] Add OnPresentationSessionDetached to MediaRouter API.
OnPresentationSessionDetached() will be closed to notify the provider that a presentation session has been detached from the underlying MediaRoute due to garbage collection, navigation, etc., but not due to an explicit close() call. This patch introduces the API to MediaRouter and bindings. Note that a corresponding patch to add the API to the extension is required. In addition, this patch hooks up OnPresentationSessionDetached calls from PSDImpl::PresentationFrame::Reset(), which is called when the frame navigates or is about to be deleted. BUG=512930 TBR=avayvod@chromium.org Review URL: https://codereview.chromium.org/1302973003 Cr-Commit-Position: refs/heads/master@{#344768}
Diffstat (limited to 'extensions/renderer/resources')
-rw-r--r--extensions/renderer/resources/media_router_bindings.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/extensions/renderer/resources/media_router_bindings.js b/extensions/renderer/resources/media_router_bindings.js
index 6491d88..b0a468e 100644
--- a/extensions/renderer/resources/media_router_bindings.js
+++ b/extensions/renderer/resources/media_router_bindings.js
@@ -332,6 +332,11 @@ define('media_router_bindings', [
this.stopListeningForRouteMessages = null;
/**
+ * @type {function(string)}
+ */
+ this.onPresentationSessionDetached = null;
+
+ /**
* @type {function()}
*/
this.startObservingMediaRoutes = null;
@@ -382,6 +387,7 @@ define('media_router_bindings', [
'sendRouteBinaryMessage',
'listenForRouteMessages',
'stopListeningForRouteMessages',
+ 'onPresentationSessionDetached',
'closeRoute',
'joinRoute',
'createRoute',
@@ -535,6 +541,16 @@ define('media_router_bindings', [
};
/**
+ * Indicates that the presentation session that was connected to |routeId| is
+ * no longer connected to it.
+ * @param {!string} routeId
+ */
+ MediaRouteProvider.prototype.onPresentationSessionDetached = function(
+ routeId) {
+ this.handlers_.onPresentationSessionDetached(routeId);
+ };
+
+ /**
* Requests that the provider manager start sending information about active
* media routes to the Media Router.
*/