зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1474045
. Make nsIScriptGlobalObject::HandleScriptError non-virtual. r=qdot
This commit is contained in:
Родитель
4a390e2fc4
Коммит
9f65fcc29a
|
@ -71,11 +71,9 @@ public:
|
|||
/**
|
||||
* Handle a script error. Generally called by a script context.
|
||||
*/
|
||||
virtual nsresult HandleScriptError(
|
||||
const mozilla::dom::ErrorEventInit &aErrorEventInit,
|
||||
nsEventStatus *aEventStatus) {
|
||||
NS_ENSURE_STATE(NS_HandleScriptError(this, aErrorEventInit, aEventStatus));
|
||||
return NS_OK;
|
||||
bool HandleScriptError(const mozilla::dom::ErrorEventInit &aErrorEventInit,
|
||||
nsEventStatus *aEventStatus) {
|
||||
return NS_HandleScriptError(this, aErrorEventInit, aEventStatus);
|
||||
}
|
||||
|
||||
virtual bool IsBlackForCC(bool aTracingNeeded = true) { return false; }
|
||||
|
|
|
@ -562,7 +562,7 @@ IndexedDatabaseManager::CommonPostHandleEvent(EventChainPostVisitor& aVisitor,
|
|||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(window);
|
||||
MOZ_ASSERT(sgo);
|
||||
|
||||
if (NS_WARN_IF(NS_FAILED(sgo->HandleScriptError(init, &status)))) {
|
||||
if (NS_WARN_IF(!sgo->HandleScriptError(init, &status))) {
|
||||
status = nsEventStatus_eIgnore;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
else if (nsGlobalWindowInner* win = xpc::WindowOrNull(global)) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (NS_FAILED(win->HandleScriptError(init, &status))) {
|
||||
if (!win->HandleScriptError(init, &status)) {
|
||||
NS_WARNING("Failed to dispatch main thread error event!");
|
||||
status = nsEventStatus_eIgnore;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ WorkerErrorReport::ReportError(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
|||
else if (nsGlobalWindowInner* win = xpc::WindowOrNull(global)) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (NS_FAILED(win->HandleScriptError(init, &status))) {
|
||||
if (!win->HandleScriptError(init, &status)) {
|
||||
NS_WARNING("Failed to dispatch main thread error event!");
|
||||
status = nsEventStatus_eIgnore;
|
||||
}
|
||||
|
|
|
@ -2295,7 +2295,6 @@ WorkerPrivate::BroadcastErrorToSharedWorkers(
|
|||
}
|
||||
|
||||
AutoTArray<WindowAction, 10> windowActions;
|
||||
nsresult rv;
|
||||
|
||||
// First fire the error event at all SharedWorker objects. This may include
|
||||
// multiple objects in a single window as well as objects in different
|
||||
|
@ -2389,9 +2388,8 @@ WorkerPrivate::BroadcastErrorToSharedWorkers(
|
|||
init.mBubbles = true;
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
rv = sgo->HandleScriptError(init, &status);
|
||||
if (NS_FAILED(rv)) {
|
||||
ThrowAndReport(windowAction.mWindow, rv);
|
||||
if (!sgo->HandleScriptError(init, &status)) {
|
||||
ThrowAndReport(windowAction.mWindow, NS_ERROR_UNEXPECTED);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче