Backed out changeset cf816f733296 (bug 1257919)

This commit is contained in:
Sebastian Hengst 2016-03-22 21:09:53 +01:00
parent 8b2bf79a7a
commit d5e963398d
3 changed files with 12 additions and 14 deletions

View File

@ -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);

View File

@ -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<JSString*> asyncCause(aCx);
ThreadsafeAutoJSContext cx;
JS::Rooted<JSString*> 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<JSObject*> asyncCallerObj(aCx);
ThreadsafeAutoJSContext cx;
JS::Rooted<JSObject*> asyncCallerObj(cx);
bool canCache = false, useCachedValue = false;
GetValueIfNotCached(aCx, mStack, JS::GetSavedFrameAsyncParent,
GetValueIfNotCached(cx, mStack, JS::GetSavedFrameAsyncParent,
mAsyncCallerInitialized, &canCache, &useCachedValue,
&asyncCallerObj);

View File

@ -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;