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

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: 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
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..7b078ade60ad7fc6ff32cc07d04ec150ae2a5434 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 numer of lines to record in the debug log. Only the most
simonmorris 2011/10/18 00:55:36 "numer" -> "number"
Jamie 2011/10/18 01:42:01 Done.
+ * recent <n> lines are displayed. */
+remoting.DebugLog.prototype.MAX_DEBUG_LOG_SIZE = 1000;
Jamie 2011/10/18 00:19:27 Getting rid of the scoping function would push thi
/**
* 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;

Powered by Google App Engine
This is Rietveld 408576698