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

Unified Diff: remoting/webapp/crd/js/client_session.js

Issue 1101613003: [Webapp Refactor] Reliably cancels a connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ImproveUnittest
Patch Set: Reviewer's feedback Created 5 years, 8 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
Index: remoting/webapp/crd/js/client_session.js
diff --git a/remoting/webapp/crd/js/client_session.js b/remoting/webapp/crd/js/client_session.js
index 8a6bdb870f63bcd1b15258e48dc3c7dd16452a25..01d1fc3c347ecadedfaeca2e9803e50fa44921b1 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -285,6 +285,10 @@ remoting.ClientSession.prototype.connect = function(host, credentialsProvider) {
* @return {void} Nothing.
*/
remoting.ClientSession.prototype.disconnect = function(error) {
+ if (this.isFinished()) {
+ return;
+ }
+
this.sendIq_(
'<cli:iq ' +
'to="' + this.host_.jabberId + '" ' +

Powered by Google App Engine
This is Rietveld 408576698