summaryrefslogtreecommitdiffstats
path: root/xpcom/base/nsIMessageLoop.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /xpcom/base/nsIMessageLoop.idl
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/base/nsIMessageLoop.idl')
-rw-r--r--xpcom/base/nsIMessageLoop.idl36
1 files changed, 36 insertions, 0 deletions
diff --git a/xpcom/base/nsIMessageLoop.idl b/xpcom/base/nsIMessageLoop.idl
new file mode 100644
index 0000000000..b10d1c5761
--- /dev/null
+++ b/xpcom/base/nsIMessageLoop.idl
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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"
+
+interface nsIRunnable;
+
+/**
+ * This service allows access to the current thread's Chromium MessageLoop
+ * instance, with some extra sugar added. If you're calling from C++, it may
+ * or may not make sense for you to use this interface. If you're calling from
+ * JS, you don't have a choice!
+ *
+ * Right now, you can only call PostIdleTask(), and the wrath of khuey is
+ * stopping you from adding other methods.
+ *
+ * nsIMessageLoop's contractid is "@mozilla.org/message-loop;1".
+ */
+[scriptable, uuid(3E8C58E8-E52C-43E0-8E66-669CA788FF5F)]
+interface nsIMessageLoop : nsISupports
+{
+ /**
+ * Posts a task to be run when this thread's message loop is idle, or after
+ * ensureRunsAfterMS milliseconds have elapsed. (That is, the task is
+ * guaranteed to run /eventually/.)
+ *
+ * Note that if the event loop is busy, we will hold a reference to the task
+ * until ensureRunsAfterMS milliseconds have elapsed. Be careful when
+ * specifying long timeouts and tasks which hold references to windows or
+ * other large objects, because you can leak memory in a difficult-to-detect
+ * way!
+ */
+ void postIdleTask(in nsIRunnable task, in uint32_t ensureRunsAfterMS);
+};