REGRESSION(AppleWebKit/605.1.15): WebDownloadDelegate delegate methods called on...
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 21:52:51 +0000 (21:52 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 21:52:51 +0000 (21:52 +0000)
commitd89a1302f450ac0fb4ac1a7056323a6a527ef180
treed24ac255d6732db3a83a817019be097be025a089
parent4add75ff095836721dcc5057ffd42d272a0d09a9
REGRESSION(AppleWebKit/605.1.15): WebDownloadDelegate delegate methods called on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=190918
<rdar://problem/45603890>

Reviewed by Darin Adler.

Source/WebKitLegacy/mac:

Since we not doing networking on the main thread but WebView is to be used on the main thread,
we need to hop delegate calls to the main thread similarly to how we do it in the non-download
delegate calls in WebCoreResourceHandleAsOperationQueueDelegate.

* Misc/WebDownload.mm:
(-[WebDownloadInternal downloadDidBegin:]):
(-[WebDownloadInternal download:willSendRequest:redirectResponse:]):
(-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]):
(-[WebDownloadInternal download:didReceiveResponse:]):
(-[WebDownloadInternal download:didReceiveDataOfLength:]):
(-[WebDownloadInternal download:shouldDecodeSourceDataOfMIMEType:]):
(-[WebDownloadInternal download:decideDestinationWithSuggestedFilename:]):
(-[WebDownloadInternal download:didCreateDestination:]):
(-[WebDownloadInternal downloadDidFinish:]):
(-[WebDownloadInternal download:didFailWithError:]):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitLegacy/mac/DownloadThread.mm: Added.
(-[DownloadThreadChecker webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
(-[DownloadThreadChecker downloadDidBegin:]):
(-[DownloadThreadChecker download:shouldDecodeSourceDataOfMIMEType:]):
(-[DownloadThreadChecker download:decideDestinationWithSuggestedFilename:]):
(-[DownloadThreadChecker download:didCreateDestination:]):
(-[DownloadThreadChecker downloadDidFinish:]):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Misc/WebDownload.mm
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/DownloadThread.mm [new file with mode: 0644]