michael@0: /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: [ChromeOnly] michael@0: interface Console { michael@0: void log(any... data); michael@0: void info(any... data); michael@0: void warn(any... data); michael@0: void error(any... data); michael@0: void _exception(any... data); michael@0: void debug(any... data); michael@0: void trace(); michael@0: void dir(any... data); michael@0: void group(any... data); michael@0: void groupCollapsed(any... data); michael@0: void groupEnd(any... data); michael@0: void time(optional any time); michael@0: void timeEnd(optional any time); michael@0: michael@0: void profile(any... data); michael@0: void profileEnd(any... data); michael@0: michael@0: void assert(boolean condition, any... data); michael@0: void count(any... data); michael@0: michael@0: void ___noSuchMethod__(); michael@0: }; michael@0: michael@0: // This is used to propagate console events to the observers. michael@0: dictionary ConsoleEvent { michael@0: (unsigned long or DOMString) ID; michael@0: (unsigned long or DOMString) innerID; michael@0: DOMString level = ""; michael@0: DOMString filename = ""; michael@0: unsigned long lineNumber = 0; michael@0: DOMString functionName = ""; michael@0: double timeStamp = 0; michael@0: sequence arguments; michael@0: michael@0: // This array will only hold strings or null elements. michael@0: sequence styles; michael@0: michael@0: boolean private = false; michael@0: // stacktrace is handled via a getter in some cases so we can construct it michael@0: // lazily. Note that we're not making this whole thing an interface because michael@0: // consumers expect to see own properties on it, which would mean making the michael@0: // props unforgeable, which means lots of JSFunction allocations. Maybe we michael@0: // should fix those consumers, of course.... michael@0: // sequence stacktrace; michael@0: DOMString groupName = ""; michael@0: any timer = null; michael@0: any counter = null; michael@0: }; michael@0: michael@0: // Event for profile operations michael@0: dictionary ConsoleProfileEvent { michael@0: DOMString action = ""; michael@0: sequence arguments; michael@0: }; michael@0: michael@0: // This dictionary is used to manage stack trace data. michael@0: dictionary ConsoleStackEntry { michael@0: DOMString filename = ""; michael@0: unsigned long lineNumber = 0; michael@0: DOMString functionName = ""; michael@0: unsigned long language = 0; michael@0: }; michael@0: michael@0: dictionary ConsoleTimerStart { michael@0: DOMString name = ""; michael@0: double started = 0; michael@0: }; michael@0: michael@0: dictionary ConsoleTimerEnd { michael@0: DOMString name = ""; michael@0: double duration = 0; michael@0: }; michael@0: michael@0: dictionary ConsoleTimerError { michael@0: DOMString error = "maxTimersExceeded"; michael@0: }; michael@0: michael@0: dictionary ConsoleCounter { michael@0: DOMString label = ""; michael@0: unsigned long count = 0; michael@0: }; michael@0: michael@0: dictionary ConsoleCounterError { michael@0: DOMString error = "maxCountersExceeded"; michael@0: };