summaryrefslogtreecommitdiffstats
path: root/xpcom/base/nsIException.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /xpcom/base/nsIException.idl
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/base/nsIException.idl')
-rw-r--r--xpcom/base/nsIException.idl80
1 files changed, 80 insertions, 0 deletions
diff --git a/xpcom/base/nsIException.idl b/xpcom/base/nsIException.idl
new file mode 100644
index 0000000000..7f529e1c08
--- /dev/null
+++ b/xpcom/base/nsIException.idl
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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/. */
+
+/*
+ * Interfaces for representing cross-language exceptions and stack traces.
+ */
+#include "nsISupports.idl"
+
+[ptr] native JSContext(JSContext);
+native StackFrameRef(already_AddRefed<nsIStackFrame>);
+
+[scriptable, builtinclass, uuid(28bfb2a2-5ea6-4738-918b-049dc4d51f0b)]
+interface nsIStackFrame : nsISupports
+{
+ [implicit_jscontext, binaryname(FilenameXPCOM)]
+ readonly attribute AString filename;
+ [implicit_jscontext, binaryname(NameXPCOM)]
+ readonly attribute AString name;
+ // Unique identifier of the script source for the frame, or zero.
+ [implicit_jscontext, binaryname(SourceIdXPCOM)]
+ readonly attribute int32_t sourceId;
+ // Valid line numbers begin at '1'. '0' indicates unknown.
+ [implicit_jscontext, binaryname(LineNumberXPCOM)]
+ readonly attribute int32_t lineNumber;
+ [implicit_jscontext, binaryname(ColumnNumberXPCOM)]
+ readonly attribute int32_t columnNumber;
+ readonly attribute AUTF8String sourceLine;
+ [implicit_jscontext, binaryname(AsyncCauseXPCOM)]
+ readonly attribute AString asyncCause;
+ [implicit_jscontext, binaryname(AsyncCallerXPCOM)]
+ readonly attribute nsIStackFrame asyncCaller;
+ [implicit_jscontext, binaryname(CallerXPCOM)]
+ readonly attribute nsIStackFrame caller;
+
+ // Returns a formatted stack string that looks like the sort of
+ // string that would be returned by .stack on JS Error objects.
+ // Only works on JS-language stack frames.
+ [implicit_jscontext, binaryname(FormattedStackXPCOM)]
+ readonly attribute AString formattedStack;
+
+ // Returns the underlying SavedFrame object for native JavaScript stacks,
+ // or null if this is not a native JavaScript stack frame.
+ readonly attribute jsval nativeSavedFrame;
+
+ [implicit_jscontext, binaryname(ToStringXPCOM)]
+ AUTF8String toString();
+
+ // Infallible things to be called from C++.
+ [notxpcom, nostdcall]
+ void getFilename(in JSContext aCx, out AString aFilename);
+ [notxpcom, nostdcall]
+ void getName(in JSContext aCx, out AString aName);
+ [notxpcom, nostdcall]
+ int32_t getSourceId(in JSContext aCx);
+ [notxpcom, nostdcall]
+ int32_t getLineNumber(in JSContext aCx);
+ [notxpcom, nostdcall]
+ int32_t getColumnNumber(in JSContext aCx);
+ [notxpcom, nostdcall]
+ void getAsyncCause(in JSContext aCx, out AString aAsyncCause);
+ [notxpcom, nostdcall]
+ StackFrameRef getAsyncCaller(in JSContext aCx);
+ [notxpcom, nostdcall]
+ StackFrameRef getCaller(in JSContext aCx);
+ [notxpcom, nostdcall]
+ void getFormattedStack(in JSContext aCx, out AString aFormattedStack);
+ [notxpcom, nostdcall, binaryname(ToString)]
+ void toStringInfallible(in JSContext aCx, out AUTF8String aString);
+};
+
+// This interface only exists because of all the JS consumers doing
+// "instanceof Ci.nsIException". We should switch them to something else and
+// get rid of it; bug 1435856 tracks that. C++ code should NOT use this; use
+// mozilla::dom::Exception instead.
+[scriptable, builtinclass, uuid(4371b5bf-6845-487f-8d9d-3f1e4a9badd2)]
+interface nsIException : nsISupports
+{
+};