Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / xpcom / base / nsIException.idl
blob7f529e1c087dfa1273ca0a2b513f7fe12be8c356
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * Interfaces for representing cross-language exceptions and stack traces.
8 */
9 #include "nsISupports.idl"
11 [ptr] native JSContext(JSContext);
12 native StackFrameRef(already_AddRefed<nsIStackFrame>);
14 [scriptable, builtinclass, uuid(28bfb2a2-5ea6-4738-918b-049dc4d51f0b)]
15 interface nsIStackFrame : nsISupports
17 [implicit_jscontext, binaryname(FilenameXPCOM)]
18 readonly attribute AString filename;
19 [implicit_jscontext, binaryname(NameXPCOM)]
20 readonly attribute AString name;
21 // Unique identifier of the script source for the frame, or zero.
22 [implicit_jscontext, binaryname(SourceIdXPCOM)]
23 readonly attribute int32_t sourceId;
24 // Valid line numbers begin at '1'. '0' indicates unknown.
25 [implicit_jscontext, binaryname(LineNumberXPCOM)]
26 readonly attribute int32_t lineNumber;
27 [implicit_jscontext, binaryname(ColumnNumberXPCOM)]
28 readonly attribute int32_t columnNumber;
29 readonly attribute AUTF8String sourceLine;
30 [implicit_jscontext, binaryname(AsyncCauseXPCOM)]
31 readonly attribute AString asyncCause;
32 [implicit_jscontext, binaryname(AsyncCallerXPCOM)]
33 readonly attribute nsIStackFrame asyncCaller;
34 [implicit_jscontext, binaryname(CallerXPCOM)]
35 readonly attribute nsIStackFrame caller;
37 // Returns a formatted stack string that looks like the sort of
38 // string that would be returned by .stack on JS Error objects.
39 // Only works on JS-language stack frames.
40 [implicit_jscontext, binaryname(FormattedStackXPCOM)]
41 readonly attribute AString formattedStack;
43 // Returns the underlying SavedFrame object for native JavaScript stacks,
44 // or null if this is not a native JavaScript stack frame.
45 readonly attribute jsval nativeSavedFrame;
47 [implicit_jscontext, binaryname(ToStringXPCOM)]
48 AUTF8String toString();
50 // Infallible things to be called from C++.
51 [notxpcom, nostdcall]
52 void getFilename(in JSContext aCx, out AString aFilename);
53 [notxpcom, nostdcall]
54 void getName(in JSContext aCx, out AString aName);
55 [notxpcom, nostdcall]
56 int32_t getSourceId(in JSContext aCx);
57 [notxpcom, nostdcall]
58 int32_t getLineNumber(in JSContext aCx);
59 [notxpcom, nostdcall]
60 int32_t getColumnNumber(in JSContext aCx);
61 [notxpcom, nostdcall]
62 void getAsyncCause(in JSContext aCx, out AString aAsyncCause);
63 [notxpcom, nostdcall]
64 StackFrameRef getAsyncCaller(in JSContext aCx);
65 [notxpcom, nostdcall]
66 StackFrameRef getCaller(in JSContext aCx);
67 [notxpcom, nostdcall]
68 void getFormattedStack(in JSContext aCx, out AString aFormattedStack);
69 [notxpcom, nostdcall, binaryname(ToString)]
70 void toStringInfallible(in JSContext aCx, out AUTF8String aString);
73 // This interface only exists because of all the JS consumers doing
74 // "instanceof Ci.nsIException". We should switch them to something else and
75 // get rid of it; bug 1435856 tracks that. C++ code should NOT use this; use
76 // mozilla::dom::Exception instead.
77 [scriptable, builtinclass, uuid(4371b5bf-6845-487f-8d9d-3f1e4a9badd2)]
78 interface nsIException : nsISupports