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