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