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

Unified Diff: remoting/webapp/hangout_session.js

Issue 450383003: Hangout remote desktop part II - background.html and AppLauncher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/hangout_session.js
diff --git a/remoting/webapp/hangout_session.js b/remoting/webapp/hangout_session.js
index 7f11ee308ed62539e48c9db0eec58c7858baf9a8..ab4ffab410569c6c52b4474b0efc8fbf8e577f95 100644
--- a/remoting/webapp/hangout_session.js
+++ b/remoting/webapp/hangout_session.js
@@ -16,19 +16,26 @@
var remoting = remoting || {};
/**
+ * @param {string} senderId id of the current tab or window.
* @constructor
*/
-remoting.HangoutSession = function() {
+remoting.HangoutSession = function(senderId) {
/**
* @private
- * @type {chrome.extension.Port}
+ * @type {chrome.runtime.Port}
*/
this.port_ = null;
+
+ /**
+ * @private
+ * @type {string}
+ */
+ this.senderId_ = senderId;
};
remoting.HangoutSession.prototype.init = function() {
- this.port_ = chrome.runtime.connect({name: 'it2me.helper.webapp'});
-
+ var portName = 'it2me.helper.webapp@' + this.senderId_;
+ this.port_ = chrome.runtime.connect({name: portName});
remoting.hangoutSessionEvents.addEventListener(
remoting.hangoutSessionEvents.sessionStateChanged,
this.onSessionStateChanged_.bind(this));
@@ -44,6 +51,8 @@ remoting.HangoutSession.prototype.onSessionStateChanged_ = function(state) {
} catch (e) {
// postMessage will throw an exception if the port is disconnected.
// We can safely ignore this exception.
+ var error = /** @type{Error} */ e;
+ console.error(error);
} finally {
if (state === State.FAILED || state === State.CLOSED) {
// close the current window

Powered by Google App Engine
This is Rietveld 408576698