Downloads need to be converted from the NSURLConnection, not canceled and restarted, when using the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=115277
<rdar://problem/12890184>

Reviewed by Sam Weinig.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
Ask the download manager to convert the main resource load to a download.

* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
Add new message.

* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::handle):
Add getter.

* Shared/Downloads/mac/DownloadMac.mm:
(dispatchOnMainThread):
Helper function that ensures that a given block is called on the main thread.

(-[WKDownloadAsDelegate downloadDidBegin:]):
(-[WKDownloadAsDelegate download:didReceiveAuthenticationChallenge:]):
(-[WKDownloadAsDelegate download:didReceiveResponse:]):
(-[WKDownloadAsDelegate download:didReceiveDataOfLength:]):
(-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
(-[WKDownloadAsDelegate download:decideDestinationWithSuggestedFilename:]):
(-[WKDownloadAsDelegate download:didCreateDestination:]):
(-[WKDownloadAsDelegate downloadDidFinish:]):
(-[WKDownloadAsDelegate download:didFailWithError:]):
Use dispatchOnMainThread.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
Remove code that cancels the current load and starts a new download.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::convertMainResourceLoadToDownload):
Send the ConvertMainResourceLoadToDownload message to the network process.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149211 268f45cc-cd09-0410-ab3c-d52691b4dbfc