diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 3b31c776aef2..d5dc0fb56fbc 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -1057,7 +1057,7 @@ StackFrameToStackEntry(JSContext* aCx, nsIStackFrame* aStackFrame, NS_ENSURE_SUCCESS(rv, rv); nsString cause; - rv = aStackFrame->GetAsyncCause(aCx, cause); + rv = aStackFrame->GetAsyncCause(cause); NS_ENSURE_SUCCESS(rv, rv); if (!cause.IsEmpty()) { aStackEntry.mAsyncCause.Construct(cause); @@ -1084,7 +1084,7 @@ ReifyStack(JSContext* aCx, nsIStackFrame* aStack, NS_ENSURE_SUCCESS(rv, rv); if (!caller) { - rv = stack->GetAsyncCaller(aCx, getter_AddRefs(caller)); + rv = stack->GetAsyncCaller(getter_AddRefs(caller)); NS_ENSURE_SUCCESS(rv, rv); } stack.swap(caller); diff --git a/dom/bindings/Exceptions.cpp b/dom/bindings/Exceptions.cpp index 2eb959a220bd..99a0e4d14dcd 100644 --- a/dom/bindings/Exceptions.cpp +++ b/dom/bindings/Exceptions.cpp @@ -474,17 +474,17 @@ NS_IMETHODIMP JSStackFrame::GetSourceLine(nsACString& aSourceLine) return NS_OK; } -NS_IMETHODIMP JSStackFrame::GetAsyncCause(JSContext* aCx, - nsAString& aAsyncCause) +NS_IMETHODIMP JSStackFrame::GetAsyncCause(nsAString& aAsyncCause) { if (!mStack) { aAsyncCause.Truncate(); return NS_OK; } - JS::Rooted asyncCause(aCx); + ThreadsafeAutoJSContext cx; + JS::Rooted asyncCause(cx); bool canCache = false, useCachedValue = false; - GetValueIfNotCached(aCx, mStack, JS::GetSavedFrameAsyncCause, + GetValueIfNotCached(cx, mStack, JS::GetSavedFrameAsyncCause, mAsyncCauseInitialized, &canCache, &useCachedValue, &asyncCause); @@ -495,8 +495,8 @@ NS_IMETHODIMP JSStackFrame::GetAsyncCause(JSContext* aCx, if (asyncCause) { nsAutoJSString str; - if (!str.init(aCx, asyncCause)) { - JS_ClearPendingException(aCx); + if (!str.init(cx, asyncCause)) { + JS_ClearPendingException(cx); aAsyncCause.Truncate(); return NS_OK; } @@ -513,17 +513,17 @@ NS_IMETHODIMP JSStackFrame::GetAsyncCause(JSContext* aCx, return NS_OK; } -NS_IMETHODIMP JSStackFrame::GetAsyncCaller(JSContext* aCx, - nsIStackFrame** aAsyncCaller) +NS_IMETHODIMP JSStackFrame::GetAsyncCaller(nsIStackFrame** aAsyncCaller) { if (!mStack) { *aAsyncCaller = nullptr; return NS_OK; } - JS::Rooted asyncCallerObj(aCx); + ThreadsafeAutoJSContext cx; + JS::Rooted asyncCallerObj(cx); bool canCache = false, useCachedValue = false; - GetValueIfNotCached(aCx, mStack, JS::GetSavedFrameAsyncParent, + GetValueIfNotCached(cx, mStack, JS::GetSavedFrameAsyncParent, mAsyncCallerInitialized, &canCache, &useCachedValue, &asyncCallerObj); diff --git a/xpcom/base/nsIException.idl b/xpcom/base/nsIException.idl index 83be00a7b097..aea09ca3aa9c 100644 --- a/xpcom/base/nsIException.idl +++ b/xpcom/base/nsIException.idl @@ -26,9 +26,7 @@ interface nsIStackFrame : nsISupports [implicit_jscontext] readonly attribute int32_t columnNumber; readonly attribute AUTF8String sourceLine; - [implicit_jscontext] readonly attribute AString asyncCause; - [implicit_jscontext] readonly attribute nsIStackFrame asyncCaller; readonly attribute nsIStackFrame caller;