mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1224007 part 4. Fix some cases in which ErrorResult instances are destroyed without doing anything useful with exceptions on them. r=peterv
This commit is contained in:
parent
bb0be9b0b7
commit
86acff3567
@ -6138,10 +6138,12 @@ nsGlobalWindow::FinishFullscreenChange(bool aIsFullscreen)
|
||||
mWakeLock = pmService->NewWakeLock(NS_LITERAL_STRING("DOM_Fullscreen"),
|
||||
this, rv);
|
||||
NS_WARN_IF_FALSE(!rv.Failed(), "Failed to lock the wakelock");
|
||||
rv.SuppressException();
|
||||
} else if (mWakeLock && !mFullScreen) {
|
||||
ErrorResult rv;
|
||||
mWakeLock->Unlock(rv);
|
||||
mWakeLock = nullptr;
|
||||
rv.SuppressException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -11764,6 +11766,7 @@ nsGlobalWindow::RunTimeoutHandler(nsTimeout* aTimeout,
|
||||
ErrorResult ignored;
|
||||
JS::Rooted<JS::Value> ignoredVal(CycleCollectedJSRuntime::Get()->Runtime());
|
||||
callback->Call(me, handler->GetArgs(), &ignoredVal, ignored, reason);
|
||||
ignored.SuppressException();
|
||||
}
|
||||
|
||||
// We ignore any failures from calling EvaluateString() on the context or
|
||||
|
@ -1131,7 +1131,10 @@ public:
|
||||
{
|
||||
MOZ_ASSERT(IsOuterWindow());
|
||||
mozilla::ErrorResult ignored;
|
||||
return GetContentInternal(ignored, /* aUnprivilegedCaller = */ false);
|
||||
nsCOMPtr<nsIDOMWindow> win =
|
||||
GetContentInternal(ignored, /* aUnprivilegedCaller = */ false);
|
||||
ignored.SuppressException();
|
||||
return win.forget();
|
||||
}
|
||||
|
||||
void Get_content(JSContext* aCx,
|
||||
|
@ -1276,8 +1276,6 @@ nsDOMCameraControl::OnHardwareStateChange(CameraControlListener::HardwareState a
|
||||
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ErrorResult ignored;
|
||||
|
||||
switch (aState) {
|
||||
case CameraControlListener::kHardwareOpen:
|
||||
DOM_CAMERA_LOGI("DOM OnHardwareStateChange: open\n");
|
||||
@ -1405,7 +1403,6 @@ nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState a
|
||||
DOM_CAMERA_LOGT("%s:%d : this=%p, state=%u\n", __func__, __LINE__, this, aState);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ErrorResult ignored;
|
||||
nsString state;
|
||||
|
||||
switch (aState) {
|
||||
|
@ -3967,6 +3967,7 @@ gfxFontGroup *CanvasRenderingContext2D::GetCurrentFontStyle()
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
bool fontUpdated = SetFontInternal(kDefaultFontStyle, err);
|
||||
if (err.Failed() || !fontUpdated) {
|
||||
err.SuppressException();
|
||||
gfxFontStyle style;
|
||||
style.size = kDefaultFontSize;
|
||||
gfxTextPerfMetrics* tp = nullptr;
|
||||
|
@ -2409,6 +2409,7 @@ HTMLMediaElement::WakeLockRelease()
|
||||
if (mWakeLock) {
|
||||
ErrorResult rv;
|
||||
mWakeLock->Unlock(rv);
|
||||
rv.SuppressException();
|
||||
mWakeLock = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -267,6 +267,7 @@ HTMLVideoElement::UpdateScreenWakeLock()
|
||||
if (mScreenWakeLock && (mPaused || hidden || !mUseScreenWakeLock)) {
|
||||
ErrorResult rv;
|
||||
mScreenWakeLock->Unlock(rv);
|
||||
rv.SuppressException();
|
||||
mScreenWakeLock = nullptr;
|
||||
return;
|
||||
}
|
||||
|
@ -1162,6 +1162,7 @@ MediaRecorder::NotifyOwnerDocumentActivityChanged()
|
||||
// Stop the session.
|
||||
ErrorResult result;
|
||||
Stop(result);
|
||||
result.SuppressException();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -496,6 +496,9 @@ private:
|
||||
ErrorResult rv;
|
||||
scriptloader::LoadMainScript(aCx, mScriptURL, WorkerScript, rv);
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
// I guess suppress the exception since that's what we used to
|
||||
// do, though this seems moderately weird.
|
||||
rv.SuppressException();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -532,6 +535,9 @@ private:
|
||||
JSAutoCompartment ac(aCx, global);
|
||||
scriptloader::LoadMainScript(aCx, mScriptURL, DebuggerScript, rv);
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
// I guess suppress the exception since that's what we used to
|
||||
// do, though this seems moderately weird.
|
||||
rv.SuppressException();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -356,6 +356,7 @@ nsXULTemplateQueryProcessorXML::AddBinding(nsIDOMNode* aRuleNode,
|
||||
nsAutoPtr<XPathExpression> compiledexpr;
|
||||
compiledexpr = CreateExpression(aExpr, ruleNode, rv);
|
||||
if (rv.Failed()) {
|
||||
rv.SuppressException();
|
||||
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_BAD_BINDING_XPATH);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -236,6 +236,7 @@ AccessibleCaret::RemoveCaretElement(nsIDocument* aDocument)
|
||||
ErrorResult rv;
|
||||
aDocument->RemoveAnonymousContent(*mCaretElementHolder, rv);
|
||||
// It's OK rv is failed since nsCanvasFrame might not exists now.
|
||||
rv.SuppressException();
|
||||
}
|
||||
|
||||
AccessibleCaret::PositionChangedResult
|
||||
|
Loading…
Reference in New Issue
Block a user