Fix logic flow for error log
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 01:55:50 +0000 (01:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 01:55:50 +0000 (01:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196933

Patch by Eike Rathke <erack@redhat.com> on 2019-04-15
Reviewed by Alexey Proskuryakov.

Missing block braces logged an error always, not just
if (actionIfInvalid == Complain).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isSafeToLoadURL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244320 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp

index 3f6c948..aab0913 100644 (file)
@@ -1,3 +1,16 @@
+2019-04-15  Eike Rathke  <erack@redhat.com>
+
+        Fix logic flow for error log
+        https://bugs.webkit.org/show_bug.cgi?id=196933
+
+        Reviewed by Alexey Proskuryakov.
+
+        Missing block braces logged an error always, not just
+        if (actionIfInvalid == Complain).
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::isSafeToLoadURL):
+
 2019-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
index 2e8bdab..8f141c1 100644 (file)
@@ -2098,9 +2098,10 @@ bool HTMLMediaElement::isSafeToLoadURL(const URL& url, InvalidURLAction actionIf
 
     RefPtr<Frame> frame = document().frame();
     if (!frame || !document().securityOrigin().canDisplay(url)) {
-        if (actionIfInvalid == Complain)
+        if (actionIfInvalid == Complain) {
             FrameLoader::reportLocalLoadFailed(frame.get(), url.stringCenterEllipsizedToLength());
             ERROR_LOG(LOGIDENTIFIER, url , " was rejected by SecurityOrigin");
+        }
         return false;
     }