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

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

Issue 1012073006: [Webapp Refactor] Removes the client plugin on disconnect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 a77be6934f6ad28c156d6c4f50d9aa5071c593c9..f3834d53a7709ce06273507542953daaf8728c4b 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -241,13 +241,6 @@ remoting.ClientSession.prototype.hasCapability = function(capability) {
};
/**
- * @return {void} Nothing.
- */
-remoting.ClientSession.prototype.removePlugin = function() {
kelvinp 2015/03/18 20:08:35 This is a misleading name as it doesn't remove the
- this.plugin_ = null;
-};
-
-/**
* Disconnect the current session with a particular |error|. The session will
* raise a |stateChanged| event in response to it. The caller should then call
* dispose() to remove and destroy the <embed> element.
@@ -257,6 +250,20 @@ remoting.ClientSession.prototype.removePlugin = function() {
* @return {void} Nothing.
*/
remoting.ClientSession.prototype.disconnect = function(error) {
+ this.sendIq_(
+ '<cli:iq ' +
+ 'to="' + this.host_.jabberId + '" ' +
+ 'type="set" ' +
+ 'id="session-terminate" ' +
+ 'xmlns:cli="jabber:client">' +
+ '<jingle ' +
+ 'xmlns="urn:xmpp:jingle:1" ' +
+ 'action="session-terminate" ' +
+ 'sid="' + this.sessionId_ + '">' +
+ '<reason><success/></reason>' +
+ '</jingle>' +
+ '</cli:iq>');
+
var state = error.isNone() ?
remoting.ClientSession.State.CLOSED :
remoting.ClientSession.State.FAILED;
@@ -274,20 +281,7 @@ remoting.ClientSession.prototype.disconnect = function(error) {
* @return {void} Nothing.
*/
remoting.ClientSession.prototype.dispose = function() {
- this.sendIq_(
- '<cli:iq ' +
- 'to="' + this.host_.jabberId + '" ' +
- 'type="set" ' +
- 'id="session-terminate" ' +
- 'xmlns:cli="jabber:client">' +
- '<jingle ' +
- 'xmlns="urn:xmpp:jingle:1" ' +
- 'action="session-terminate" ' +
- 'sid="' + this.sessionId_ + '">' +
- '<reason><success/></reason>' +
- '</jingle>' +
- '</cli:iq>');
- this.removePlugin();
+ this.plugin_ = null;
};
/**

Powered by Google App Engine
This is Rietveld 408576698