summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebContext.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
commit3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch)
tree73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit2/UIProcess/WebContext.cpp
parentb32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff)
downloadqtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit2/UIProcess/WebContext.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp130
1 files changed, 24 insertions, 106 deletions
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index 22e4e2006..c80aad42b 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -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;
@@ -95,28 +94,12 @@ namespace WebKit {
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webContextCounter, ("WebContext"));
-WebContext* WebContext::sharedProcessContext()
-{
- JSC::initializeThreading();
- WTF::initializeMainThread();
- RunLoop::initializeMainRunLoop();
- static WebContext* context = adoptRef(new WebContext(ProcessModelSharedSecondaryProcess, String())).leakRef();
- return context;
-}
-
-WebContext* WebContext::sharedThreadContext()
-{
- RunLoop::initializeMainRunLoop();
- static WebContext* context = adoptRef(new WebContext(ProcessModelSharedSecondaryThread, String())).leakRef();
- return context;
-}
-
PassRefPtr<WebContext> WebContext::create(const String& injectedBundlePath)
{
JSC::initializeThreading();
WTF::initializeMainThread();
RunLoop::initializeMainRunLoop();
- return adoptRef(new WebContext(ProcessModelSecondaryProcess, injectedBundlePath));
+ return adoptRef(new WebContext(ProcessModelSharedSecondaryProcess, injectedBundlePath));
}
static Vector<WebContext*>& contexts()
@@ -530,71 +513,6 @@ void WebContext::didReceiveSynchronousMessageFromInjectedBundle(const String& me
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);
@@ -765,91 +683,91 @@ HashSet<String, CaseFoldingHash> WebContext::pdfAndPostScriptMIMETypes()
return mimeTypes;
}
-void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebContext::didReceiveMessage(WebProcessProxy* process, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
if (messageID.is<CoreIPC::MessageClassWebContext>()) {
- didReceiveWebContextMessage(connection, messageID, arguments);
+ didReceiveWebContextMessage(process->connection(), messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
if (DownloadProxy* downloadProxy = m_downloads.get(arguments->destinationID()).get())
- downloadProxy->didReceiveDownloadProxyMessage(connection, messageID, arguments);
+ downloadProxy->didReceiveDownloadProxyMessage(process->connection(), messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebApplicationCacheManagerProxy>()) {
- m_applicationCacheManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_applicationCacheManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#if ENABLE(BATTERY_STATUS)
if (messageID.is<CoreIPC::MessageClassWebBatteryManagerProxy>()) {
- m_batteryManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_batteryManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#endif
if (messageID.is<CoreIPC::MessageClassWebCookieManagerProxy>()) {
- m_cookieManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_cookieManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#if ENABLE(SQL_DATABASE)
if (messageID.is<CoreIPC::MessageClassWebDatabaseManagerProxy>()) {
- m_databaseManagerProxy->didReceiveWebDatabaseManagerProxyMessage(connection, messageID, arguments);
+ m_databaseManagerProxy->didReceiveWebDatabaseManagerProxyMessage(process->connection(), messageID, arguments);
return;
}
#endif
if (messageID.is<CoreIPC::MessageClassWebGeolocationManagerProxy>()) {
- m_geolocationManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_geolocationManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
- m_iconDatabase->didReceiveMessage(connection, messageID, arguments);
+ m_iconDatabase->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>()) {
- m_keyValueStorageManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_keyValueStorageManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>()) {
- m_mediaCacheManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_mediaCacheManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#if ENABLE(NETWORK_INFO)
if (messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>()) {
- m_networkInfoManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_networkInfoManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#endif
if (messageID.is<CoreIPC::MessageClassWebNotificationManagerProxy>()) {
- m_notificationManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_notificationManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
if (messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) {
- m_resourceCacheManagerProxy->didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, arguments);
+ m_resourceCacheManagerProxy->didReceiveWebResourceCacheManagerProxyMessage(process->connection(), messageID, arguments);
return;
}
#if USE(SOUP)
if (messageID.is<CoreIPC::MessageClassWebSoupRequestManagerProxy>()) {
- m_soupRequestManagerProxy->didReceiveMessage(connection, messageID, arguments);
+ m_soupRequestManagerProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#endif
#if ENABLE(VIBRATION)
if (messageID.is<CoreIPC::MessageClassWebVibrationProxy>()) {
- m_vibrationProxy->didReceiveMessage(connection, messageID, arguments);
+ m_vibrationProxy->didReceiveMessage(process->connection(), messageID, arguments);
return;
}
#endif
@@ -858,7 +776,7 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
case WebContextLegacyMessage::PostMessage: {
String messageName;
RefPtr<APIObject> messageBody;
- WebContextUserMessageDecoder messageDecoder(messageBody, this);
+ WebContextUserMessageDecoder messageDecoder(messageBody, process);
if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
return;
@@ -872,27 +790,27 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
ASSERT_NOT_REACHED();
}
-void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebContext::didReceiveSyncMessage(WebProcessProxy* process, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
{
if (messageID.is<CoreIPC::MessageClassWebContext>()) {
- didReceiveSyncWebContextMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebContextMessage(process->connection(), messageID, arguments, reply);
return;
}
if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
if (DownloadProxy* downloadProxy = m_downloads.get(arguments->destinationID()).get())
- downloadProxy->didReceiveSyncDownloadProxyMessage(connection, messageID, arguments, reply);
+ downloadProxy->didReceiveSyncDownloadProxyMessage(process->connection(), messageID, arguments, reply);
return;
}
if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
- m_iconDatabase->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_iconDatabase->didReceiveSyncMessage(process->connection(), messageID, arguments, reply);
return;
}
#if ENABLE(NETWORK_INFO)
if (messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>()) {
- m_networkInfoManagerProxy->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_networkInfoManagerProxy->didReceiveSyncMessage(process->connection(), messageID, arguments, reply);
return;
}
#endif
@@ -903,7 +821,7 @@ void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC:
String messageName;
RefPtr<APIObject> messageBody;
- WebContextUserMessageDecoder messageDecoder(messageBody, this);
+ WebContextUserMessageDecoder messageDecoder(messageBody, process);
if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
return;