Use asynchronous ResourceHandleClient calls for WebKit1
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2017 01:55:24 +0000 (01:55 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2017 01:55:24 +0000 (01:55 +0000)
commit770d48936f1224688e415d7552518124b4cf916b
tree384727a77f4555aa01719a2e774390897fbe8254
parentaa8b32fd22bcf8eba3a62da90b12606dacc84454
Use asynchronous ResourceHandleClient calls for WebKit1
https://bugs.webkit.org/show_bug.cgi?id=160677

Reviewed by Brady Eidson.

Source/WebCore:

Covered by existing tests.

* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestAsync):
(WebCore::ResourceLoader::didReceiveResponseAsync):
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* loader/ResourceLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
(WebCore::ApplicationCacheGroup::willSendRequestAsync):
(WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
(WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
* loader/appcache/ApplicationCacheGroup.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::continueDidReceiveResponse):
(WebCore::BlobResourceHandle::getSizeForNext):
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
(WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::~ResourceHandleClient):
(WebCore::ResourceHandleClient::willSendRequest): Deleted.
(WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
(WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
(WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
(WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
(WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::willSendRequestAsync):
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
(WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
(WebCore::SynchronousLoaderClient::didFinishLoading):
(WebCore::SynchronousLoaderClient::didFail):
(WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
(WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::makeDelegate):
(WebCore::ResourceHandle::delegate):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueWillSendRequest):
(WebCore::ResourceHandle::continueDidReceiveResponse):
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueWillCacheResponse):
(WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
* platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::createPingHandle):

LayoutTests:

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/wk2/TestExpectations:

http/tests/cache/iframe-304-crash.html used to deterministically record its didFinishLoading callback,
but only for WK1.  It was marked as flaky for all WK2 ports.  It is now flaky in WK1 because the order
of the testRunner.notifyDone call and the didFinishLoading logging is no longer deterministic with
asynchronous loading, but the test still verifies that there is no crash.

http/tests/security/cross-origin-modal-dialog-base.html does navigation during showModalDialog, which
probably should've never worked in WK1 and never worked in WK2.  WK1 behavior now matches WK2 behavior.
I'm not aware of any complaints about no navigation working during showModalDialog in WK2 and I imagine
nobody will be regressed by this change, but if we do find such a problem, creative use of MessageQueues
like we do with sync xhr in WK1 now could theoretically fix the problem, but we are trying to get
rid of showModalDialog anyway.  The test was written to verify that the SecurityOrigin doesn't fall back
to the wrong origin, and it certainly doesn't now.

These tests dump load delegate call order, which are less deterministic now but the tests still behave correctly.
http/tests/svg/svg-use-external.html
http/tests/loading/text-content-type-with-binary-extension.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
52 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-wk2/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/wk2/TestExpectations
LayoutTests/security/block-test.html
LayoutTests/svg/in-html/by-reference.html
Source/WebCore/ChangeLog
Source/WebCore/PlatformAppleWin.cmake
Source/WebCore/PlatformMac.cmake
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/cocoa/WebArchiveResourceFromNSAttributedString.mm
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.h
Source/WebCore/platform/network/BlobResourceHandle.cpp
Source/WebCore/platform/network/PingHandle.h
Source/WebCore/platform/network/ResourceHandle.cpp
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/ResourceHandleClient.cpp
Source/WebCore/platform/network/ResourceHandleClient.h
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/SynchronousLoaderClient.cpp
Source/WebCore/platform/network/SynchronousLoaderClient.h
Source/WebCore/platform/network/cf/CookieJarCFNet.cpp
Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp
Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp [deleted file]
Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h [deleted file]
Source/WebCore/platform/network/curl/MultipartHandle.cpp
Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp
Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp
Source/WebCore/platform/network/mac/CookieJarMac.mm
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.h [deleted file]
Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm [deleted file]
Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h
Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebKit/NetworkProcess/Downloads/BlobDownloadClient.cpp
Source/WebKit/NetworkProcess/Downloads/BlobDownloadClient.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkLoad.h
Source/WebKit/Shared/mac/ArgumentCodersMac.h
Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp