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

Unified Diff: chrome/browser/resources/net_internals/util.js

Issue 7564029: Use javascript strict mode throughout a number of net-internals files. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix one more var Created 9 years, 5 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 | « chrome/browser/resources/net_internals/test_view.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/util.js
===================================================================
--- chrome/browser/resources/net_internals/util.js (revision 95298)
+++ chrome/browser/resources/net_internals/util.js (working copy)
@@ -143,6 +143,18 @@
}
/**
+ * Helper to make sure singleton classes are not instantiated more than once.
+ */
+function assertFirstConstructorCall(ctor) {
+ // This is the variable which is set by cr.addSingletonGetter().
+ if (ctor.hasCreateFirstInstance_) {
+ throw Error('The class ' + ctor.name + ' is a singleton, and should ' +
+ 'only be accessed using ' + ctor.name + '.getInstance().');
+ }
+ ctor.hasCreateFirstInstance_ = true;
+}
+
+/**
* TablePrinter is a helper to format a table as ascii art or an HTML table.
*
* Usage: call addRow() and addCell() repeatedly to specify the data.
« no previous file with comments | « chrome/browser/resources/net_internals/test_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698