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

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

Issue 803653004: Update Chromoting to use /third_party/closure_compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused types Created 5 years, 11 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/it2me_helper_channel.js
diff --git a/remoting/webapp/crd/js/it2me_helper_channel.js b/remoting/webapp/crd/js/it2me_helper_channel.js
index 84608be60b576a47744dfaeb15e05b15a719a643..a05ad60328ae26ca12cff53ec86f6a18fcfafe1c 100644
--- a/remoting/webapp/crd/js/it2me_helper_channel.js
+++ b/remoting/webapp/crd/js/it2me_helper_channel.js
@@ -166,8 +166,8 @@ remoting.It2MeHelperChannel.prototype.onHangoutMessage_ = function(message) {
return true;
}
throw new Error('Unknown message method=' + message.method);
- } catch(e) {
- var error = /** @type {Error} */ e;
+ } catch(/** @type {*} */ e) {
+ var error = /** @type {Error} */ (e);
this.sendErrorResponse_(this.hangoutPort_, error, message);
}
return false;
@@ -204,18 +204,19 @@ remoting.It2MeHelperChannel.prototype.launchWebapp_ =
throw new Error('Access code is missing');
}
+ /**
+ * @this {remoting.It2MeHelperChannel}
+ * @param {string} instanceId
+ */
+ var setInstance = function(instanceId) {
+ this.instanceId_ = instanceId;
+ };
+
// Launch the webapp.
this.appLauncher_.launch({
mode: 'hangout',
accessCode: accessCode
- }).then(
- /**
- * @this {remoting.It2MeHelperChannel}
- * @param {string} instanceId
- */
- function(instanceId){
- this.instanceId_ = instanceId;
- }.bind(this));
+ }).then(setInstance.bind(this));
};
/**
@@ -270,13 +271,13 @@ remoting.It2MeHelperChannel.prototype.onWebappMessage_ = function(message) {
case MessageTypes.SESSION_STATE_CHANGED:
var state = getNumberAttr(message, 'state');
this.sessionState_ =
- /** @type {remoting.ClientSession.State} */ state;
+ /** @type {remoting.ClientSession.State} */(state);
this.hangoutPort_.postMessage(message);
return true;
}
throw new Error('Unknown message method=' + message.method);
- } catch(e) {
- var error = /** @type {Error} */ e;
+ } catch(/** @type {*} */ e) {
+ var error = /** @type {Error} */ (e);
this.sendErrorResponse_(this.webappPort_, error, message);
}
return false;

Powered by Google App Engine
This is Rietveld 408576698