Changeset 202511 in webkit
- Timestamp:
- Jun 27, 2016 1:59:27 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202510 r202511 1 2016-06-27 Alex Christensen <achristensen@webkit.org> 2 3 Send canAuthenticateAgainstProtectionSpace calls from NetworkProcess directly to UIProcess 4 https://bugs.webkit.org/show_bug.cgi?id=159071 5 6 Reviewed by Brady Eidson. 7 8 * http/tests/xmlhttprequest/sync-delegate-callbacks-expected.txt: Added. 9 * http/tests/xmlhttprequest/sync-delegate-callbacks.html: Added. 10 * platform/ios-simulator-wk2/TestExpectations: 11 * platform/mac/TestExpectations: 12 * platform/wk2/http/tests/xmlhttprequest/sync-delegate-callbacks-expected.txt: Added. 13 1 14 2016-06-27 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations
r202412 r202511 1837 1837 webkit.org/b/148709 fast/events/wheelevent-mousewheel-interaction.html [ Skip ] 1838 1838 1839 # NSURLConnection doesn't allow us to clear the TLS session cache. This is flaky on iOS9. 1840 http/tests/xmlhttprequest/sync-delegate-callbacks.html [ Pass Failure ] 1841 1839 1842 # Flaky tests that need bugs 1840 1843 fast/dom/Window/post-message-crash.html [ Pass Failure ] -
trunk/LayoutTests/platform/mac/TestExpectations
r202496 r202511 703 703 # Always very slow, frequently timing out (only on bots, not locally). 704 704 webkit.org/b/121331 [ Yosemite ElCapitan ] http/tests/misc/submit-post-keygen.html [ Pass Failure Timeout ] 705 706 # NSURLConnection doesn't allow us to clear the TLS session cache. 707 [ Yosemite ElCapitan ] http/tests/xmlhttprequest/sync-delegate-callbacks.html [ Pass Failure ] 705 708 706 709 # <rdar://problem/26701829> com.apple.WebKit.WebContent.Development crashed in com.apple.security: Security::Mutex::unlock + 9 -
trunk/Source/WebKit2/ChangeLog
r202504 r202511 1 2016-06-27 Alex Christensen <achristensen@webkit.org> 2 3 Send canAuthenticateAgainstProtectionSpace calls from NetworkProcess directly to UIProcess 4 https://bugs.webkit.org/show_bug.cgi?id=159071 5 6 Reviewed by Brady Eidson. 7 8 When CFNetwork asks the NetworkProcess if we can authenticate against this protection space, we used to ask 9 the WebProcess, which would call ResourceLoader::canAuthenticateAgainstProtectionSpace which would ask the FrameLoaderClient, 10 which would synchronously ask the UIProcess. Going directly from the NetworkProcess to the UIProcess gives us many advantages: 11 1. It reduces IPC because we ask fewer loads. 12 2. It reduces synchronous IPC because we are not using the same code path as WebKit1 any more. 13 3. It allows us to check if the NetworkProcess is still valid in sendToNetworkingProcess, possibly fixing rdar://problem/26825408 14 4. It allows us to ask the UIProcess when we get authentication challenges for synchronous xhr. 15 16 I added a new test http/tests/xmlhttprequest/sync-delegate-callbacks.html to verify the change in behavior of synchronous xhr. 17 In order to make this test not flaky on platforms using NSURLSession, we clear the NSURLSessions used by WebKitTestRunner 18 to make sure that the TLS session cache is cleared so we get NSURLAuthenticationChallenges corresponding to the NSURLConnection 19 canAuthenticateAgainstProtectionSpace callback when we initiate the first HTTPS connection to 127.0.0.1 with this session. 20 21 * NetworkProcess/NetworkLoad.cpp: 22 (WebKit::NetworkLoad::didReceiveChallenge): 23 (WebKit::NetworkLoad::didReceiveResponseNetworkSession): 24 (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): 25 * NetworkProcess/NetworkProcess.cpp: 26 (WebKit::NetworkProcess::clearCachedCredentials): 27 (WebKit::NetworkProcess::ensurePrivateBrowsingSession): 28 (WebKit::NetworkProcess::cancelDownload): 29 (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): 30 (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): 31 (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): 32 * NetworkProcess/NetworkProcess.h: 33 * NetworkProcess/NetworkProcess.messages.in: 34 * NetworkProcess/NetworkResourceLoader.cpp: 35 (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): 36 * NetworkProcess/NetworkResourceLoader.h: 37 * NetworkProcess/NetworkResourceLoader.messages.in: 38 * NetworkProcess/NetworkSession.h: 39 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 40 (WebKit::NetworkSession::networkStorageSession): 41 (WebKit::NetworkSession::clearCredentials): 42 (WebKit::NetworkSession::dataTaskForIdentifier): 43 * UIProcess/Downloads/DownloadProxy.cpp: 44 (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): 45 (WebKit::DownloadProxy::willSendRequest): 46 * UIProcess/Network/NetworkProcessProxy.cpp: 47 (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue): 48 (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): 49 (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): 50 * UIProcess/Network/NetworkProcessProxy.h: 51 * UIProcess/Network/NetworkProcessProxy.messages.in: 52 * UIProcess/WebPageProxy.cpp: 53 (WebKit::WebPageProxy::backForwardClear): 54 (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace): 55 (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): 56 (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame): Deleted. 57 * UIProcess/WebPageProxy.h: 58 * UIProcess/WebPageProxy.messages.in: 59 * WebProcess/Network/WebResourceLoader.cpp: 60 (WebKit::WebResourceLoader::didReceiveResource): 61 (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed): 62 (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Deleted. 63 * WebProcess/Network/WebResourceLoader.h: 64 * WebProcess/Network/WebResourceLoader.messages.in: 65 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 66 (WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace): 67 * WebProcess/WebProcess.cpp: 68 (WebKit::WebProcess::clearCachedCredentials): 69 (WebKit::WebProcess::focusedWebPage): 70 1 71 2016-06-27 Anders Carlsson <andersca@apple.com> 2 72 -
trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp
r202410 r202511 231 231 m_challenge = challenge; 232 232 233 if (m_client.isSynchronous()) { 234 // FIXME: We should ask the WebProcess like the asynchronous case below does. 235 // This is currently impossible as the WebProcess is blocked waiting on this synchronous load. 236 // It's possible that we can jump straight to the UI process to resolve this. 237 continueCanAuthenticateAgainstProtectionSpace(true); 238 return; 239 } else 240 m_client.canAuthenticateAgainstProtectionSpaceAsync(challenge.protectionSpace()); 233 m_client.canAuthenticateAgainstProtectionSpaceAsync(challenge.protectionSpace()); 241 234 } 242 235 … … 339 332 && !NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation()) { 340 333 continueCanAuthenticateAgainstProtectionSpace(false); 341 return;342 }343 344 if (m_client.isSynchronous()) {345 // FIXME: We should ask the WebProcess like the asynchronous case below does.346 // This is currently impossible as the WebProcess is blocked waiting on this synchronous load.347 // It's possible that we can jump straight to the UI process to resolve this.348 continueCanAuthenticateAgainstProtectionSpace(true);349 334 return; 350 335 } -
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
r202439 r202511 45 45 #include "WebCookieManager.h" 46 46 #include "WebCoreArgumentCoders.h" 47 #include "WebPageProxyMessages.h" 47 48 #include "WebProcessPoolMessages.h" 48 49 #include "WebsiteData.h" … … 279 280 { 280 281 NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials(); 281 #if USE(NETWORK_SESSION) && !USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION)282 #if USE(NETWORK_SESSION) 282 283 NetworkSession::defaultSession().clearCredentials(); 283 284 #endif … … 481 482 } 482 483 484 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 485 void NetworkProcess::canAuthenticateAgainstProtectionSpace(NetworkResourceLoader& loader, const WebCore::ProtectionSpace& protectionSpace) 486 { 487 static uint64_t lastLoaderID = 0; 488 uint64_t loaderID = ++lastLoaderID; 489 m_waitingNetworkResourceLoaders.set(lastLoaderID, loader); 490 parentProcessConnection()->send(Messages::NetworkProcessProxy::CanAuthenticateAgainstProtectionSpace(loaderID, loader.pageID(), loader.frameID(), protectionSpace), 0); 491 } 492 493 void NetworkProcess::continueCanAuthenticateAgainstProtectionSpace(uint64_t loaderID, bool canAuthenticate) 494 { 495 m_waitingNetworkResourceLoaders.take(loaderID).value()->continueCanAuthenticateAgainstProtectionSpace(canAuthenticate); 496 } 497 #endif 498 483 499 #if USE(NETWORK_SESSION) 484 void NetworkProcess::continueCanAuthenticateAgainstProtectionSpace (DownloadID downloadID, bool canAuthenticate)500 void NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload(DownloadID downloadID, bool canAuthenticate) 485 501 { 486 502 downloadManager().continueCanAuthenticateAgainstProtectionSpace(downloadID, canAuthenticate); -
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h
r202439 r202511 24 24 */ 25 25 26 #ifndef NetworkProcess_h 27 #define NetworkProcess_h 26 #pragma once 28 27 29 28 #include "CacheModel.h" … … 48 47 class CertificateInfo; 49 48 class NetworkStorageSession; 49 class ProtectionSpace; 50 50 class SecurityOrigin; 51 51 class SessionID; … … 57 57 class NetworkConnectionToWebProcess; 58 58 class NetworkProcessSupplement; 59 class NetworkResourceLoader; 59 60 enum class WebsiteDataFetchOption; 60 61 enum class WebsiteDataType; … … 109 110 void findPendingDownloadLocation(NetworkDataTask&, ResponseCompletionHandler&&, const WebCore::ResourceRequest&); 110 111 #endif 111 112 113 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 114 void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader&, const WebCore::ProtectionSpace&); 115 #endif 116 112 117 void prefetchDNS(const String&); 113 118 … … 171 176 void resumeDownload(WebCore::SessionID, DownloadID, const IPC::DataReference& resumeData, const String& path, const SandboxExtension::Handle&); 172 177 void cancelDownload(DownloadID); 178 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 179 void continueCanAuthenticateAgainstProtectionSpace(uint64_t resourceLoadIdentifier, bool canAuthenticate); 180 #endif 173 181 #if USE(NETWORK_SESSION) 174 void continueCanAuthenticateAgainstProtectionSpace (DownloadID, bool canAuthenticate);182 void continueCanAuthenticateAgainstProtectionSpaceDownload(DownloadID, bool canAuthenticate); 175 183 void continueWillSendRequest(DownloadID, WebCore::ResourceRequest&&); 176 184 void continueDecidePendingDownloadDestination(DownloadID, String destination, const SandboxExtension::Handle& sandboxExtensionHandle, bool allowOverwrite); … … 207 215 208 216 HashMap<uint64_t, Function<void ()>> m_sandboxExtensionForBlobsCompletionHandlers; 217 HashMap<uint64_t, Ref<NetworkResourceLoader>> m_waitingNetworkResourceLoaders; 209 218 210 219 #if PLATFORM(COCOA) … … 223 232 224 233 } // namespace WebKit 225 226 #endif // NetworkProcess_h -
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
r199230 r202511 45 45 ResumeDownload(WebCore::SessionID sessionID, WebKit::DownloadID downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 46 46 CancelDownload(WebKit::DownloadID downloadID) 47 48 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 49 ContinueCanAuthenticateAgainstProtectionSpace(uint64_t loaderID, bool canAuthenticate) 50 #endif 47 51 #if USE(NETWORK_SESSION) 48 ContinueCanAuthenticateAgainstProtectionSpace (WebKit::DownloadID downloadID, bool canAuthenticate)52 ContinueCanAuthenticateAgainstProtectionSpaceDownload(WebKit::DownloadID downloadID, bool canAuthenticate) 49 53 ContinueWillSendRequest(WebKit::DownloadID downloadID, WebCore::ResourceRequest request) 50 54 ContinueDecidePendingDownloadDestination(WebKit::DownloadID downloadID, String destination, WebKit::SandboxExtension::Handle sandboxExtensionHandle, bool allowOverwrite) -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
r202154 r202511 33 33 #include "NetworkConnectionToWebProcess.h" 34 34 #include "NetworkLoad.h" 35 #include "NetworkProcess.h" 35 36 #include "NetworkProcessConnectionMessages.h" 36 37 #include "WebCoreArgumentCoders.h" … … 633 634 { 634 635 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 635 sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace));636 NetworkProcess::singleton().canAuthenticateAgainstProtectionSpace(*this, protectionSpace); 636 637 #else 637 638 UNUSED_PARAM(protectionSpace); -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h
r201943 r202511 81 81 WebCore::SessionID sessionID() const { return m_parameters.sessionID; } 82 82 ResourceLoadIdentifier identifier() const { return m_parameters.identifier; } 83 uint64_t frameID() const { return m_parameters.webFrameID; } 84 uint64_t pageID() const { return m_parameters.webPageID; } 83 85 84 86 struct SynchronousLoadData; -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.messages.in
r192697 r202511 25 25 ContinueWillSendRequest(WebCore::ResourceRequest request) 26 26 ContinueDidReceiveResponse() 27 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)28 ContinueCanAuthenticateAgainstProtectionSpace(bool canAuthenticate)29 #endif30 27 } -
trunk/Source/WebKit2/NetworkProcess/NetworkSession.h
r198457 r202511 70 70 #endif 71 71 72 #if !USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION)73 72 void clearCredentials(); 74 #endif75 73 76 74 NetworkDataTask* dataTaskForIdentifier(NetworkDataTask::TaskIdentifier, WebCore::StoredCredentials); -
trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r202184 r202511 414 414 } 415 415 416 #if !USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION)417 416 void NetworkSession::clearCredentials() 418 417 { … … 421 420 ASSERT(m_downloadMap.isEmpty()); 422 421 m_sessionWithCredentialStorage = [NSURLSession sessionWithConfiguration:m_sessionWithCredentialStorage.get().configuration delegate:static_cast<id>(m_sessionWithCredentialStorageDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 423 } 424 #endif 422 m_sessionWithoutCredentialStorage = [NSURLSession sessionWithConfiguration:m_sessionWithoutCredentialStorage.get().configuration delegate:static_cast<id>(m_sessionWithoutCredentialStorageDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 423 } 425 424 426 425 NetworkDataTask* NetworkSession::dataTaskForIdentifier(NetworkDataTask::TaskIdentifier taskIdentifier, WebCore::StoredCredentials storedCredentials) -
trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
r198893 r202511 125 125 bool result = m_processPool->downloadClient().canAuthenticateAgainstProtectionSpace(getPtr(WebProtectionSpace::create(protectionSpace))); 126 126 127 networkProcessProxy->connection()->send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace (m_downloadID, result), 0);127 networkProcessProxy->connection()->send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpaceDownload(m_downloadID, result), 0); 128 128 } 129 129 -
trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
r202331 r202511 351 351 } 352 352 353 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 354 void NetworkProcessProxy::canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, const WebCore::ProtectionSpace& protectionSpace) 355 { 356 WebPageProxy* page = WebProcessProxy::webPage(pageID); 357 if (!page) 358 return; 359 360 page->canAuthenticateAgainstProtectionSpace(loaderID, frameID, protectionSpace); 361 } 362 #endif 363 353 364 void NetworkProcessProxy::sendProcessWillSuspendImminently() 354 365 { -
trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
r199230 r202511 38 38 namespace WebCore { 39 39 class AuthenticationChallenge; 40 class ProtectionSpace; 40 41 class ResourceRequest; 41 42 class SecurityOrigin; … … 111 112 void logSampledDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result); 112 113 void logSampledDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, const String& value); 114 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 115 void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, const WebCore::ProtectionSpace&); 116 #endif 113 117 114 118 // ProcessLauncher::Client -
trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in
r199230 r202511 39 39 LogSampledDiagnosticMessageWithResult(uint64_t pageID, String message, String description, uint32_t result) 40 40 LogSampledDiagnosticMessageWithValue(uint64_t pageID, String message, String description, String value) 41 42 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 43 CanAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, WebCore::ProtectionSpace protectionSpace) 44 #endif 41 45 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r202455 r202511 5377 5377 } 5378 5378 5379 void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate) 5380 { 5379 void WebPageProxy::canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const ProtectionSpace& coreProtectionSpace) 5380 { 5381 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 5381 5382 WebFrameProxy* frame = m_process->webFrame(frameID); 5382 5383 MESSAGE_CHECK(frame); … … 5384 5385 RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace); 5385 5386 5387 bool canAuthenticate; 5386 5388 if (m_navigationClient) 5387 5389 canAuthenticate = m_navigationClient->canAuthenticateAgainstProtectionSpace(*this, protectionSpace.get()); 5388 5390 else 5389 5391 canAuthenticate = m_loaderClient->canAuthenticateAgainstProtectionSpaceInFrame(*this, *frame, protectionSpace.get()); 5392 5393 m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace(loaderID, canAuthenticate)); 5394 #endif 5390 5395 } 5391 5396 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r202444 r202511 1117 1117 bool isAlwaysOnLoggingAllowed() const; 1118 1118 1119 void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const WebCore::ProtectionSpace&); 1120 1119 1121 private: 1120 1122 WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&); … … 1393 1395 void frameSetLargestFrameChanged(uint64_t frameID); 1394 1396 1395 void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);1396 1397 void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID); 1397 1398 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r201888 r202511 254 254 255 255 # Authentication messages 256 CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)257 256 DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID) 258 257 -
trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
r202119 r202511 212 212 #endif 213 213 214 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)215 void WebResourceLoader::canAuthenticateAgainstProtectionSpace(const ProtectionSpace& protectionSpace)216 {217 if (!m_coreLoader)218 return;219 220 bool result = m_coreLoader->canAuthenticateAgainstProtectionSpace(protectionSpace);221 222 send(Messages::NetworkResourceLoader::ContinueCanAuthenticateAgainstProtectionSpace(result));223 }224 #endif225 226 214 bool WebResourceLoader::isAlwaysOnLoggingAllowed() const 227 215 { -
trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h
r201708 r202511 86 86 #endif 87 87 88 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)89 void canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace&);90 #endif91 92 88 RefPtr<WebCore::ResourceLoader> m_coreLoader; 93 89 }; -
trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.messages.in
r192697 r202511 29 29 DidFailResourceLoad(WebCore::ResourceError error) 30 30 31 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)32 CanAuthenticateAgainstProtectionSpace(WebCore::ProtectionSpace protectionSpace)33 #endif34 35 31 #if ENABLE(SHAREABLE_RESOURCE) 36 32 // DidReceiveResource is for when we have the entire resource data available at once, such as when the resource is cached in memory -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r202410 r202511 200 200 bool WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long, const ProtectionSpace& protectionSpace) 201 201 { 202 // FIXME: Authentication is a per-resource concept, but we don't do per-resource handling in the UIProcess at the API level quite yet. 203 // Once we do, we might need to make sure authentication fits with our solution. 204 205 WebPage* webPage = m_frame->page(); 206 if (!webPage) 207 return false; 208 209 bool canAuthenticate; 210 if (!webPage->sendSync(Messages::WebPageProxy::CanAuthenticateAgainstProtectionSpaceInFrame(m_frame->frameID(), protectionSpace), Messages::WebPageProxy::CanAuthenticateAgainstProtectionSpaceInFrame::Reply(canAuthenticate))) 211 return false; 212 213 return canAuthenticate; 202 // The WebKit 2 Networking process asks the UIProcess directly, so the WebContent process should never receive this callback. 203 ASSERT_NOT_REACHED(); 204 return false; 214 205 } 215 206 #endif -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r200819 r202511 537 537 { 538 538 NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials(); 539 #if USE(NETWORK_SESSION) && !USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION)539 #if USE(NETWORK_SESSION) 540 540 NetworkSession::defaultSession().clearCredentials(); 541 541 #endif -
trunk/Tools/ChangeLog
r202481 r202511 1 2016-06-27 Alex Christensen <achristensen@webkit.org> 2 3 Send canAuthenticateAgainstProtectionSpace calls from NetworkProcess directly to UIProcess 4 https://bugs.webkit.org/show_bug.cgi?id=159071 5 6 Reviewed by Brady Eidson. 7 8 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 9 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 10 (WTR::TestRunner::setHandlesAuthenticationChallenges): 11 (WTR::TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace): 12 (WTR::TestRunner::setAuthenticationUsername): 13 * WebKitTestRunner/InjectedBundle/TestRunner.h: 14 * WebKitTestRunner/TestController.cpp: 15 (WTR::TestController::TestController): 16 (WTR::TestController::resetStateToConsistentValues): 17 (WTR::TestController::didFinishNavigation): 18 (WTR::TestController::canAuthenticateAgainstProtectionSpace): 19 (WTR::TestController::didReceiveAuthenticationChallenge): 20 (WTR::TestController::didCommitNavigation): 21 * WebKitTestRunner/TestController.h: 22 (WTR::TestController::setBlockAllPlugins): 23 (WTR::TestController::setShouldLogHistoryClientCallbacks): 24 (WTR::TestController::setShouldLogCanAuthenticateAgainstProtectionSpace): 25 (WTR::TestController::isCurrentInvocation): 26 * WebKitTestRunner/TestInvocation.cpp: 27 (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): 28 Added output so we can see when canAuthenticateAgainstProtectionSpace is called from the test expectations. 29 1 30 2016-06-27 Per Arne Vollan <pvollan@apple.com> 2 31 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r201404 r202511 200 200 // Authentication 201 201 void setHandlesAuthenticationChallenges(boolean value); 202 void setShouldLogCanAuthenticateAgainstProtectionSpace(boolean value); 202 203 void setAuthenticationUsername(DOMString username); 203 204 void setAuthenticationPassword(DOMString password); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r201404 r202511 908 908 } 909 909 910 void TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace(bool value) 911 { 912 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldLogCanAuthenticateAgainstProtectionSpace")); 913 WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value)); 914 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 915 } 916 910 917 void TestRunner::setAuthenticationUsername(JSStringRef username) 911 918 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r201404 r202511 165 165 // Authentication 166 166 void setHandlesAuthenticationChallenges(bool); 167 void setShouldLogCanAuthenticateAgainstProtectionSpace(bool); 167 168 void setAuthenticationUsername(JSStringRef); 168 169 void setAuthenticationPassword(JSStringRef); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r201904 r202511 120 120 121 121 TestController::TestController(int argc, const char* argv[]) 122 : m_verbose(false)123 , m_printSeparators(false)124 , m_usingServerMode(false)125 , m_gcBetweenTests(false)126 , m_shouldDumpPixelsForAllTests(false)127 , m_state(Initial)128 , m_doneResetting(false)129 , m_useWaitToDumpWatchdogTimer(true)130 , m_forceNoTimeout(false)131 , m_didPrintWebProcessCrashedMessage(false)132 , m_shouldExitWhenWebProcessCrashes(true)133 , m_beforeUnloadReturnValue(true)134 , m_isGeolocationPermissionSet(false)135 , m_isGeolocationPermissionAllowed(false)136 , m_policyDelegateEnabled(false)137 , m_policyDelegatePermissive(false)138 , m_handlesAuthenticationChallenges(false)139 , m_shouldBlockAllPlugins(false)140 , m_forceComplexText(false)141 , m_shouldUseAcceleratedDrawing(false)142 , m_shouldUseRemoteLayerTree(false)143 , m_shouldLogHistoryClientCallbacks(false)144 , m_shouldShowWebView(false)145 122 { 146 123 initialize(argc, argv); … … 796 773 797 774 m_shouldLogHistoryClientCallbacks = false; 775 m_shouldLogCanAuthenticateAgainstProtectionSpace = false; 798 776 799 777 setHidden(false); … … 1522 1500 } 1523 1501 1524 bool TestController::canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef protectionSpace, const void*) 1525 { 1526 WKProtectionSpaceAuthenticationScheme authenticationScheme = WKProtectionSpaceGetAuthenticationScheme(protectionSpace); 1527 1528 if (authenticationScheme == kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) { 1529 std::string host = toSTD(adoptWK(WKProtectionSpaceCopyHost(protectionSpace)).get()); 1530 return host == "localhost" || host == "127.0.0.1"; 1531 } 1532 1533 return authenticationScheme <= kWKProtectionSpaceAuthenticationSchemeHTTPDigest; 1502 bool TestController::canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace, const void* clientInfo) 1503 { 1504 return static_cast<TestController*>(const_cast<void*>(clientInfo))->canAuthenticateAgainstProtectionSpace(page, protectionSpace); 1534 1505 } 1535 1506 … … 1594 1565 { 1595 1566 mainWebView()->focus(); 1567 } 1568 1569 bool TestController::canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace) 1570 { 1571 if (m_shouldLogCanAuthenticateAgainstProtectionSpace) 1572 m_currentInvocation->outputText("canAuthenticateAgainstProtectionSpace\n"); 1573 WKProtectionSpaceAuthenticationScheme authenticationScheme = WKProtectionSpaceGetAuthenticationScheme(protectionSpace); 1574 1575 if (authenticationScheme == kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) { 1576 std::string host = toSTD(adoptWK(WKProtectionSpaceCopyHost(protectionSpace)).get()); 1577 return host == "localhost" || host == "127.0.0.1"; 1578 } 1579 1580 return authenticationScheme <= kWKProtectionSpaceAuthenticationSchemeHTTPDigest; 1596 1581 } 1597 1582 -
trunk/Tools/WebKitTestRunner/TestController.h
r200945 r202511 133 133 134 134 void setShouldLogHistoryClientCallbacks(bool shouldLog) { m_shouldLogHistoryClientCallbacks = shouldLog; } 135 void setShouldLogCanAuthenticateAgainstProtectionSpace(bool shouldLog) { m_shouldLogCanAuthenticateAgainstProtectionSpace = shouldLog; } 135 136 136 137 bool isCurrentInvocation(TestInvocation* invocation) const { return invocation == m_currentInvocation.get(); } … … 240 241 static void unavailablePluginButtonClicked(WKPageRef, WKPluginUnavailabilityReason, WKDictionaryRef, const void*); 241 242 242 static bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef, const void *clientInfo); 243 244 static void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef, const void *clientInfo); 243 static bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef, const void*); 244 bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef); 245 246 static void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef, const void*); 245 247 void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef); 246 248 … … 274 276 std::unique_ptr<TestInvocation> m_currentInvocation; 275 277 276 bool m_verbose ;277 bool m_printSeparators ;278 bool m_usingServerMode ;279 bool m_gcBetweenTests ;280 bool m_shouldDumpPixelsForAllTests ;278 bool m_verbose { false }; 279 bool m_printSeparators { false }; 280 bool m_usingServerMode { false }; 281 bool m_gcBetweenTests { false }; 282 bool m_shouldDumpPixelsForAllTests { false }; 281 283 std::vector<std::string> m_paths; 282 284 std::vector<std::string> m_allowedHosts; … … 295 297 RunningTest 296 298 }; 297 State m_state ;298 bool m_doneResetting ;299 300 bool m_useWaitToDumpWatchdogTimer ;301 bool m_forceNoTimeout ;302 303 bool m_didPrintWebProcessCrashedMessage ;304 bool m_shouldExitWhenWebProcessCrashes ;305 306 bool m_beforeUnloadReturnValue ;299 State m_state { Initial }; 300 bool m_doneResetting { false }; 301 302 bool m_useWaitToDumpWatchdogTimer { true }; 303 bool m_forceNoTimeout { false }; 304 305 bool m_didPrintWebProcessCrashedMessage { false }; 306 bool m_shouldExitWhenWebProcessCrashes { true }; 307 308 bool m_beforeUnloadReturnValue { true }; 307 309 308 310 std::unique_ptr<GeolocationProviderMock> m_geolocationProvider; 309 311 Vector<WKRetainPtr<WKGeolocationPermissionRequestRef> > m_geolocationPermissionRequests; 310 bool m_isGeolocationPermissionSet ;311 bool m_isGeolocationPermissionAllowed ;312 bool m_isGeolocationPermissionSet { false }; 313 bool m_isGeolocationPermissionAllowed { false }; 312 314 313 315 HashMap<String, RefPtr<OriginSettings>> m_cahcedUserMediaPermissions; … … 316 318 PermissionRequestList m_userMediaPermissionRequests; 317 319 318 bool m_isUserMediaPermissionSet ;319 bool m_isUserMediaPermissionAllowed ;320 321 bool m_policyDelegateEnabled ;322 bool m_policyDelegatePermissive ;323 324 bool m_handlesAuthenticationChallenges ;320 bool m_isUserMediaPermissionSet { false }; 321 bool m_isUserMediaPermissionAllowed { false }; 322 323 bool m_policyDelegateEnabled { false }; 324 bool m_policyDelegatePermissive { false }; 325 326 bool m_handlesAuthenticationChallenges { false }; 325 327 String m_authenticationUsername; 326 328 String m_authenticationPassword; 327 329 328 bool m_shouldBlockAllPlugins; 329 330 bool m_forceComplexText; 331 bool m_shouldUseAcceleratedDrawing; 332 bool m_shouldUseRemoteLayerTree; 333 334 bool m_shouldLogHistoryClientCallbacks; 335 bool m_shouldShowWebView; 336 330 bool m_shouldBlockAllPlugins { false }; 331 332 bool m_forceComplexText { false }; 333 bool m_shouldUseAcceleratedDrawing { false }; 334 bool m_shouldUseRemoteLayerTree { false }; 335 336 bool m_shouldLogCanAuthenticateAgainstProtectionSpace { false }; 337 bool m_shouldLogHistoryClientCallbacks { false }; 338 bool m_shouldShowWebView { false }; 339 337 340 bool m_shouldDecideNavigationPolicyAfterDelay { false }; 338 341 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r202226 r202511 607 607 } 608 608 609 if (WKStringIsEqualToUTF8CString(messageName, "SetShouldLogCanAuthenticateAgainstProtectionSpace")) { 610 ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID()); 611 WKBooleanRef value = static_cast<WKBooleanRef>(messageBody); 612 TestController::singleton().setShouldLogCanAuthenticateAgainstProtectionSpace(WKBooleanGetValue(value)); 613 return; 614 } 615 609 616 if (WKStringIsEqualToUTF8CString(messageName, "SetAuthenticationUsername")) { 610 617 ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
Note: See TracChangeset
for help on using the changeset viewer.