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

Unified Diff: remoting/webapp/me2mom/debug_log.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/client_session.js ('k') | remoting/webapp/me2mom/host_plugin_proto.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/debug_log.js
diff --git a/remoting/webapp/me2mom/debug_log.js b/remoting/webapp/me2mom/debug_log.js
index f5f550180f89a766206ea7874a9b99811d67f4b8..3d79fdd3db69612ff116333a8db3a2c699cba0fd 100644
--- a/remoting/webapp/me2mom/debug_log.js
+++ b/remoting/webapp/me2mom/debug_log.js
@@ -12,16 +12,17 @@
/** @suppress {duplicate} */
var remoting = remoting || {};
-(function() {
-
-/** @constructor */
+/**
+ * @constructor
+ * @param {Element} logElement The HTML div to which to add log messages.
+ */
remoting.DebugLog = function(logElement) {
this.debugLog = logElement;
-}
+};
-// Maximum numer of lines to record in the debug log.
-// Only the most recent <n> lines are displayed.
-var MAX_DEBUG_LOG_SIZE = 1000;
+/** Maximum number of lines to record in the debug log. Only the most
+ * recent <n> lines are displayed. */
+remoting.DebugLog.prototype.MAX_DEBUG_LOG_SIZE = 1000;
/**
* Add the given message to the debug log.
@@ -30,7 +31,7 @@ var MAX_DEBUG_LOG_SIZE = 1000;
*/
remoting.DebugLog.prototype.log = function(message) {
// Remove lines from top if we've hit our max log size.
- if (this.debugLog.childNodes.length == MAX_DEBUG_LOG_SIZE) {
+ if (this.debugLog.childNodes.length == this.MAX_DEBUG_LOG_SIZE) {
this.debugLog.removeChild(this.debugLog.firstChild);
}
@@ -41,6 +42,7 @@ remoting.DebugLog.prototype.log = function(message) {
// Scroll to bottom of div
this.debugLog.scrollTop = this.debugLog.scrollHeight;
-}
+};
-}());
+/** @type {remoting.DebugLog} */
+remoting.debug = null;
« no previous file with comments | « remoting/webapp/me2mom/client_session.js ('k') | remoting/webapp/me2mom/host_plugin_proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698