Bug 1583052 - Don't null-check OwnerDoc() in HTMLMediaElement.cpp. r=smaug
It can never return null. Differential Revision: https://phabricator.services.mozilla.com/D46774
This commit is contained in:
@@ -856,10 +856,7 @@ HTMLMediaElement::MediaLoadListener::OnStartRequest(nsIRequest* aRequest) {
|
||||
// array of blocked tracking nodes under its parent document.
|
||||
if (net::UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(
|
||||
status)) {
|
||||
Document* ownerDoc = element->OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->AddBlockedNodeByClassifier(element);
|
||||
}
|
||||
element->OwnerDoc()->AddBlockedNodeByClassifier(element);
|
||||
}
|
||||
element->NotifyLoadError(
|
||||
nsPrintfCString("%u: %s", uint32_t(status), "Request failed"));
|
||||
@@ -5891,7 +5888,7 @@ void HTMLMediaElement::CheckAutoplayDataReady() {
|
||||
|
||||
bool HTMLMediaElement::IsActive() const {
|
||||
Document* ownerDoc = OwnerDoc();
|
||||
return ownerDoc && ownerDoc->IsActive() && ownerDoc->IsVisible();
|
||||
return ownerDoc->IsActive() && ownerDoc->IsVisible();
|
||||
}
|
||||
|
||||
bool HTMLMediaElement::IsHidden() const {
|
||||
@@ -6211,8 +6208,7 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement,
|
||||
}
|
||||
|
||||
bool HTMLMediaElement::IsBeingDestroyed() {
|
||||
Document* ownerDoc = OwnerDoc();
|
||||
nsIDocShell* docShell = ownerDoc ? ownerDoc->GetDocShell() : nullptr;
|
||||
nsIDocShell* docShell = OwnerDoc()->GetDocShell();
|
||||
bool isBeingDestroyed = false;
|
||||
if (docShell) {
|
||||
docShell->IsBeingDestroyed(&isBeingDestroyed);
|
||||
|
||||
Reference in New Issue
Block a user