- Revision
- 137812
- Author
- [email protected]
- Date
- 2012-12-15 14:49:36 -0800 (Sat, 15 Dec 2012)
Log Message
Move the download proxy map from the web context to the web process proxy
https://bugs.webkit.org/show_bug.cgi?id=105109
Reviewed by Andreas Kling.
More progress towards making downloads work with the networking process. Since downloads are handled by the
web process when not using a networking process, it makes sense for the download proxy map to live in the
web process proxy object.
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::shouldTerminate):
(WebKit::WebContext::disconnectProcess):
(WebKit::WebContext::download):
(WebKit::WebContext::createDownloadProxy):
* UIProcess/WebContext.h:
(WebContext):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::disconnect):
(WebKit::WebProcessProxy::shouldTerminate):
(WebKit):
(WebKit::WebProcessProxy::createDownloadProxy):
* UIProcess/WebProcessProxy.h:
(WebProcessProxy):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (137811 => 137812)
--- trunk/Source/WebKit2/ChangeLog 2012-12-15 22:11:27 UTC (rev 137811)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-15 22:49:36 UTC (rev 137812)
@@ -1,5 +1,32 @@
2012-12-15 Anders Carlsson <[email protected]>
+ Move the download proxy map from the web context to the web process proxy
+ https://bugs.webkit.org/show_bug.cgi?id=105109
+
+ Reviewed by Andreas Kling.
+
+ More progress towards making downloads work with the networking process. Since downloads are handled by the
+ web process when not using a networking process, it makes sense for the download proxy map to live in the
+ web process proxy object.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ (WebKit::WebContext::shouldTerminate):
+ (WebKit::WebContext::disconnectProcess):
+ (WebKit::WebContext::download):
+ (WebKit::WebContext::createDownloadProxy):
+ * UIProcess/WebContext.h:
+ (WebContext):
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::disconnect):
+ (WebKit::WebProcessProxy::shouldTerminate):
+ (WebKit):
+ (WebKit::WebProcessProxy::createDownloadProxy):
+ * UIProcess/WebProcessProxy.h:
+ (WebProcessProxy):
+
+2012-12-15 Anders Carlsson <[email protected]>
+
DownloadProxy should keep a strong reference to its associated web context
https://bugs.webkit.org/show_bug.cgi?id=105107
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (137811 => 137812)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-12-15 22:11:27 UTC (rev 137811)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-12-15 22:49:36 UTC (rev 137812)
@@ -128,7 +128,6 @@
, m_alwaysUsesComplexTextCodePath(false)
, m_shouldUseFontSmoothing(true)
, m_cacheModel(CacheModelDocumentViewer)
- , m_downloads(m_messageReceiverMap)
, m_memorySamplerEnabled(false)
, m_memorySamplerInterval(1400.0)
#if PLATFORM(WIN)
@@ -555,9 +554,6 @@
if (!m_processTerminationEnabled)
return false;
- if (!m_downloads.isEmpty())
- return false;
-
if (!m_applicationCacheManagerProxy->shouldTerminate(process))
return false;
if (!m_cookieManagerProxy->shouldTerminate(process))
@@ -617,8 +613,6 @@
return;
}
- m_downloads.processDidClose();
-
m_applicationCacheManagerProxy->invalidate();
#if ENABLE(BATTERY_STATUS)
m_batteryManagerProxy->invalidate();
@@ -693,24 +687,23 @@
DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
{
- if (m_processModel == ProcessModelSharedSecondaryProcess) {
- ensureSharedWebProcess();
+ DownloadProxy* downloadProxy = createDownloadProxy();
+ uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
- DownloadProxy* download = createDownloadProxy();
- uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
+#if ENABLE(NETWORK_PROCESS)
+ if (usesNetworkProcess()) {
+ // FIXME (Multi-WebProcess): <rdar://problem/12239483> Make downloading work.
+ return 0;
+ }
+#endif
#if PLATFORM(QT)
- ASSERT(initiatingPage); // Our design does not suppport downloads without a WebPage.
- initiatingPage->handleDownloadRequest(download);
+ ASSERT(initiatingPage); // Our design does not suppport downloads without a WebPage.
+ initiatingPage->handleDownloadRequest(download);
#endif
- m_processes[0]->send(Messages::WebProcess::DownloadRequest(download->downloadID(), initiatingPageID, request), 0);
- return download;
-
- } else {
- // FIXME (Multi-WebProcess): <rdar://problem/12239483> Make downloading work.
- return 0;
- }
+ m_processes[0]->send(Messages::WebProcess::DownloadRequest(downloadProxy->downloadID(), initiatingPageID, request), 0);
+ return downloadProxy;
}
void WebContext::postMessageToInjectedBundle(const String& messageName, APIObject* messageBody)
@@ -847,7 +840,12 @@
DownloadProxy* WebContext::createDownloadProxy()
{
- return m_downloads.createDownloadProxy(this);
+ if (usesNetworkProcess()) {
+ // FIXME (Multi-WebProcess): <rdar://problem/12239483> Make downloading work.
+ return 0;
+ }
+
+ return ensureSharedWebProcess()->createDownloadProxy();
}
// FIXME: This is not the ideal place for this function.
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (137811 => 137812)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2012-12-15 22:11:27 UTC (rev 137811)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2012-12-15 22:49:36 UTC (rev 137812)
@@ -385,7 +385,6 @@
CacheModel m_cacheModel;
WebDownloadClient m_downloadClient;
- DownloadProxyMap m_downloads;
bool m_memorySamplerEnabled;
double m_memorySamplerInterval;
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (137811 => 137812)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-12-15 22:11:27 UTC (rev 137811)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-12-15 22:49:36 UTC (rev 137812)
@@ -127,6 +127,9 @@
frames[i]->disconnect();
m_frameMap.clear();
+ if (m_downloadProxyMap)
+ m_downloadProxyMap->processDidClose();
+
m_context->disconnectProcess(this);
}
@@ -553,7 +556,7 @@
void WebProcessProxy::shouldTerminate(bool& shouldTerminate)
{
- if (!m_pageMap.isEmpty() || !m_context->shouldTerminate(this)) {
+ if (!m_pageMap.isEmpty() || (m_downloadProxyMap && !m_downloadProxyMap->isEmpty()) || !m_context->shouldTerminate(this)) {
shouldTerminate = false;
return;
}
@@ -570,6 +573,19 @@
send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0);
}
+
+DownloadProxy* WebProcessProxy::createDownloadProxy()
+{
+#if ENABLE(NETWORK_PROCESS)
+ ASSERT(!m_context->usesNetworkProcess());
+#endif
+
+ if (!m_downloadProxyMap)
+ m_downloadProxyMap = adoptPtr(new DownloadProxyMap(m_messageReceiverMap));
+
+ return m_downloadProxyMap->createDownloadProxy(m_context.get());
+}
+
void WebProcessProxy::didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID)
{
WebPageProxy* page = webPage(pageID);
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (137811 => 137812)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2012-12-15 22:11:27 UTC (rev 137811)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2012-12-15 22:49:36 UTC (rev 137812)
@@ -27,6 +27,7 @@
#define WebProcessProxy_h
#include "ChildProcessProxy.h"
+#include "DownloadProxyMap.h"
#include "MessageReceiverMap.h"
#include "PlatformProcessIdentifier.h"
#include "PluginInfoStore.h"
@@ -114,6 +115,8 @@
static bool fullKeyboardAccessEnabled();
+ DownloadProxy* createDownloadProxy();
+
private:
explicit WebProcessProxy(PassRefPtr<WebContext>);
@@ -199,7 +202,9 @@
HashMap<uint64_t, WebPageProxy*> m_pageMap;
WebFrameProxyMap m_frameMap;
WebBackForwardListItemMap m_backForwardListItemMap;
-
+
+ OwnPtr<DownloadProxyMap> m_downloadProxyMap;
+
#if ENABLE(CUSTOM_PROTOCOLS)
CustomProtocolManagerProxy m_customProtocolManagerProxy;
#endif