mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 933010 - AsyncErrorReporter takes bool isChromeError. r=bz
This commit is contained in:
parent
2ee0d6c6eb
commit
8349e7f288
@ -337,7 +337,7 @@ namespace dom {
|
||||
AsyncErrorReporter::AsyncErrorReporter(JSRuntime* aRuntime,
|
||||
JSErrorReport* aErrorReport,
|
||||
const char* aFallbackMessage,
|
||||
nsIPrincipal* aGlobalPrincipal,
|
||||
bool aIsChromeError,
|
||||
nsPIDOMWindow* aWindow)
|
||||
: mSourceLine(static_cast<const PRUnichar*>(aErrorReport->uclinebuf))
|
||||
, mLineNumber(aErrorReport->lineno)
|
||||
@ -365,9 +365,8 @@ AsyncErrorReporter::AsyncErrorReporter(JSRuntime* aRuntime,
|
||||
mErrorMsg.AssignWithConversion(aFallbackMessage);
|
||||
}
|
||||
|
||||
mCategory = nsContentUtils::IsSystemPrincipal(aGlobalPrincipal) ?
|
||||
NS_LITERAL_CSTRING("chrome javascript") :
|
||||
NS_LITERAL_CSTRING("content javascript");
|
||||
mCategory = aIsChromeError ? NS_LITERAL_CSTRING("chrome javascript") :
|
||||
NS_LITERAL_CSTRING("content javascript");
|
||||
|
||||
mInnerWindowID = 0;
|
||||
if (aWindow && aWindow->IsOuterWindow()) {
|
||||
@ -421,7 +420,8 @@ public:
|
||||
bool aDispatchEvent)
|
||||
// Pass an empty category, then compute ours
|
||||
: AsyncErrorReporter(aRuntime, aErrorReport, aFallbackMessage,
|
||||
aGlobalPrincipal, aWindow)
|
||||
nsContentUtils::IsSystemPrincipal(aGlobalPrincipal),
|
||||
aWindow)
|
||||
, mScriptGlobal(aScriptGlobal)
|
||||
, mOriginPrincipal(aScriptOriginPrincipal)
|
||||
, mDispatchEvent(aDispatchEvent)
|
||||
|
@ -208,7 +208,7 @@ public:
|
||||
AsyncErrorReporter(JSRuntime* aRuntime,
|
||||
JSErrorReport* aErrorReport,
|
||||
const char* aFallbackMessage,
|
||||
nsIPrincipal* aGlobalPrincipal, // To determine category
|
||||
bool aIsChromeError, // To determine category
|
||||
nsPIDOMWindow* aWindow);
|
||||
|
||||
NS_IMETHOD Run()
|
||||
|
@ -445,12 +445,13 @@ Promise::MaybeReportRejected()
|
||||
nsCOMPtr<nsPIDOMWindow> win =
|
||||
do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(&mResult.toObject()));
|
||||
|
||||
nsIPrincipal* principal = nsContentUtils::GetObjectPrincipal(&mResult.toObject());
|
||||
// Now post an event to do the real reporting async
|
||||
NS_DispatchToCurrentThread(
|
||||
new AsyncErrorReporter(JS_GetObjectRuntime(&mResult.toObject()),
|
||||
report,
|
||||
nullptr,
|
||||
nsContentUtils::GetObjectPrincipal(&mResult.toObject()),
|
||||
nsContentUtils::IsSystemPrincipal(principal),
|
||||
win));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user