Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: remoting/webapp/session_connector.js

Issue 17449017: Delete and recreate the client plugin if WCS is reloaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/webapp/wcs_sandbox_container.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/session_connector.js
diff --git a/remoting/webapp/session_connector.js b/remoting/webapp/session_connector.js
index 86eff44973ff2bc36eada5ab96d9c0039c0309ef..ac8a2ae270f26fb6b04aa1518b663fea47fb9eb8 100644
--- a/remoting/webapp/session_connector.js
+++ b/remoting/webapp/session_connector.js
@@ -317,7 +317,7 @@ remoting.SessionConnector.prototype.onIT2MeHostInfo_ = function(xhr) {
* @private
*/
remoting.SessionConnector.prototype.loadWcs_ = function(token) {
- remoting.wcsSandbox.setOnReady(this.onWcsLoaded_.bind(this));
+ remoting.wcsSandbox.setOnLocalJid(this.onLocalJid_.bind(this));
remoting.wcsSandbox.setOnError(this.onError_);
remoting.wcsSandbox.setAccessToken(token);
this.startAccessTokenRefreshTimer_();
@@ -330,7 +330,7 @@ remoting.SessionConnector.prototype.loadWcs_ = function(token) {
* @return {void} Nothing.
* @private
*/
-remoting.SessionConnector.prototype.onWcsLoaded_ = function(clientJid) {
+remoting.SessionConnector.prototype.onLocalJid_ = function(clientJid) {
this.clientJid_ = clientJid;
this.createSessionIfReady_();
};
@@ -346,6 +346,14 @@ remoting.SessionConnector.prototype.createSessionIfReady_ = function() {
return;
}
+ // In some circumstances, the WCS <iframe> can get reloaded, which results
+ // in a new clientJid and a new callback. In this case, remove the old
+ // client plugin before instantiating a new one.
+ if (this.clientSession_) {
+ this.clientSession_.removePlugin();
+ this.clientSession_ = null;
+ }
+
var securityTypes = 'third_party,spake2_pair,spake2_hmac,spake2_plain';
this.clientSession_ = new remoting.ClientSession(
this.hostJid_, this.clientJid_, this.hostPublicKey_, this.passPhrase_,
« no previous file with comments | « no previous file | remoting/webapp/wcs_sandbox_container.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698