summaryrefslogtreecommitdiffstats
path: root/toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl')
-rw-r--r--toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl35
1 files changed, 35 insertions, 0 deletions
diff --git a/toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl b/toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl
new file mode 100644
index 0000000000..71b6400c46
--- /dev/null
+++ b/toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl
@@ -0,0 +1,35 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=40: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+
+
+[scriptable, uuid(15686f9d-483e-4361-98cd-37f1e8f1e61d)]
+interface nsIFinalizationWitnessService: nsISupports
+{
+ /**
+ * Create a new Finalization Witness.
+ *
+ * A finalization witness is an object whose sole role is to
+ * broadcast when it is garbage-collected. Once the witness is
+ * created, call method its method |forget()| to prevent the
+ * broadcast.
+ *
+ * @param aTopic The topic that the witness will broadcast using
+ * Services.obs.
+ * @param aString The string that the witness will broadcast.
+ * @return An object with a single method |forget()|.
+ */
+ [implicit_jscontext]
+ jsval make(in string aTopic, in wstring aString);
+};
+
+%{ C++
+
+#define FINALIZATIONWITNESSSERVICE_CID {0x15686f9d,0x483e,0x4361,{0x98,0xcd,0x37,0xf1,0xe8,0xf1,0xe6,0x1d}}
+#define FINALIZATIONWITNESSSERVICE_CONTRACTID "@mozilla.org/toolkit/finalizationwitness;1"
+
+%}