From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/WebKit2/WebProcess/WebProcess.cpp | 41 +++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'Source/WebKit2/WebProcess/WebProcess.cpp') diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp index 9a8b905fe..c435221a7 100644 --- a/Source/WebKit2/WebProcess/WebProcess.cpp +++ b/Source/WebKit2/WebProcess/WebProcess.cpp @@ -134,6 +134,9 @@ WebProcess::WebProcess() , m_cacheModel(CacheModelDocumentViewer) #if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC) , m_compositingRenderServerPort(MACH_PORT_NULL) +#endif +#if PLATFORM(MAC) + , m_clearResourceCachesDispatchGroup(0) #endif , m_fullKeyboardAccessEnabled(false) #if PLATFORM(QT) @@ -141,13 +144,16 @@ WebProcess::WebProcess() #endif , m_textCheckerState() , m_geolocationManager(this) -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) , m_notificationManager(this) #endif , m_iconDatabaseProxy(this) #if ENABLE(PLUGIN_PROCESS) , m_disablePluginProcessMessageTimeout(false) #endif +#if USE(SOUP) + , m_soupRequestManager(this) +#endif { #if USE(PLATFORM_STRATEGIES) // Initialize our platform strategies. @@ -503,7 +509,7 @@ WebPage* WebProcess::focusedWebPage() const HashMap >::const_iterator end = m_pageMap.end(); for (HashMap >::const_iterator it = m_pageMap.begin(); it != end; ++it) { WebPage* page = (*it).second.get(); - if (page->windowIsFocused()) + if (page->windowAndWebPageAreFocused()) return page; } return 0; @@ -518,16 +524,16 @@ void WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParameters& { // It is necessary to check for page existence here since during a window.open() (or targeted // link) the WebPage gets created both in the synchronous handler and through the normal way. - std::pair >::iterator, bool> result = m_pageMap.add(pageID, 0); - if (result.second) { - ASSERT(!result.first->second); - result.first->second = WebPage::create(pageID, parameters); + HashMap >::AddResult result = m_pageMap.add(pageID, 0); + if (result.isNewEntry) { + ASSERT(!result.iterator->second); + result.iterator->second = WebPage::create(pageID, parameters); // Balanced by an enableTermination in removeWebPage. disableTermination(); } - ASSERT(result.first->second); + ASSERT(result.iterator->second); } void WebProcess::removeWebPage(uint64_t pageID) @@ -638,7 +644,7 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes return; } -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) if (messageID.is()) { m_notificationManager.didReceiveMessage(connection, messageID, arguments); return; @@ -650,6 +656,13 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes return; } +#if USE(SOUP) + if (messageID.is()) { + m_soupRequestManager.didReceiveMessage(connection, messageID, arguments); + return; + } +#endif + if (messageID.is()) { if (!m_injectedBundle) return; @@ -683,7 +696,7 @@ void WebProcess::didClose(CoreIPC::Connection*) pages[i]->close(); pages.clear(); - gcController().garbageCollectNow(); + gcController().garbageCollectSoon(); memoryCache()->setDisabled(true); #endif @@ -739,13 +752,13 @@ WebPageGroupProxy* WebProcess::webPageGroup(uint64_t pageGroupID) WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupData) { - std::pair >::iterator, bool> result = m_pageGroupMap.add(pageGroupData.pageGroupID, 0); - if (result.second) { - ASSERT(!result.first->second); - result.first->second = WebPageGroupProxy::create(pageGroupData); + HashMap >::AddResult result = m_pageGroupMap.add(pageGroupData.pageGroupID, 0); + if (result.isNewEntry) { + ASSERT(!result.iterator->second); + result.iterator->second = WebPageGroupProxy::create(pageGroupData); } - return result.first->second.get(); + return result.iterator->second.get(); } static bool canPluginHandleResponse(const ResourceResponse& response) -- cgit v1.2.1