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):
Tools:
* TestWebKitAPI/Tests/mac/SimplifyMarkup.mm:
(TestWebKitAPI::TEST):
The HTML being loaded contains an iframe, so testing if the main resource has loaded doesn't necessarily mean all subresources are loaded.
Wait until they are loaded before continuing the test. This is a test of editing commands once the page has loaded, not a test of loading.
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: http://svn.webkit.org/repository/webkit/trunk@224267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations
index 5d9a1d5..d0b824c 100644
--- a/LayoutTests/TestExpectations
+++ b/LayoutTests/TestExpectations
@@ -40,6 +40,9 @@
# window.showModalDialog is only tested in DumpRenderTree on Mac.
editing/execCommand/show-modal-dialog-during-execCommand.html [ Skip ]
+http/tests/security/cross-origin-modal-dialog-base.html [ Skip ]
+fast/events/scroll-event-during-modal-dialog.html [ Skip ]
+fast/harness/show-modal-dialog.html [ Skip ]
fast/shadow-dom/touch-event-on-text-assigned-to-slot.html [ Skip ]
@@ -489,6 +492,11 @@
webkit.org/b/169565 imported/w3c/web-platform-tests/cors/status-async.htm [ Failure ]
webkit.org/b/169565 imported/w3c/web-platform-tests/cors/304.htm [ Failure ]
+# These tests used to have deterministic load delegate callback order before webkit.org/b/160677
+http/tests/svg/svg-use-external.html [ Pass Failure ]
+http/tests/loading/text-content-type-with-binary-extension.html [ Pass Failure ]
+http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html [ Pass Failure ]
+
# Tests that are flakey due to unhandled promise rejection error messages
webkit.org/b/171094 imported/w3c/web-platform-tests/streams/readable-streams/tee.html [ Pass Failure ]
webkit.org/b/171094 streams/brand-checks.html [ Pass Failure ]
@@ -825,6 +833,7 @@
webkit.org/b/140043 js/dom/Promise.html [ Pass Failure ]
+webkit.org/b/134550 http/tests/cache/iframe-304-crash.html [ Failure Pass ]
webkit.org/b/141267 http/tests/misc/detached-frame-console.html [ Pass Failure ]
# Aborting application cache abort tests are intrinsically flaky.