|
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=40: */ |
|
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 #include "nsISupports.idl" |
|
8 |
|
9 |
|
10 [scriptable, uuid(15686f9d-483e-4361-98cd-37f1e8f1e61d)] |
|
11 interface nsIFinalizationWitnessService: nsISupports |
|
12 { |
|
13 /** |
|
14 * Create a new Finalization Witness. |
|
15 * |
|
16 * A finalization witness is an object whose sole role is to |
|
17 * broadcast when it is garbage-collected. Once the witness is |
|
18 * created, call method its method |forget()| to prevent the |
|
19 * broadcast. |
|
20 * |
|
21 * @param aTopic The topic that the witness will broadcast using |
|
22 * Services.obs. |
|
23 * @param aString The string that the witness will broadcast. |
|
24 * @return An object with a single method |forget()|. |
|
25 */ |
|
26 [implicit_jscontext] |
|
27 jsval make(in string aTopic, in wstring aString); |
|
28 }; |
|
29 |
|
30 %{ C++ |
|
31 |
|
32 #define FINALIZATIONWITNESSSERVICE_CID {0x15686f9d,0x483e,0x4361,{0x98,0xcd,0x37,0xf1,0xe8,0xf1,0xe6,0x1d}} |
|
33 #define FINALIZATIONWITNESSSERVICE_CONTRACTID "@mozilla.org/toolkit/finalizationwitness;1" |
|
34 |
|
35 %} |