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

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

Issue 1082383002: [Webapp Refactor] Remove remoting.clientSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser tests 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
« no previous file with comments | « remoting/webapp/crd/js/desktop_remoting.js ('k') | remoting/webapp/crd/js/it2me_activity.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/desktop_remoting_activity.js
diff --git a/remoting/webapp/crd/js/desktop_remoting_activity.js b/remoting/webapp/crd/js/desktop_remoting_activity.js
index 768eccc8ad690616f5398a646de0cd215f0cbb7c..d31113058a06f25b3908ca031b46e69174918f63 100644
--- a/remoting/webapp/crd/js/desktop_remoting_activity.js
+++ b/remoting/webapp/crd/js/desktop_remoting_activity.js
@@ -24,6 +24,15 @@ remoting.DesktopRemotingActivity = function(parentActivity) {
this.parentActivity_ = parentActivity;
/** @private {remoting.DesktopConnectedView} */
this.connectedView_ = null;
+ /** @private {remoting.ClientSession} */
+ this.session_ = null;
+};
+
+remoting.DesktopRemotingActivity.prototype.stop = function() {
+ if (this.session_) {
+ this.session_.disconnect(remoting.Error.none());
+ console.log('Disconnected.');
+ }
};
/**
@@ -37,6 +46,8 @@ remoting.DesktopRemotingActivity.prototype.onConnected =
remoting.toolbar.preview();
}
+ this.session_ = connectionInfo.session();
+
this.connectedView_ = new remoting.DesktopConnectedView(
document.getElementById('client-container'), connectionInfo);
@@ -58,8 +69,7 @@ remoting.DesktopRemotingActivity.prototype.onConnected =
remoting.DesktopRemotingActivity.prototype.onDisconnected = function() {
this.parentActivity_.onDisconnected();
- base.dispose(this.connectedView_);
- this.connectedView_ = null;
+ this.dispose();
};
/**
@@ -84,13 +94,13 @@ remoting.DesktopRemotingActivity.prototype.onError = function(error) {
this.parentActivity_.onError(error);
- base.dispose(this.connectedView_);
- this.connectedView_ = null;
+ this.dispose();
};
remoting.DesktopRemotingActivity.prototype.dispose = function() {
base.dispose(this.connectedView_);
this.connectedView_ = null;
+ this.session_ = null;
};
/** @return {remoting.DesktopConnectedView} */
« no previous file with comments | « remoting/webapp/crd/js/desktop_remoting.js ('k') | remoting/webapp/crd/js/it2me_activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698