Bug 1834993 - Fix nursery allocatable flag for objects with foreground finalizers...
[gecko.git] / dom / console / nsIConsoleAPIStorage.idl
blobec3638c29505f55d38cc39e0f8bbe1a48d91a46c
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
7 #include "nsIPrincipal.idl"
9 [scriptable, uuid(9e32a7b6-c4d1-4d9a-87b9-1ef6b75c27a9)]
10 interface nsIConsoleAPIStorage : nsISupports
12 /**
13 * Get the events array by inner window ID or all events from all windows.
15 * @param string [aId]
16 * Optional, the inner window ID for which you want to get the array of
17 * cached events.
18 * @returns array
19 * The array of cached events for the given window. If no |aId| is
20 * given this function returns all of the cached events, from any
21 * window.
23 jsval getEvents([optional] in AString aId);
25 /**
26 * Adds a listener to be notified of log events.
28 * @param jsval [aListener]
29 * A JS listener which will be notified with the message object when
30 * a log event occurs.
31 * @param nsIPrincipal [aPrincipal]
32 * The principal of the listener - used to determine if we need to
33 * clone the message before forwarding it.
35 void addLogEventListener(in jsval aListener, in nsIPrincipal aPrincipal);
37 /**
38 * Removes a listener added with `addLogEventListener`.
40 * @param jsval [aListener]
41 * A JS listener which was added with `addLogEventListener`.
43 void removeLogEventListener(in jsval aListener);
45 /**
46 * Record an event associated with the given window ID.
48 * @param string aId
49 * The ID of the inner window for which the event occurred or "jsm" for
50 * messages logged from JavaScript modules..
51 * @param object aEvent
52 * A JavaScript object you want to store.
54 void recordEvent(in AString aId, in jsval aEvent);
56 /**
57 * Clear storage data for the given window.
59 * @param string [aId]
60 * Optional, the inner window ID for which you want to clear the
61 * messages. If this is not specified all of the cached messages are
62 * cleared, from all window objects.
64 void clearEvents([optional] in AString aId);