Title: [237101] trunk/Source/WebKit
Revision
237101
Author
[email protected]
Date
2018-10-15 07:28:13 -0700 (Mon, 15 Oct 2018)

Log Message

WebPageProxy should always have a HistoryClient
https://bugs.webkit.org/show_bug.cgi?id=190450

Reviewed by Chris Dumez.

This will make it so we don't forget to null check it.
No change in behavior because the default HistoryClient does nothing.

* UIProcess/API/APIHistoryClient.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::createHistoryClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setHistoryClient):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
* UIProcess/WebPageProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (237100 => 237101)


--- trunk/Source/WebKit/ChangeLog	2018-10-15 14:27:38 UTC (rev 237100)
+++ trunk/Source/WebKit/ChangeLog	2018-10-15 14:28:13 UTC (rev 237101)
@@ -1,5 +1,28 @@
 2018-10-15  Alex Christensen  <[email protected]>
 
+        WebPageProxy should always have a HistoryClient
+        https://bugs.webkit.org/show_bug.cgi?id=190450
+
+        Reviewed by Chris Dumez.
+
+        This will make it so we don't forget to null check it.
+        No change in behavior because the default HistoryClient does nothing.
+
+        * UIProcess/API/APIHistoryClient.h:
+        * UIProcess/Cocoa/NavigationState.h:
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::createHistoryClient):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::setHistoryClient):
+        (WebKit::WebPageProxy::didNavigateWithNavigationData):
+        (WebKit::WebPageProxy::didPerformClientRedirect):
+        (WebKit::WebPageProxy::didPerformServerRedirect):
+        (WebKit::WebPageProxy::didUpdateHistoryTitle):
+        * UIProcess/WebPageProxy.h:
+
+2018-10-15  Alex Christensen  <[email protected]>
+
         Use std::optional<size_t> for a WebBackForwardList's current index
         https://bugs.webkit.org/show_bug.cgi?id=190448
 

Modified: trunk/Source/WebKit/UIProcess/API/APIHistoryClient.h (237100 => 237101)


--- trunk/Source/WebKit/UIProcess/API/APIHistoryClient.h	2018-10-15 14:27:38 UTC (rev 237100)
+++ trunk/Source/WebKit/UIProcess/API/APIHistoryClient.h	2018-10-15 14:28:13 UTC (rev 237101)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef APIHistoryClient_h
-#define APIHistoryClient_h
+#pragma once
 
 #include <wtf/Forward.h>
 
@@ -46,5 +45,3 @@
 };
 
 } // namespace API
-
-#endif // APIHistoryClient_h

Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h (237100 => 237101)


--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-10-15 14:27:38 UTC (rev 237100)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-10-15 14:28:13 UTC (rev 237101)
@@ -63,7 +63,7 @@
     static NavigationState& fromWebPage(WebPageProxy&);
 
     UniqueRef<API::NavigationClient> createNavigationClient();
-    std::unique_ptr<API::HistoryClient> createHistoryClient();
+    UniqueRef<API::HistoryClient> createHistoryClient();
 
     RetainPtr<id <WKNavigationDelegate> > navigationDelegate();
     void setNavigationDelegate(id <WKNavigationDelegate>);

Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (237100 => 237101)


--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-10-15 14:27:38 UTC (rev 237100)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-10-15 14:28:13 UTC (rev 237101)
@@ -127,9 +127,9 @@
     return makeUniqueRef<NavigationClient>(*this);
 }
     
-std::unique_ptr<API::HistoryClient> NavigationState::createHistoryClient()
+UniqueRef<API::HistoryClient> NavigationState::createHistoryClient()
 {
-    return std::make_unique<HistoryClient>(*this);
+    return makeUniqueRef<HistoryClient>(*this);
 }
 
 RetainPtr<id <WKNavigationDelegate> > NavigationState::navigationDelegate()

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (237100 => 237101)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-10-15 14:27:38 UTC (rev 237100)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-10-15 14:28:13 UTC (rev 237101)
@@ -383,6 +383,7 @@
     : m_pageClient(makeWeakPtr(pageClient))
     , m_configuration(WTFMove(configuration))
     , m_navigationClient(makeUniqueRef<API::NavigationClient>())
+    , m_historyClient(makeUniqueRef<API::HistoryClient>())
     , m_iconLoadingClient(std::make_unique<API::IconLoadingClient>())
     , m_formClient(std::make_unique<API::FormClient>())
     , m_uiClient(std::make_unique<API::UIClient>())
@@ -563,7 +564,7 @@
     preferencesDidChange();
 }
     
-void WebPageProxy::setHistoryClient(std::unique_ptr<API::HistoryClient>&& historyClient)
+void WebPageProxy::setHistoryClient(UniqueRef<API::HistoryClient>&& historyClient)
 {
     m_historyClient = WTFMove(historyClient);
 }
@@ -4270,7 +4271,7 @@
     MESSAGE_CHECK(frame);
     MESSAGE_CHECK(frame->page() == this);
 
-    if (m_historyClient && frame->isMainFrame())
+    if (frame->isMainFrame())
         m_historyClient->didNavigateWithNavigationData(*this, store);
     process().processPool().historyClient().didNavigateWithNavigationData(process().processPool(), *this, store, *frame);
 }
@@ -4289,7 +4290,7 @@
     MESSAGE_CHECK_URL(sourceURLString);
     MESSAGE_CHECK_URL(destinationURLString);
 
-    if (m_historyClient && frame->isMainFrame())
+    if (frame->isMainFrame())
         m_historyClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString);
     process().processPool().historyClient().didPerformClientRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
 }
@@ -4308,7 +4309,7 @@
     MESSAGE_CHECK_URL(sourceURLString);
     MESSAGE_CHECK_URL(destinationURLString);
 
-    if (m_historyClient && frame->isMainFrame())
+    if (frame->isMainFrame())
         m_historyClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString);
     process().processPool().historyClient().didPerformServerRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
 }
@@ -4323,7 +4324,7 @@
 
     MESSAGE_CHECK_URL(url);
 
-    if (m_historyClient && frame->isMainFrame())
+    if (frame->isMainFrame())
         m_historyClient->didUpdateHistoryTitle(*this, title, url);
     process().processPool().historyClient().didUpdateHistoryTitle(process().processPool(), *this, title, url, *frame);
 }

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (237100 => 237101)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-10-15 14:27:38 UTC (rev 237100)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-10-15 14:28:13 UTC (rev 237101)
@@ -428,7 +428,7 @@
     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
     void setFormClient(std::unique_ptr<API::FormClient>&&);
     void setNavigationClient(UniqueRef<API::NavigationClient>&&);
-    void setHistoryClient(std::unique_ptr<API::HistoryClient>&&);
+    void setHistoryClient(UniqueRef<API::HistoryClient>&&);
     void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
     void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
@@ -1861,7 +1861,7 @@
     std::unique_ptr<API::LoaderClient> m_loaderClient;
     std::unique_ptr<API::PolicyClient> m_policyClient;
     UniqueRef<API::NavigationClient> m_navigationClient;
-    std::unique_ptr<API::HistoryClient> m_historyClient;
+    UniqueRef<API::HistoryClient> m_historyClient;
     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
     std::unique_ptr<API::FormClient> m_formClient;
     std::unique_ptr<API::UIClient> m_uiClient;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to