Title: [159638] trunk/Source/WebKit2
Revision
159638
Author
[email protected]
Date
2013-11-21 11:43:57 -0800 (Thu, 21 Nov 2013)

Log Message

Move activeURL getter to PageLoadState
https://bugs.webkit.org/show_bug.cgi?id=124690

Reviewed by Tim Horton.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::activeURL):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::activeURL):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (159637 => 159638)


--- trunk/Source/WebKit2/ChangeLog	2013-11-21 19:05:43 UTC (rev 159637)
+++ trunk/Source/WebKit2/ChangeLog	2013-11-21 19:43:57 UTC (rev 159638)
@@ -1,3 +1,16 @@
+2013-11-20  Anders Carlsson  <[email protected]>
+
+        Move activeURL getter to PageLoadState
+        https://bugs.webkit.org/show_bug.cgi?id=124690
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/PageLoadState.cpp:
+        (WebKit::PageLoadState::activeURL):
+        * UIProcess/PageLoadState.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::activeURL):
+
 2013-11-20  Simon Fraser  <[email protected]>
 
         Clean up WebKit2 initialization

Modified: trunk/Source/WebKit2/UIProcess/PageLoadState.cpp (159637 => 159638)


--- trunk/Source/WebKit2/UIProcess/PageLoadState.cpp	2013-11-21 19:05:43 UTC (rev 159637)
+++ trunk/Source/WebKit2/UIProcess/PageLoadState.cpp	2013-11-21 19:43:57 UTC (rev 159638)
@@ -48,6 +48,30 @@
     m_lastUnreachableURL = String();
 }
 
+String PageLoadState::activeURL() const
+{
+    // If there is a currently pending URL, it is the active URL,
+    // even when there's no main frame yet, as it might be the
+    // first API request.
+    if (!m_pendingAPIRequestURL.isNull())
+        return m_pendingAPIRequestURL;
+
+    if (!m_unreachableURL.isEmpty())
+        return m_unreachableURL;
+
+    switch (m_state) {
+    case State::Provisional:
+        return m_provisionalURL;
+    case State::Committed:
+    case State::Finished:
+        return m_url;
+    }
+
+    ASSERT_NOT_REACHED();
+    return String();
+
+}
+
 const String& PageLoadState::pendingAPIRequestURL() const
 {
     return m_pendingAPIRequestURL;

Modified: trunk/Source/WebKit2/UIProcess/PageLoadState.h (159637 => 159638)


--- trunk/Source/WebKit2/UIProcess/PageLoadState.h	2013-11-21 19:05:43 UTC (rev 159637)
+++ trunk/Source/WebKit2/UIProcess/PageLoadState.h	2013-11-21 19:43:57 UTC (rev 159638)
@@ -43,6 +43,8 @@
 
     void reset();
 
+    String activeURL() const;
+
     const String& pendingAPIRequestURL() const;
     void setPendingAPIRequestURL(const String&);
     void clearPendingAPIRequestURL();

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (159637 => 159638)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-11-21 19:05:43 UTC (rev 159637)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-11-21 19:43:57 UTC (rev 159638)
@@ -838,28 +838,7 @@
 
 String WebPageProxy::activeURL() const
 {
-    // If there is a currently pending url, it is the active URL,
-    // even when there's no main frame yet, as it might be the
-    // first API request.
-    if (!m_pageLoadState.pendingAPIRequestURL().isNull())
-        return m_pageLoadState.pendingAPIRequestURL();
-
-    if (!m_mainFrame)
-        return String();
-
-    if (!m_mainFrame->unreachableURL().isEmpty())
-        return m_mainFrame->unreachableURL();
-
-    switch (m_mainFrame->frameLoadState().m_state) {
-    case FrameLoadState::State::Provisional:
-        return m_mainFrame->provisionalURL();
-    case FrameLoadState::State::Committed:
-    case FrameLoadState::State::Finished:
-        return m_mainFrame->url();
-    }
-
-    ASSERT_NOT_REACHED();
-    return String();
+    return m_pageLoadState.activeURL();
 }
 
 String WebPageProxy::provisionalURL() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to