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
Родитель 1065049ddb
Коммит 0d7595b59b
3 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -189,11 +189,11 @@ nsScriptNameSpaceManager* GetNameSpaceManager();
nsScriptNameSpaceManager* PeekNameSpaceManager(); nsScriptNameSpaceManager* PeekNameSpaceManager();
// Runnable that's used to do async error reporting // Runnable that's used to do async error reporting
class AsyncErrorReporter : public nsRunnable class AsyncErrorReporter final : public nsRunnable
{ {
public: public:
// aWindow may be null if this error report is not associated with a window // 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) : mReport(aReport)
{} {}

Просмотреть файл

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

Просмотреть файл

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