|
1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 [ChromeOnly] |
|
8 interface Console { |
|
9 void log(any... data); |
|
10 void info(any... data); |
|
11 void warn(any... data); |
|
12 void error(any... data); |
|
13 void _exception(any... data); |
|
14 void debug(any... data); |
|
15 void trace(); |
|
16 void dir(any... data); |
|
17 void group(any... data); |
|
18 void groupCollapsed(any... data); |
|
19 void groupEnd(any... data); |
|
20 void time(optional any time); |
|
21 void timeEnd(optional any time); |
|
22 |
|
23 void profile(any... data); |
|
24 void profileEnd(any... data); |
|
25 |
|
26 void assert(boolean condition, any... data); |
|
27 void count(any... data); |
|
28 |
|
29 void ___noSuchMethod__(); |
|
30 }; |
|
31 |
|
32 // This is used to propagate console events to the observers. |
|
33 dictionary ConsoleEvent { |
|
34 (unsigned long or DOMString) ID; |
|
35 (unsigned long or DOMString) innerID; |
|
36 DOMString level = ""; |
|
37 DOMString filename = ""; |
|
38 unsigned long lineNumber = 0; |
|
39 DOMString functionName = ""; |
|
40 double timeStamp = 0; |
|
41 sequence<any> arguments; |
|
42 |
|
43 // This array will only hold strings or null elements. |
|
44 sequence<any> styles; |
|
45 |
|
46 boolean private = false; |
|
47 // stacktrace is handled via a getter in some cases so we can construct it |
|
48 // lazily. Note that we're not making this whole thing an interface because |
|
49 // consumers expect to see own properties on it, which would mean making the |
|
50 // props unforgeable, which means lots of JSFunction allocations. Maybe we |
|
51 // should fix those consumers, of course.... |
|
52 // sequence<ConsoleStackEntry> stacktrace; |
|
53 DOMString groupName = ""; |
|
54 any timer = null; |
|
55 any counter = null; |
|
56 }; |
|
57 |
|
58 // Event for profile operations |
|
59 dictionary ConsoleProfileEvent { |
|
60 DOMString action = ""; |
|
61 sequence<any> arguments; |
|
62 }; |
|
63 |
|
64 // This dictionary is used to manage stack trace data. |
|
65 dictionary ConsoleStackEntry { |
|
66 DOMString filename = ""; |
|
67 unsigned long lineNumber = 0; |
|
68 DOMString functionName = ""; |
|
69 unsigned long language = 0; |
|
70 }; |
|
71 |
|
72 dictionary ConsoleTimerStart { |
|
73 DOMString name = ""; |
|
74 double started = 0; |
|
75 }; |
|
76 |
|
77 dictionary ConsoleTimerEnd { |
|
78 DOMString name = ""; |
|
79 double duration = 0; |
|
80 }; |
|
81 |
|
82 dictionary ConsoleTimerError { |
|
83 DOMString error = "maxTimersExceeded"; |
|
84 }; |
|
85 |
|
86 dictionary ConsoleCounter { |
|
87 DOMString label = ""; |
|
88 unsigned long count = 0; |
|
89 }; |
|
90 |
|
91 dictionary ConsoleCounterError { |
|
92 DOMString error = "maxCountersExceeded"; |
|
93 }; |