summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
authorsimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 22:19:15 +0000
committersimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 22:19:15 +0000
commitd8631304fc6aca953f3cb9410a23c7cb3f12c70f (patch)
tree3c7c9b23c639dfcca15262bfe8c4f2bd5ec96311 /remoting/webapp
parentd63d7b2c71f50509bdd41c648d8ac1b90683dc19 (diff)
downloadchromium_src-d8631304fc6aca953f3cb9410a23c7cb3f12c70f.zip
chromium_src-d8631304fc6aca953f3cb9410a23c7cb3f12c70f.tar.gz
chromium_src-d8631304fc6aca953f3cb9410a23c7cb3f12c70f.tar.bz2
[Chromoting] Make the client plugin tell the webapp when the first video buffer arrives.
A follow-up CL will make the pyauto test wait until the first video buffer arrives before declaring that a connection has succeeded. BUG=129791 Review URL: https://chromiumcodereview.appspot.com/10444035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r--remoting/webapp/client_plugin_async.js4
-rw-r--r--remoting/webapp/client_session.js17
2 files changed, 21 insertions, 0 deletions
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js
index d837cd5..b016e03 100644
--- a/remoting/webapp/client_plugin_async.js
+++ b/remoting/webapp/client_plugin_async.js
@@ -189,6 +189,10 @@ remoting.ClientPluginAsync.prototype.handleMessage_ = function(messageStr) {
remoting.clipboard.fromHost(message.data['mimeType'],
message.data['item']);
}
+ } else if (message.method == 'onFirstFrameReceived') {
+ if (remoting.clientSession) {
+ remoting.clientSession.onFirstFrameReceived();
+ }
}
}
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index a73a8cf..dfccccd 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -56,6 +56,7 @@ remoting.ClientSession = function(hostJid, hostPublicKey, sharedSecret,
/** @type {remoting.ClientPlugin} */
this.plugin = null;
this.scaleToFit = false;
+ this.hasReceivedFrame_ = false;
this.logToServer = new remoting.LogToServer();
this.onStateChange = onStateChange;
@@ -421,6 +422,22 @@ remoting.ClientSession.prototype.getScaleToFit = function() {
}
/**
+ * Called when the client receives its first frame.
+ *
+ * @return {void} Nothing.
+ */
+remoting.ClientSession.prototype.onFirstFrameReceived = function() {
+ this.hasReceivedFrame_ = true;
+};
+
+/**
+ * @return {boolean} Whether the client has received a video buffer.
+ */
+remoting.ClientSession.prototype.hasReceivedFrame = function() {
+ return this.hasReceivedFrame_;
+};
+
+/**
* Sends an IQ stanza via the http xmpp proxy.
*
* @private