Remove an unneeded synchronous back/forward message
https://bugs.webkit.org/show_bug.cgi?id=127516
Reviewed by Tim Horton.
* UIProcess/WebLoaderClient.cpp:
* UIProcess/WebLoaderClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeLoaderClient):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldGoToHistoryItem):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 6712fdc..ad4aaf2 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,5 +1,25 @@
2014-01-23 Anders Carlsson <andersca@apple.com>
+ Remove an unneeded synchronous back/forward message
+ https://bugs.webkit.org/show_bug.cgi?id=127516
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/WebLoaderClient.cpp:
+ * UIProcess/WebLoaderClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::initializeLoaderClient):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
+2014-01-23 Anders Carlsson <andersca@apple.com>
+
Rename WKPreferences.h to WKPreferencesRef.h and add a stubbed out WKPreferences class
https://bugs.webkit.org/show_bug.cgi?id=127512
diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.cpp b/Source/WebKit2/UIProcess/WebLoaderClient.cpp
index 42bb49c..c138a27 100644
--- a/Source/WebKit2/UIProcess/WebLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/WebLoaderClient.cpp
@@ -250,17 +250,6 @@
m_client.didChangeBackForwardList(toAPI(page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.base.clientInfo);
}
-bool WebLoaderClient::shouldGoToBackForwardListItem(WebPageProxy* page, WebBackForwardListItem* item)
-{
- // We should only even considering sending the shouldGoToBackForwardListItem() client callback
- // for version 0 clients. Later versioned clients should get willGoToBackForwardListItem() instead,
- // but due to XPC race conditions this one might have been called instead.
- if (m_client.base.version > 0 || !m_client.shouldGoToBackForwardListItem)
- return true;
-
- return m_client.shouldGoToBackForwardListItem(toAPI(page), toAPI(item), m_client.base.clientInfo);
-}
-
void WebLoaderClient::willGoToBackForwardListItem(WebPageProxy* page, WebBackForwardListItem* item, API::Object* userData)
{
if (m_client.willGoToBackForwardListItem)
diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.h b/Source/WebKit2/UIProcess/WebLoaderClient.h
index d753c8e..61518e8 100644
--- a/Source/WebKit2/UIProcess/WebLoaderClient.h
+++ b/Source/WebKit2/UIProcess/WebLoaderClient.h
@@ -95,7 +95,6 @@
void processDidCrash(WebPageProxy*);
void didChangeBackForwardList(WebPageProxy*, WebBackForwardListItem* addedItem, Vector<RefPtr<API::Object>>* removedItems);
- bool shouldGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*);
void willGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*, API::Object*);
#if ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index a9998b2..da5b733 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -416,8 +416,6 @@
if (milestones)
m_process->send(Messages::WebPage::ListenForLayoutMilestones(milestones), m_pageID);
-
- m_process->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
}
void WebPageProxy::setPolicyClient(std::unique_ptr<API::PolicyClient> policyClient)
@@ -835,12 +833,6 @@
m_loaderClient.didChangeBackForwardList(this, added, removed);
}
-void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
-{
- WebBackForwardListItem* item = m_process->webBackForwardItem(itemID);
- shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
-}
-
void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, IPC::MessageDecoder& decoder)
{
RefPtr<API::Object> userData;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index 736835a..ae8de74 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -400,7 +400,6 @@
void goToBackForwardItem(WebBackForwardListItem*);
void tryRestoreScrollPosition();
void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<API::Object>>* removedItems);
- void shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardListItem);
void willGoToBackForwardListItem(uint64_t itemID, IPC::MessageDecoder&);
bool willHandleHorizontalScrollEvents() const;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
index 1fb75bb..2e24f71 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -182,7 +182,6 @@
BackForwardBackListCount() -> (int32_t count)
BackForwardForwardListCount() -> (int32_t count)
BackForwardClear()
- ShouldGoToBackForwardListItem(uint64_t itemID) -> (bool shouldGoToBackForwardListItem)
WillGoToBackForwardListItem(uint64_t itemID, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
# Undo/Redo messages
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 9a23b7a..e75594f 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -942,15 +942,8 @@
if (!shouldGoToBackForwardListItem)
return false;
- if (webPage->willGoToBackForwardItemCallbackEnabled()) {
- webPage->send(Messages::WebPageProxy::WillGoToBackForwardListItem(itemID, InjectedBundleUserMessageEncoder(userData.get())));
- return true;
- }
-
- if (!webPage->sendSync(Messages::WebPageProxy::ShouldGoToBackForwardListItem(itemID), Messages::WebPageProxy::ShouldGoToBackForwardListItem::Reply(shouldGoToBackForwardListItem)))
- return false;
-
- return shouldGoToBackForwardListItem;
+ webPage->send(Messages::WebPageProxy::WillGoToBackForwardListItem(itemID, InjectedBundleUserMessageEncoder(userData.get())));
+ return true;
}
bool WebFrameLoaderClient::shouldStopLoadingForHistoryItem(HistoryItem*) const
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 58a1607..0a3a46a 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -275,7 +275,6 @@
#if ENABLE(CONTEXT_MENUS)
, m_isShowingContextMenu(false)
#endif
- , m_willGoToBackForwardItemCallbackEnabled(true)
#if PLATFORM(IOS)
, m_shouldReturnWordAtSelection(false)
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index 8735a2d..395e009 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -622,8 +622,6 @@
void numWheelEventHandlersChanged(unsigned);
void recomputeShortCircuitHorizontalWheelEventsState();
- bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
-
void setVisibilityStatePrerender();
void updateVisibilityState(bool isInitialState = false);
@@ -769,8 +767,6 @@
void didRemoveBackForwardItem(uint64_t);
- void setWillGoToBackForwardItemCallbackEnabled(bool enabled) { m_willGoToBackForwardItemCallbackEnabled = enabled; }
-
void setDrawsBackground(bool);
void setDrawsTransparentBackground(bool);
@@ -1039,8 +1035,6 @@
bool m_isShowingContextMenu;
#endif
- bool m_willGoToBackForwardItemCallbackEnabled;
-
#if PLATFORM(IOS)
RefPtr<WebCore::Node> m_assistedNode;
RefPtr<WebCore::Range> m_currentWordRange;
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
index 400fb4f..7be8fdc 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -99,7 +99,6 @@
RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state)
DidRemoveBackForwardItem(uint64_t backForwardItemID)
- SetWillGoToBackForwardItemCallbackEnabled(bool willGoToBackForwardItemEnabled)
DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)