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

Unified Diff: remoting/webapp/me2mom/wcs.js

Issue 8336004: Improve web-app type safety. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 2 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/me2mom/viewer_plugin_proto.js ('k') | remoting/webapp/me2mom/wcs_iq_client_proto.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/wcs.js
diff --git a/remoting/webapp/me2mom/wcs.js b/remoting/webapp/me2mom/wcs.js
index ff7692ed261669d48da52662276460dbadac56c1..fc1db45f40e7f8601aa9f54b6abfddb8c15ef641 100644
--- a/remoting/webapp/me2mom/wcs.js
+++ b/remoting/webapp/me2mom/wcs.js
@@ -13,7 +13,9 @@
/** @suppress {duplicate} */
var remoting = remoting || {};
-(function() {
+/** @type {remoting.Wcs} */
+remoting.wcs = null;
+
/**
* @constructor
*
@@ -55,6 +57,7 @@ remoting.Wcs = function(wcsIqClient, token, onReady, refreshToken) {
*/
this.clientFullJid_ = '';
+ /** @type {remoting.Wcs} */
var that = this;
/**
* A timer that polls for an updated access token.
@@ -67,13 +70,15 @@ remoting.Wcs = function(wcsIqClient, token, onReady, refreshToken) {
/**
* A function called when an IQ stanza is received.
- * @type {function(string): void}
+ * @param {string} stanza The IQ stanza.
* @private
*/
this.onIq_ = function(stanza) {};
// Handle messages from the WcsIqClient.
- this.wcsIqClient_.setOnMessage(function(msg) { that.onMessage_(msg); });
+ /** @param {Array.<string>} msg An array of message strings. */
+ var onMessage = function(msg) { that.onMessage_(msg); };
+ this.wcsIqClient_.setOnMessage(onMessage);
// Start the WcsIqClient.
this.wcsIqClient_.connectChannel();
@@ -96,7 +101,7 @@ remoting.Wcs.prototype.setToken_ = function(tokenNew) {
/**
* Handles a message coming from the WcsIqClient.
*
- * @param {Array} msg The message.
+ * @param {Array.<string>} msg The message.
* @return {void} Nothing.
* @private
*/
@@ -140,5 +145,3 @@ remoting.Wcs.prototype.sendIq = function(stanza) {
remoting.Wcs.prototype.setOnIq = function(onIq) {
this.onIq_ = onIq;
};
-
-}());
« no previous file with comments | « remoting/webapp/me2mom/viewer_plugin_proto.js ('k') | remoting/webapp/me2mom/wcs_iq_client_proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698