Bug 1214300 - AsyncErrorReporter doesn't use JSRuntime param., r=smaug

This commit is contained in:
Andrea Marchesini 2015-10-14 11:29:55 +01:00
parent d880584251
commit 457a61c7ea
3 changed files with 4 additions and 6 deletions

View File

@ -189,11 +189,11 @@ nsScriptNameSpaceManager* GetNameSpaceManager();
nsScriptNameSpaceManager* PeekNameSpaceManager();
// Runnable that's used to do async error reporting
class AsyncErrorReporter : public nsRunnable
class AsyncErrorReporter final : public nsRunnable
{
public:
// aWindow may be null if this error report is not associated with a window
AsyncErrorReporter(JSRuntime* aRuntime, xpc::ErrorReport* aReport)
explicit AsyncErrorReporter(xpc::ErrorReport* aReport)
: mReport(aReport)
{}

View File

@ -1231,8 +1231,7 @@ Promise::MaybeReportRejected()
NS_WARNING("!!! Trying to report rejected Promise after MainThread shutdown");
}
if (mainThread) {
nsRefPtr<AsyncErrorReporter> r =
new AsyncErrorReporter(CycleCollectedJSRuntime::Get()->Runtime(), xpcReport);
nsRefPtr<AsyncErrorReporter> r = new AsyncErrorReporter(xpcReport);
mainThread->Dispatch(r.forget(), NS_DISPATCH_NORMAL);
}
}

View File

@ -338,8 +338,7 @@ public:
xpcReport->Init(report.report(), report.message(),
/* aIsChrome = */ false, /* aWindowID = */ 0);
nsRefPtr<AsyncErrorReporter> aer =
new AsyncErrorReporter(CycleCollectedJSRuntime::Get()->Runtime(), xpcReport);
nsRefPtr<AsyncErrorReporter> aer = new AsyncErrorReporter(xpcReport);
NS_DispatchToMainThread(aer);
}
};