Bug 1440729 - Include use counters for the console API draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 23 Feb 2018 16:11:16 -0800
changeset 759259 fbbe9809e58c004cf8c9c192ff48626a08fa7971
parent 754399 38b3c1d03a594664c6b32c35533734283c258f43
push id100325
push userbgrinstead@mozilla.com
push dateSat, 24 Feb 2018 00:13:33 +0000
bugs1440729
milestone60.0a1
Bug 1440729 - Include use counters for the console API MozReview-Commit-ID: 9A1lllxW7lM
dom/base/UseCounters.conf
dom/webidl/Console.webidl
--- a/dom/base/UseCounters.conf
+++ b/dom/base/UseCounters.conf
@@ -88,8 +88,31 @@ method DataTransfer.mozClearDataAt
 method DataTransfer.mozSetDataAt
 method DataTransfer.mozGetDataAt
 attribute DataTransfer.mozUserCancelled
 attribute DataTransfer.mozSourceNode
 
 // JavaScript feature usage
 custom JS_asmjs uses asm.js
 custom JS_wasm uses WebAssembly
+
+// Console API
+method console.assert
+method console.clear
+method console.count
+method console.debug
+method console.error
+method console.info
+method console.log
+method console.table
+method console.trace
+method console.warn
+method console.dir
+method console.dirxml
+method console.group
+method console.groupCollapsed
+method console.groupEnd
+method console.time
+method console.timeEnd
+method console.exception
+method console.timeStamp
+method console.profile
+method console.profileEnd
--- a/dom/webidl/Console.webidl
+++ b/dom/webidl/Console.webidl
@@ -12,44 +12,65 @@
  ClassString="Console",
  ProtoObjectHack]
 namespace console {
 
   // NOTE: if you touch this namespace, remember to update the ConsoleInstance
   // interface as well!
 
   // Logging
+  [UseCounter]
   void assert(optional boolean condition = false, any... data);
+  [UseCounter]
   void clear();
+  [UseCounter]
   void count(optional DOMString label = "default");
+  [UseCounter]
   void debug(any... data);
+  [UseCounter]
   void error(any... data);
+  [UseCounter]
   void info(any... data);
+  [UseCounter]
   void log(any... data);
+  [UseCounter]
   void table(any... data); // FIXME: The spec is still unclear about this.
+  [UseCounter]
   void trace(any... data);
+  [UseCounter]
   void warn(any... data);
+  [UseCounter]
   void dir(any... data); // FIXME: This doesn't follow the spec yet.
+  [UseCounter]
   void dirxml(any... data);
 
   // Grouping
+  [UseCounter]
   void group(any... data);
+  [UseCounter]
   void groupCollapsed(any... data);
+  [UseCounter]
   void groupEnd();
 
   // Timing
+  [UseCounter]
   void time(optional DOMString label = "default");
+  [UseCounter]
   void timeEnd(optional DOMString label = "default");
 
   // Mozilla only or Webcompat methods
 
+  [UseCounter]
   void _exception(any... data);
+  [UseCounter]
   void timeStamp(optional any data);
 
+  [UseCounter]
   void profile(any... data);
+  [UseCounter]
   void profileEnd(any... data);
 
   [ChromeOnly]
   const boolean IS_NATIVE_CONSOLE = true;
 
   [ChromeOnly, NewObject]
   ConsoleInstance createInstance(optional ConsoleInstanceOptions options);
 };