Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIConsoleListener; |
michael@0 | 9 | interface nsIConsoleMessage; |
michael@0 | 10 | |
michael@0 | 11 | [scriptable, uuid(0eb81d20-c37e-42d4-82a8-ca9ae96bdf52)] |
michael@0 | 12 | interface nsIConsoleService : nsISupports |
michael@0 | 13 | { |
michael@0 | 14 | void logMessage(in nsIConsoleMessage message); |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * Convenience method for logging simple messages. |
michael@0 | 18 | */ |
michael@0 | 19 | void logStringMessage(in wstring message); |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | * Get an array of all the messages logged so far. If no messages |
michael@0 | 23 | * are logged, this function will return a count of 0, but still |
michael@0 | 24 | * will allocate one word for messages, so as to show up as a |
michael@0 | 25 | * 0-length array when called from script. |
michael@0 | 26 | */ |
michael@0 | 27 | void getMessageArray([optional] out uint32_t count, |
michael@0 | 28 | [retval, array, size_is(count)] out nsIConsoleMessage messages); |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * To guard against stack overflows from listeners that could log |
michael@0 | 32 | * messages (it's easy to do this inadvertently from listeners |
michael@0 | 33 | * implemented in JavaScript), we don't call any listeners when |
michael@0 | 34 | * another error is already being logged. |
michael@0 | 35 | */ |
michael@0 | 36 | void registerListener(in nsIConsoleListener listener); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Each registered listener should also be unregistered. |
michael@0 | 40 | */ |
michael@0 | 41 | void unregisterListener(in nsIConsoleListener listener); |
michael@0 | 42 | |
michael@0 | 43 | /** |
michael@0 | 44 | * Clear the message buffer (e.g. for privacy reasons). |
michael@0 | 45 | */ |
michael@0 | 46 | void reset(); |
michael@0 | 47 | }; |
michael@0 | 48 | |
michael@0 | 49 | |
michael@0 | 50 | %{ C++ |
michael@0 | 51 | #define NS_CONSOLESERVICE_CID \ |
michael@0 | 52 | { 0x7e3ff85c, 0x1dd2, 0x11b2, { 0x8d, 0x4b, 0xeb, 0x45, 0x2c, 0xb0, 0xff, 0x40 }} |
michael@0 | 53 | |
michael@0 | 54 | #define NS_CONSOLESERVICE_CONTRACTID "@mozilla.org/consoleservice;1" |
michael@0 | 55 | %} |
michael@0 | 56 |