From c13336d5cd46f13d35ca5c59c758175c8133bd86 Mon Sep 17 00:00:00 2001 From: "carlosgc@webkit.org" Date: Thu, 9 Jan 2014 17:55:39 +0000 Subject: [PATCH] Crash when starting a download before the network process has been launched https://bugs.webkit.org/show_bug.cgi?id=126258 Reviewed by Anders Carlsson. We need to ensure there's a network process running before starting a new download like we do when using the web process. * UIProcess/WebContext.cpp: (WebKit::WebContext::download): Use ChildProcessProxy::send() instead of using the connection to make sure messages are queued if the process is still launching. (WebKit::WebContext::createDownloadProxy): Call ensureNetworkProcess() before creating the download proxy. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161559 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit2/ChangeLog | 17 +++++++++++++++++ Source/WebKit2/UIProcess/WebContext.cpp | 7 +++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index aba21ca..6185176 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,5 +1,22 @@ 2014-01-09 Carlos Garcia Campos + Crash when starting a download before the network process has been launched + https://bugs.webkit.org/show_bug.cgi?id=126258 + + Reviewed by Anders Carlsson. + + We need to ensure there's a network process running before + starting a new download like we do when using the web process. + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::download): Use ChildProcessProxy::send() + instead of using the connection to make sure messages are queued + if the process is still launching. + (WebKit::WebContext::createDownloadProxy): Call + ensureNetworkProcess() before creating the download proxy. + +2014-01-09 Carlos Garcia Campos + [SOUP] Partial file left on disk after a download fails or is cancelled in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=126686 diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp index 4949326..c0bc387 100644 --- a/Source/WebKit2/UIProcess/WebContext.cpp +++ b/Source/WebKit2/UIProcess/WebContext.cpp @@ -763,7 +763,7 @@ DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const Resource #if ENABLE(NETWORK_PROCESS) if (usesNetworkProcess() && networkProcess()) { // FIXME (NetworkProcess): Replicate whatever FrameLoader::setOriginalURLForDownloadRequest does with the request here. - networkProcess()->connection()->send(Messages::NetworkProcess::DownloadRequest(downloadProxy->downloadID(), request), 0); + networkProcess()->send(Messages::NetworkProcess::DownloadRequest(downloadProxy->downloadID(), request), 0); return downloadProxy; } #endif @@ -938,8 +938,11 @@ void WebContext::addVisitedLinkHash(LinkHash linkHash) DownloadProxy* WebContext::createDownloadProxy() { #if ENABLE(NETWORK_PROCESS) - if (usesNetworkProcess()) + if (usesNetworkProcess()) { + ensureNetworkProcess(); + ASSERT(m_networkProcess); return m_networkProcess->createDownloadProxy(); + } #endif return ensureSharedWebProcess().createDownloadProxy(); -- 1.8.3.1