diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
commit | 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch) | |
tree | 8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebKit2/WebProcess/WebProcess.cpp | |
parent | 33b26980cb24288b5a9f2590ccf32a949281bb79 (diff) | |
download | qtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz |
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1
widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're
working on completing the entire split as part of
https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebKit2/WebProcess/WebProcess.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/WebProcess.cpp | 102 |
1 files changed, 40 insertions, 62 deletions
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp index de1832459..6f67ed022 100644 --- a/Source/WebKit2/WebProcess/WebProcess.cpp +++ b/Source/WebKit2/WebProcess/WebProcess.cpp @@ -26,10 +26,8 @@ #include "config.h" #include "WebProcess.h" -#include "AuthenticationManager.h" #include "DownloadManager.h" #include "InjectedBundle.h" -#include "InjectedBundleMessageKinds.h" #include "InjectedBundleUserMessageCoders.h" #include "SandboxExtension.h" #include "StatisticsData.h" @@ -160,9 +158,6 @@ WebProcess::WebProcess() , m_notificationManager(this) #endif , m_iconDatabaseProxy(this) -#if ENABLE(PLUGIN_PROCESS) - , m_disablePluginProcessMessageTimeout(false) -#endif #if USE(SOUP) , m_soupRequestManager(this) #endif @@ -251,9 +246,6 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame setDefaultRequestTimeoutInterval(parameters.defaultRequestTimeoutInterval); - for (size_t i = 0; i < parameters.mimeTypesWithCustomRepresentation.size(); ++i) - m_mimeTypesWithCustomRepresentations.add(parameters.mimeTypesWithCustomRepresentation[i]); - if (parameters.shouldAlwaysUseComplexTextCodePath) setAlwaysUsesComplexTextCodePath(true); @@ -264,10 +256,6 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase(parameters.uiProcessBundleIdentifier); #endif -#if ENABLE(PLUGIN_PROCESS) - m_disablePluginProcessMessageTimeout = parameters.disablePluginProcessMessageTimeout; -#endif - setTerminationTimeout(parameters.terminationTimeout); } @@ -354,7 +342,7 @@ void WebProcess::visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHa HashMap<uint64_t, RefPtr<WebPageGroupProxy> >::const_iterator it = m_pageGroupMap.begin(); HashMap<uint64_t, RefPtr<WebPageGroupProxy> >::const_iterator end = m_pageGroupMap.end(); for (; it != end; ++it) - Page::visitedStateChanged(PageGroup::pageGroup(it->second->identifier()), linkHashes[i]); + Page::visitedStateChanged(PageGroup::pageGroup(it->value->identifier()), linkHashes[i]); } pageCache()->markPagesForVistedLinkStyleRecalc(); @@ -366,7 +354,7 @@ void WebProcess::allVisitedLinkStateChanged() HashMap<uint64_t, RefPtr<WebPageGroupProxy> >::const_iterator it = m_pageGroupMap.begin(); HashMap<uint64_t, RefPtr<WebPageGroupProxy> >::const_iterator end = m_pageGroupMap.end(); for (; it != end; ++it) - Page::allVisitedStateChanged(PageGroup::pageGroup(it->second->identifier())); + Page::allVisitedStateChanged(PageGroup::pageGroup(it->value->identifier())); pageCache()->markPagesForVistedLinkStyleRecalc(); } @@ -542,7 +530,7 @@ WebPage* WebProcess::focusedWebPage() const { HashMap<uint64_t, RefPtr<WebPage> >::const_iterator end = m_pageMap.end(); for (HashMap<uint64_t, RefPtr<WebPage> >::const_iterator it = m_pageMap.begin(); it != end; ++it) { - WebPage* page = (*it).second.get(); + WebPage* page = (*it).value.get(); if (page->windowAndWebPageAreFocused()) return page; } @@ -560,14 +548,14 @@ void WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParameters& // link) the WebPage gets created both in the synchronous handler and through the normal way. HashMap<uint64_t, RefPtr<WebPage> >::AddResult result = m_pageMap.add(pageID, 0); if (result.isNewEntry) { - ASSERT(!result.iterator->second); - result.iterator->second = WebPage::create(pageID, parameters); + ASSERT(!result.iterator->value); + result.iterator->value = WebPage::create(pageID, parameters); // Balanced by an enableTermination in removeWebPage. disableTermination(); } - ASSERT(result.iterator->second); + ASSERT(result.iterator->value); } void WebProcess::removeWebPage(uint64_t pageID) @@ -638,11 +626,6 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes return; } - if (messageID.is<CoreIPC::MessageClassAuthenticationManager>()) { - AuthenticationManager::shared().didReceiveMessage(connection, messageID, arguments); - return; - } - if (messageID.is<CoreIPC::MessageClassWebApplicationCacheManager>()) { WebApplicationCacheManager::shared().didReceiveMessage(connection, messageID, arguments); return; @@ -660,11 +643,6 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes } #endif - if (messageID.is<CoreIPC::MessageClassWebGeolocationManager>()) { - m_geolocationManager.didReceiveMessage(connection, messageID, arguments); - return; - } - #if ENABLE(BATTERY_STATUS) if (messageID.is<CoreIPC::MessageClassWebBatteryManager>()) { m_batteryManager.didReceiveMessage(connection, messageID, arguments); @@ -712,12 +690,17 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes return; } #endif - - if (messageID.is<CoreIPC::MessageClassInjectedBundle>()) { - if (!m_injectedBundle) + + if (messageID.is<CoreIPC::MessageClassWebPageGroupProxy>()) { + uint64_t pageGroupID = arguments->destinationID(); + if (!pageGroupID) return; - m_injectedBundle->didReceiveMessage(connection, messageID, arguments); - return; + + WebPageGroupProxy* pageGroupProxy = webPageGroup(pageGroupID); + if (!pageGroupProxy) + return; + + pageGroupProxy->didReceiveMessage(connection, messageID, arguments); } uint64_t pageID = arguments->destinationID(); @@ -760,10 +743,6 @@ void WebProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::Message // we'll let it slide. } -void WebProcess::syncMessageSendTimedOut(CoreIPC::Connection*) -{ -} - void WebProcess::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage) { if (messageID.is<CoreIPC::MessageClassWebProcess>()) { @@ -804,11 +783,11 @@ WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupDat { HashMap<uint64_t, RefPtr<WebPageGroupProxy> >::AddResult result = m_pageGroupMap.add(pageGroupData.pageGroupID, 0); if (result.isNewEntry) { - ASSERT(!result.iterator->second); - result.iterator->second = WebPageGroupProxy::create(pageGroupData); + ASSERT(!result.iterator->value); + result.iterator->value = WebPageGroupProxy::create(pageGroupData); } - return result.iterator->second.get(); + return result.iterator->value.get(); } #if ENABLE(WEB_INTENTS) @@ -831,26 +810,6 @@ void WebProcess::removeMessagePortChannel(uint64_t channelID) } #endif -static bool canPluginHandleResponse(const ResourceResponse& response) -{ - String pluginPath; - bool blocked; - - if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebProcessProxy::GetPluginPath::Reply(pluginPath, blocked), 0)) - return false; - - return !blocked && !pluginPath.isEmpty(); -} - -bool WebProcess::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const -{ - if (!m_mimeTypesWithCustomRepresentations.contains(response.mimeType())) - return false; - - // If a plug-in exists that claims to support this response, it should take precedence over the custom representation. - return !canPluginHandleResponse(response); -} - void WebProcess::clearResourceCaches(ResourceCachesToClear resourceCachesToClear) { platformClearResourceCaches(resourceCachesToClear); @@ -934,7 +893,7 @@ static void fromCountedSetToHashMap(TypeCountSet* countedSet, HashMap<String, ui { TypeCountSet::const_iterator end = countedSet->end(); for (TypeCountSet::const_iterator it = countedSet->begin(); it != end; ++it) - map.set(it->first, it->second); + map.set(it->key, it->value); } static void getWebCoreMemoryCacheStatistics(Vector<HashMap<String, uint64_t> >& result) @@ -1046,6 +1005,25 @@ void WebProcess::setJavaScriptGarbageCollectorTimerEnabled(bool flag) gcController().setJavaScriptGarbageCollectorTimerEnabled(flag); } +void WebProcess::postInjectedBundleMessage(const CoreIPC::DataReference& messageData) +{ + InjectedBundle* injectedBundle = WebProcess::shared().injectedBundle(); + if (!injectedBundle) + return; + + CoreIPC::ArgumentDecoder messageDecoder(messageData.data(), messageData.size()); + + String messageName; + if (!messageDecoder.decode(messageName)) + return; + + RefPtr<APIObject> messageBody; + if (!messageDecoder.decode(InjectedBundleUserMessageDecoder(messageBody))) + return; + + injectedBundle->didReceiveMessage(messageName, messageBody.get()); +} + #if ENABLE(PLUGIN_PROCESS) void WebProcess::pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath) { @@ -1107,7 +1085,7 @@ void WebProcess::setTextCheckerState(const TextCheckerState& textCheckerState) HashMap<uint64_t, RefPtr<WebPage> >::iterator end = m_pageMap.end(); for (HashMap<uint64_t, RefPtr<WebPage> >::iterator it = m_pageMap.begin(); it != end; ++it) { - WebPage* page = (*it).second.get(); + WebPage* page = (*it).value.get(); if (continuousSpellCheckingTurnedOff) page->unmarkAllMisspellings(); if (grammarCheckingTurnedOff) |