Diff
Modified: trunk/Source/WebKit2/ChangeLog (124621 => 124622)
--- trunk/Source/WebKit2/ChangeLog 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/ChangeLog 2012-08-03 16:41:21 UTC (rev 124622)
@@ -1,3 +1,31 @@
+2012-08-02 Alexey Proskuryakov <[email protected]>
+
+ [WK2] Move some WebContext messages to WebProcessProxy
+ https://bugs.webkit.org/show_bug.cgi?id=93046
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/WebContext.cpp: (WebKit::WebContext::didReceiveSyncMessage): Unrelated
+ fix - use actual process argument instead of second-guessing where the message came
+ from.
+
+ * UIProcess/WebContext.h: (WebKit::WebContext::historyClient): Expose history client,
+ since WebProcessProxy now needs it.
+
+ * UIProcess/WebContext.messages.in:
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::didNavigateWithNavigationData):
+ (WebKit::WebProcessProxy::didPerformClientRedirect):
+ (WebKit::WebProcessProxy::didPerformServerRedirect):
+ (WebKit::WebProcessProxy::didUpdateHistoryTitle):
+ * UIProcess/WebProcessProxy.h:
+ * UIProcess/WebProcessProxy.messages.in:
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::updateGlobalHistory):
+ (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
+ (WebKit::WebFrameLoaderClient::setTitle):
+ Move the messages.
+
2012-08-03 Balazs Kelemen <[email protected]>
Unreviewed, rolling out r124603.
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (124621 => 124622)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-08-03 16:41:21 UTC (rev 124622)
@@ -86,7 +86,6 @@
#include <wtf/RefCountedLeakCounter.h>
#endif
-#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connection())
#define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
using namespace WebCore;
@@ -521,71 +520,6 @@
m_injectedBundleClient.didReceiveSynchronousMessageFromInjectedBundle(this, messageName, messageBody, returnData);
}
-// HistoryClient
-
-void WebContext::didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID)
-{
- WebPageProxy* page = m_process->webPage(pageID);
- if (!page)
- return;
-
- WebFrameProxy* frame = m_process->webFrame(frameID);
- MESSAGE_CHECK(frame);
- MESSAGE_CHECK(frame->page() == page);
-
- m_historyClient.didNavigateWithNavigationData(this, page, store, frame);
-}
-
-void WebContext::didPerformClientRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID)
-{
- WebPageProxy* page = m_process->webPage(pageID);
- if (!page)
- return;
-
- if (sourceURLString.isEmpty() || destinationURLString.isEmpty())
- return;
-
- WebFrameProxy* frame = m_process->webFrame(frameID);
- MESSAGE_CHECK(frame);
- MESSAGE_CHECK(frame->page() == page);
- MESSAGE_CHECK_URL(sourceURLString);
- MESSAGE_CHECK_URL(destinationURLString);
-
- m_historyClient.didPerformClientRedirect(this, page, sourceURLString, destinationURLString, frame);
-}
-
-void WebContext::didPerformServerRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID)
-{
- WebPageProxy* page = m_process->webPage(pageID);
- if (!page)
- return;
-
- if (sourceURLString.isEmpty() || destinationURLString.isEmpty())
- return;
-
- WebFrameProxy* frame = m_process->webFrame(frameID);
- MESSAGE_CHECK(frame);
- MESSAGE_CHECK(frame->page() == page);
- MESSAGE_CHECK_URL(sourceURLString);
- MESSAGE_CHECK_URL(destinationURLString);
-
- m_historyClient.didPerformServerRedirect(this, page, sourceURLString, destinationURLString, frame);
-}
-
-void WebContext::didUpdateHistoryTitle(uint64_t pageID, const String& title, const String& url, uint64_t frameID)
-{
- WebPageProxy* page = m_process->webPage(pageID);
- if (!page)
- return;
-
- WebFrameProxy* frame = m_process->webFrame(frameID);
- MESSAGE_CHECK(frame);
- MESSAGE_CHECK(frame->page() == page);
- MESSAGE_CHECK_URL(url);
-
- m_historyClient.didUpdateHistoryTitle(this, page, title, url, frame);
-}
-
void WebContext::populateVisitedLinks()
{
m_historyClient.populateVisitedLinks(this);
@@ -894,7 +828,7 @@
String messageName;
RefPtr<APIObject> messageBody;
- WebContextUserMessageDecoder messageDecoder(messageBody, m_process.get());
+ WebContextUserMessageDecoder messageDecoder(messageBody, process);
if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
return;
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (124621 => 124622)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2012-08-03 16:41:21 UTC (rev 124622)
@@ -159,6 +159,8 @@
WebDownloadClient& downloadClient() { return m_downloadClient; }
void downloadFinished(DownloadProxy*);
+ WebHistoryClient& historyClient() { return m_historyClient; }
+
static HashSet<String, CaseFoldingHash> pdfAndPostScriptMIMETypes();
WebApplicationCacheManagerProxy* applicationCacheManagerProxy() const { return m_applicationCacheManagerProxy.get(); }
@@ -228,12 +230,6 @@
void platformInitializeWebProcess(WebProcessCreationParameters&);
void platformInvalidateContext();
- // History client
- void didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID);
- void didPerformClientRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
- void didPerformServerRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
- void didUpdateHistoryTitle(uint64_t pageID, const String& title, const String& url, uint64_t frameID);
-
// Plugins
void getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh);
void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.messages.in (124621 => 124622)
--- trunk/Source/WebKit2/UIProcess/WebContext.messages.in 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/UIProcess/WebContext.messages.in 2012-08-03 16:41:21 UTC (rev 124622)
@@ -22,12 +22,6 @@
messages -> WebContext {
- # History client messages.
- DidNavigateWithNavigationData(uint64_t pageID, WebKit::WebNavigationDataStore store, uint64_t frameID)
- DidPerformClientRedirect(uint64_t pageID, WTF::String sourceURLString, WTF::String destinationURLString, uint64_t frameID)
- DidPerformServerRedirect(uint64_t pageID, WTF::String sourceURLString, WTF::String destinationURLString, uint64_t frameID)
- DidUpdateHistoryTitle(uint64_t pageID, WTF::String title, WTF::String url, uint64_t frameID)
-
# Visited link provider messages.
AddVisitedLinkHash(uint64_t linkHash)
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (124621 => 124622)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-08-03 16:41:21 UTC (rev 124622)
@@ -46,6 +46,7 @@
using namespace WebCore;
using namespace std;
+#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, connection())
#define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(checkURLReceivedFromWebProcess(url), connection())
namespace WebKit {
@@ -527,4 +528,67 @@
send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0);
}
+void WebProcessProxy::didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID)
+{
+ WebPageProxy* page = webPage(pageID);
+ if (!page)
+ return;
+
+ WebFrameProxy* frame = webFrame(frameID);
+ MESSAGE_CHECK(frame);
+ MESSAGE_CHECK(frame->page() == page);
+
+ m_context->historyClient().didNavigateWithNavigationData(m_context.get(), page, store, frame);
+}
+
+void WebProcessProxy::didPerformClientRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID)
+{
+ WebPageProxy* page = webPage(pageID);
+ if (!page)
+ return;
+
+ if (sourceURLString.isEmpty() || destinationURLString.isEmpty())
+ return;
+
+ WebFrameProxy* frame = webFrame(frameID);
+ MESSAGE_CHECK(frame);
+ MESSAGE_CHECK(frame->page() == page);
+ MESSAGE_CHECK_URL(sourceURLString);
+ MESSAGE_CHECK_URL(destinationURLString);
+
+ m_context->historyClient().didPerformClientRedirect(m_context.get(), page, sourceURLString, destinationURLString, frame);
+}
+
+void WebProcessProxy::didPerformServerRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID)
+{
+ WebPageProxy* page = webPage(pageID);
+ if (!page)
+ return;
+
+ if (sourceURLString.isEmpty() || destinationURLString.isEmpty())
+ return;
+
+ WebFrameProxy* frame = webFrame(frameID);
+ MESSAGE_CHECK(frame);
+ MESSAGE_CHECK(frame->page() == page);
+ MESSAGE_CHECK_URL(sourceURLString);
+ MESSAGE_CHECK_URL(destinationURLString);
+
+ m_context->historyClient().didPerformServerRedirect(m_context.get(), page, sourceURLString, destinationURLString, frame);
+}
+
+void WebProcessProxy::didUpdateHistoryTitle(uint64_t pageID, const String& title, const String& url, uint64_t frameID)
+{
+ WebPageProxy* page = webPage(pageID);
+ if (!page)
+ return;
+
+ WebFrameProxy* frame = webFrame(frameID);
+ MESSAGE_CHECK(frame);
+ MESSAGE_CHECK(frame->page() == page);
+ MESSAGE_CHECK_URL(url);
+
+ m_context->historyClient().didUpdateHistoryTitle(m_context.get(), page, title, url, frame);
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (124621 => 124622)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2012-08-03 16:41:21 UTC (rev 124622)
@@ -170,6 +170,12 @@
void didFinishLaunching(CoreIPC::Connection::Identifier);
+ // History client
+ void didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore&, uint64_t frameID);
+ void didPerformClientRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
+ void didPerformServerRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
+ void didUpdateHistoryTitle(uint64_t pageID, const String& title, const String& url, uint64_t frameID);
+
// Implemented in generated WebProcessProxyMessageReceiver.cpp
void didReceiveWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void didReceiveSyncWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in (124621 => 124622)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in 2012-08-03 16:41:21 UTC (rev 124622)
@@ -22,6 +22,12 @@
messages -> WebProcessProxy {
+ # History client messages.
+ DidNavigateWithNavigationData(uint64_t pageID, WebKit::WebNavigationDataStore store, uint64_t frameID)
+ DidPerformClientRedirect(uint64_t pageID, WTF::String sourceURLString, WTF::String destinationURLString, uint64_t frameID)
+ DidPerformServerRedirect(uint64_t pageID, WTF::String sourceURLString, WTF::String destinationURLString, uint64_t frameID)
+ DidUpdateHistoryTitle(uint64_t pageID, WTF::String title, WTF::String url, uint64_t frameID)
+
AddBackForwardItem(uint64_t itemID, WTF::String originalURL, WTF::String url, WTF::String title, CoreIPC::DataReference backForwardData)
DidDestroyFrame(uint64_t frameID)
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (124621 => 124622)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2012-08-03 16:25:58 UTC (rev 124621)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2012-08-03 16:41:21 UTC (rev 124622)
@@ -943,7 +943,7 @@
data.title = loader->title().string();
data.originalRequest = loader->originalRequestCopy();
- WebProcess::shared().connection()->send(Messages::WebContext::DidNavigateWithNavigationData(webPage->pageID(), data, m_frame->frameID()), 0);
+ WebProcess::shared().connection()->send(Messages::WebProcessProxy::DidNavigateWithNavigationData(webPage->pageID(), data, m_frame->frameID()), 0);
}
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
@@ -957,13 +957,13 @@
// Client redirect
if (!loader->clientRedirectSourceForHistory().isNull()) {
- WebProcess::shared().connection()->send(Messages::WebContext::DidPerformClientRedirect(webPage->pageID(),
+ WebProcess::shared().connection()->send(Messages::WebProcessProxy::DidPerformClientRedirect(webPage->pageID(),
loader->clientRedirectSourceForHistory(), loader->clientRedirectDestinationForHistory(), m_frame->frameID()), 0);
}
// Server redirect
if (!loader->serverRedirectSourceForHistory().isNull()) {
- WebProcess::shared().connection()->send(Messages::WebContext::DidPerformServerRedirect(webPage->pageID(),
+ WebProcess::shared().connection()->send(Messages::WebProcessProxy::DidPerformServerRedirect(webPage->pageID(),
loader->serverRedirectSourceForHistory(), loader->serverRedirectDestinationForHistory(), m_frame->frameID()), 0);
}
}
@@ -1194,7 +1194,7 @@
return;
// FIXME: use direction of title.
- WebProcess::shared().connection()->send(Messages::WebContext::DidUpdateHistoryTitle(webPage->pageID(),
+ WebProcess::shared().connection()->send(Messages::WebProcessProxy::DidUpdateHistoryTitle(webPage->pageID(),
title.string(), url.string(), m_frame->frameID()), 0);
}