Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2018 18:26:47 +0000 (18:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2018 18:26:47 +0000 (18:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192691
<rdar://problem/46719798>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-14
Reviewed by Darin Adler.

* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::url const):
Instead of an empty string, return "about:blank" in bail cases.
When inspecting the page that matches the contents.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageDebuggable.cpp

index 8b0a59d..301aeb4 100644 (file)
@@ -1,3 +1,16 @@
+2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
+        https://bugs.webkit.org/show_bug.cgi?id=192691
+        <rdar://problem/46719798>
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/WebPageDebuggable.cpp:
+        (WebKit::WebPageDebuggable::url const):
+        Instead of an empty string, return "about:blank" in bail cases.
+        When inspecting the page that matches the contents.
+
 2018-12-14  Chris Dumez  <cdumez@apple.com>
 
         [PSON] Stop exposing PolicyAction::Suspend to WebCore
index 166417b..351f923 100644 (file)
@@ -55,10 +55,13 @@ String WebPageDebuggable::name() const
 String WebPageDebuggable::url() const
 {
     if (!m_page.mainFrame())
-        return String();
+        return "about:blank"_s;
 
     String url = m_page.mainFrame()->url().string();
-    return url.isEmpty() ? "about:blank"_s : url;
+    if (url.isEmpty())
+        return "about:blank"_s;
+
+    return url;
 }
 
 bool WebPageDebuggable::hasLocalDebugger() const