Changeset 249063 in webkit


Ignore:
Timestamp:
Aug 23, 2019 1:23:21 PM (5 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r249001.

Caused one layout test to fail on all configurations and
another to time out on Catalina / iOS 13.

Reverted changeset:

"Add a WebsiteDataStore delegate to handle
AuthenticationChallenge that do not come from pages"
https://bugs.webkit.org/show_bug.cgi?id=196870
https://trac.webkit.org/changeset/249001

Location:
trunk
Files:
5 deleted
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249060 r249063  
     12019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r249001.
     4
     5        Caused one layout test to fail on all configurations and
     6        another to time out on Catalina / iOS 13.
     7
     8        Reverted changeset:
     9
     10        "Add a WebsiteDataStore delegate to handle
     11        AuthenticationChallenge that do not come from pages"
     12        https://bugs.webkit.org/show_bug.cgi?id=196870
     13        https://trac.webkit.org/changeset/249001
     14
    1152019-08-23  Antoine Quint  <graouts@apple.com>
    216
  • trunk/LayoutTests/http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight-expected.txt

    r249001 r249063  
    11
    2 PASS Beacon load should not be sent if server is not trusted.
    32PASS Should send beacon with no CORS preflight
    43
  • trunk/LayoutTests/http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html

    r249001 r249063  
    2727}
    2828
    29 function testCORSPreflight(what) {
    30   var testBase = get_host_info().HTTPS_REMOTE_ORIGIN + RESOURCES_DIR;
     29function testCORSPreflightSuccess(what) {
     30  var testBase = get_host_info().HTTP_REMOTE_ORIGIN + RESOURCES_DIR;
     31  var id = self.token();
     32  var testUrl = testBase + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
    3133
    32   promise_test(async function(test) {
    33     var id = "ca33c073-1cf0-41e5-bbd4-55969fb1a6c7";
    34     var testUrl = testBase + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
    35     if (window.testRunner) {
    36       window.testRunner.setAllowsAnySSLCertificate(false);
    37       window.testRunner.terminateNetworkProcess();
    38       await fetch("").then(() => { }, () => { });
    39     }
    40 
    41     assert_true(navigator.sendBeacon(testUrl, what), "sendBeacon succeeded");
    42     const result = await pollResult(test, id);
    43     assert_equals(result['preflight'], 0, "Did not receive CORS preflight")
    44     assert_equals(result['beacon'], 0, "Did not receive beacon")
    45   }, "Beacon load should not be sent if server is not trusted.");
    46 
    47   promise_test(async function(test) {
    48     var id = self.token();
    49     var testUrl = testBase + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
    50     if (window.testRunner) {
    51       window.testRunner.setAllowsAnySSLCertificate(true);
    52       window.testRunner.terminateNetworkProcess();
    53       await fetch("").then(() => { }, () => { });
    54     }
    55 
     34  promise_test(function(test) {
    5635    assert_true(navigator.sendBeacon(testUrl, what), "SendBeacon Succeeded");
    5736    return pollResult(test, id) .then(result => {
     
    7352}
    7453
    75 testCORSPreflight(stringToArrayBufferView("123"));
     54testCORSPreflightSuccess(stringToArrayBufferView("123"));
    7655    </script>
    7756  </body>
  • trunk/LayoutTests/http/wpt/beacon/resources/beacon-preflight.py

    r249001 r249063  
    4545      request.server.stash.put(test_id, stashed_data)
    4646    return [("Content-Type", "text/plain")], ""
    47 
     47 
    4848  if command == "get":
    49     return [("Content-Type", "text/plain")], json.dumps(stashed_data)
     49    if stashed_data is not None:
     50      return [("Content-Type", "text/plain")], json.dumps(stashed_data)
     51    return [("Content-Type", "text/plain")], ""
    5052
    5153  response.set_error(400, "Bad Command")
  • trunk/LayoutTests/http/wpt/service-workers/resources/lengthy-pass.py

    r249001 r249063  
    44    delay = 0.05
    55    response.headers.set("Content-type", "text/javascript")
    6     response.headers.append("Access-Control-Allow-Origin", "*")
    76    response.write_status_headers()
    87    time.sleep(delay);
  • trunk/Source/WebKit/ChangeLog

    r249062 r249063  
     12019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r249001.
     4
     5        Caused one layout test to fail on all configurations and
     6        another to time out on Catalina / iOS 13.
     7
     8        Reverted changeset:
     9
     10        "Add a WebsiteDataStore delegate to handle
     11        AuthenticationChallenge that do not come from pages"
     12        https://bugs.webkit.org/show_bug.cgi?id=196870
     13        https://trac.webkit.org/changeset/249001
     14
    1152019-08-23  Brian Burg  <bburg@apple.com>
    216
  • trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp

    r249001 r249063  
    102102    }
    103103
    104     m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_parameters.sessionID, m_parameters.pageID, m_parameters.frameID, challenge, WTFMove(completionHandler));
     104    m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_parameters.pageID, m_parameters.frameID, challenge, WTFMove(completionHandler));
    105105}
    106106
  • trunk/Source/WebKit/NetworkProcess/NetworkDataTask.cpp

    r249001 r249063  
    151151}
    152152
    153 PAL::SessionID NetworkDataTask::sessionID() const
    154 {
    155     return m_session->sessionID();
    156 }
    157 
    158153} // namespace WebKit
  • trunk/Source/WebKit/NetworkProcess/NetworkDataTask.h

    r249001 r249063  
    3535#include <WebCore/StoredCredentialsPolicy.h>
    3636#include <WebCore/Timer.h>
    37 #include <pal/SessionID.h>
    3837#include <wtf/CompletionHandler.h>
    3938#include <wtf/ThreadSafeRefCounted.h>
     
    132131    virtual String description() const;
    133132
    134     PAL::SessionID sessionID() const;
    135 
    136133protected:
    137134    NetworkDataTask(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, WebCore::StoredCredentialsPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation);
  • trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp

    r249001 r249063  
    202202        m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, challenge, WTFMove(completionHandler));
    203203    else
    204         m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_task->sessionID(), m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
     204        m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
    205205}
    206206
  • trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h

    r249001 r249063  
    8585#endif
    8686
    87     NetworkProcess& networkProcess() { return m_networkProcess; }
    88 
    8987    const URL& url() const { return m_url; }
    9088    WebCore::StoredCredentialsPolicy storedCredentialsPolicy() const { return m_storedCredentialsPolicy; }
  • trunk/Source/WebKit/NetworkProcess/PingLoad.cpp

    r249001 r249063  
    149149    RELEASE_LOG_IF_ALLOWED("didReceiveChallenge");
    150150    if (challenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
    151         m_networkLoadChecker->networkProcess().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.sessionID, m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
     151        completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, { });
    152152        return;
    153153    }
  • trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp

    r249001 r249063  
    109109}
    110110
    111 void AuthenticationManager::didReceiveAuthenticationChallenge(PAL::SessionID sessionID, PageIdentifier pageID, FrameIdentifier frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
     111void AuthenticationManager::didReceiveAuthenticationChallenge(PageIdentifier pageID, FrameIdentifier frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
    112112{
    113113    ASSERT(pageID);
     
    120120        return;
    121121   
    122     m_process.send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(sessionID, pageID, frameID, authenticationChallenge, challengeID));
     122    m_process.send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(pageID, frameID, authenticationChallenge, challengeID));
    123123}
    124124
  • trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h

    r249001 r249063  
    6464    static const char* supplementName();
    6565
    66     void didReceiveAuthenticationChallenge(PAL::SessionID, WebCore::PageIdentifier, WebCore::FrameIdentifier, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
     66    void didReceiveAuthenticationChallenge(WebCore::PageIdentifier, WebCore::FrameIdentifier, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
    6767    void didReceiveAuthenticationChallenge(IPC::MessageSender& download, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
    6868
  • trunk/Source/WebKit/SourcesCocoa.txt

    r249059 r249063  
    134134Shared/cg/ShareableBitmapCG.cpp
    135135
    136 Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm
    137136Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm
    138137Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm

    r249001 r249063  
    2828
    2929#import "APIString.h"
    30 #import "AuthenticationChallengeDispositionCocoa.h"
    3130#import "CompletionHandlerCallChecker.h"
    3231#import "WKHTTPCookieStoreInternal.h"
    3332#import "WKNSArray.h"
    34 #import "WKNSURLAuthenticationChallenge.h"
    3533#import "WKWebViewInternal.h"
    3634#import "WKWebsiteDataRecordInternal.h"
     
    4139#import "_WKWebsiteDataStoreConfiguration.h"
    4240#import "_WKWebsiteDataStoreDelegate.h"
    43 #import <WebCore/Credential.h>
    4441#import <WebKit/ServiceWorkerProcessProxy.h>
    4542#import <wtf/BlockPtr.h>
     
    5249        : m_delegate(delegate)
    5350        , m_hasRequestStorageSpaceSelector([m_delegate.get() respondsToSelector:@selector(requestStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:)])
    54         , m_hasAuthenticationChallengeSelector([m_delegate.get() respondsToSelector:@selector(didReceiveAuthenticationChallenge: completionHandler:)])
    5551    {
    5652    }
     
    7874    }
    7975
    80     void didReceiveAuthenticationChallenge(Ref<WebKit::AuthenticationChallengeProxy>&& challenge) final
    81     {
    82         if (!m_hasAuthenticationChallengeSelector || !m_delegate) {
    83             challenge->listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling);
    84             return;
    85         }
    86 
    87         auto nsURLChallenge = wrapper(challenge);
    88         auto checker = WebKit::CompletionHandlerCallChecker::create(m_delegate.getAutoreleased(), @selector(didReceiveAuthenticationChallenge: completionHandler:));
    89         auto completionHandler = makeBlockPtr([challenge = WTFMove(challenge), checker = WTFMove(checker)](NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential) mutable {
    90             if (checker->completionHandlerHasBeenCalled())
    91                 return;
    92             checker->didCallCompletionHandler();
    93             challenge->listener().completeChallenge(WebKit::toAuthenticationChallengeDisposition(disposition), WebCore::Credential(credential));
    94         });
    95 
    96         [m_delegate.getAutoreleased() didReceiveAuthenticationChallenge:nsURLChallenge completionHandler:completionHandler.get()];
    97     }
    98 
    9976    WeakObjCPtr<id <_WKWebsiteDataStoreDelegate> > m_delegate;
    10077    bool m_hasRequestStorageSpaceSelector { false };
    101     bool m_hasAuthenticationChallengeSelector { false };
    10278};
    10379
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h

    r249001 r249063  
    3535- (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler;
    3636
    37 - (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
    38 
    3937@end
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r249001 r249063  
    3636#import "APIWebsiteDataStore.h"
    3737#import "AuthenticationChallengeDisposition.h"
    38 #import "AuthenticationChallengeDispositionCocoa.h"
    3938#import "AuthenticationDecisionListener.h"
    4039#import "CompletionHandlerCallChecker.h"
     
    961960}
    962961
     962static AuthenticationChallengeDisposition toAuthenticationChallengeDisposition(NSURLSessionAuthChallengeDisposition disposition)
     963{
     964    switch (disposition) {
     965    case NSURLSessionAuthChallengeUseCredential:
     966        return AuthenticationChallengeDisposition::UseCredential;
     967    case NSURLSessionAuthChallengePerformDefaultHandling:
     968        return AuthenticationChallengeDisposition::PerformDefaultHandling;
     969    case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
     970        return AuthenticationChallengeDisposition::Cancel;
     971    case NSURLSessionAuthChallengeRejectProtectionSpace:
     972        return AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue;
     973    }
     974    [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
     975}
     976   
    963977void NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy& authenticationChallenge)
    964978{
     
    975989            return;
    976990        checker->didCallCompletionHandler();
    977         challenge->listener().completeChallenge(WebKit::toAuthenticationChallengeDisposition(disposition), Credential(credential));
     991        challenge->listener().completeChallenge(toAuthenticationChallengeDisposition(disposition), Credential(credential));
    978992    }).get()];
    979993}
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r249001 r249063  
    3838#include "NetworkProcessMessages.h"
    3939#include "SandboxExtension.h"
    40 #if HAVE(SEC_KEY_PROXY)
    41 #include "SecKeyProxyStore.h"
    42 #endif
    4340#include "ShouldGrandfatherStatistics.h"
    4441#include "StorageAccessStatus.h"
     
    316313}
    317314
    318 void NetworkProcessProxy::didReceiveAuthenticationChallenge(PAL::SessionID sessionID, PageIdentifier pageID, FrameIdentifier frameID, WebCore::AuthenticationChallenge&& coreChallenge, uint64_t challengeID)
    319 {
    320 #if HAVE(SEC_KEY_PROXY)
    321     WeakPtr<SecKeyProxyStore> secKeyProxyStore;
    322     if (coreChallenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
    323         if (auto* store = websiteDataStoreFromSessionID(sessionID)) {
    324             auto newSecKeyProxyStore = SecKeyProxyStore::create();
    325             secKeyProxyStore = makeWeakPtr(newSecKeyProxyStore.get());
    326             store->addSecKeyProxyStore(WTFMove(newSecKeyProxyStore));
    327         }
    328     }
    329     auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), WTFMove(secKeyProxyStore));
    330 #else
    331     auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), nullptr);
    332 #endif
    333 
    334     WebPageProxy* page = nullptr;
    335     if (pageID && !m_processPool.isServiceWorkerPageID(pageID))
    336         page = WebProcessProxy::webPage(pageID);
    337 
    338     if (!page) {
    339         auto* store = websiteDataStoreFromSessionID(sessionID);
    340         if (!store || coreChallenge.protectionSpace().authenticationScheme() != ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
    341             authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
    342             return;
    343         }
    344         store->client().didReceiveAuthenticationChallenge(WTFMove(authenticationChallenge));
    345         return;
    346     }
    347 
     315void NetworkProcessProxy::didReceiveAuthenticationChallenge(PageIdentifier pageID, FrameIdentifier frameID, WebCore::AuthenticationChallenge&& coreChallenge, uint64_t challengeID)
     316{
     317#if ENABLE(SERVICE_WORKER)
     318    if (auto* serviceWorkerProcessProxy = m_processPool.serviceWorkerProcessProxyFromPageID(pageID)) {
     319        auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), nullptr);
     320        serviceWorkerProcessProxy->didReceiveAuthenticationChallenge(pageID, frameID, WTFMove(authenticationChallenge));
     321        return;
     322    }
     323#endif
     324
     325    WebPageProxy* page = WebProcessProxy::webPage(pageID);
     326    MESSAGE_CHECK(page);
     327
     328    auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), page->secKeyProxyStore(coreChallenge));
    348329    page->didReceiveAuthenticationChallengeProxy(frameID, WTFMove(authenticationChallenge));
    349330}
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r249001 r249063  
    214214    void didReceiveNetworkProcessProxyMessage(IPC::Connection&, IPC::Decoder&);
    215215    void didCreateNetworkConnectionToWebProcess(const IPC::Attachment&);
    216     void didReceiveAuthenticationChallenge(PAL::SessionID, WebCore::PageIdentifier, WebCore::FrameIdentifier, WebCore::AuthenticationChallenge&&, uint64_t challengeID);
     216    void didReceiveAuthenticationChallenge(WebCore::PageIdentifier, WebCore::FrameIdentifier, WebCore::AuthenticationChallenge&&, uint64_t challengeID);
    217217    void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&);
    218218    void didDeleteWebsiteData(uint64_t callbackID);
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in

    r249001 r249063  
    2424    DidCreateNetworkConnectionToWebProcess(IPC::Attachment connectionIdentifier)
    2525
    26     DidReceiveAuthenticationChallenge(PAL::SessionID sessionID, WebCore::PageIdentifier pageID, WebCore::FrameIdentifier frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
     26    DidReceiveAuthenticationChallenge(WebCore::PageIdentifier pageID, WebCore::FrameIdentifier frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
    2727
    2828    DidFetchWebsiteData(uint64_t callbackID, struct WebKit::WebsiteData websiteData)
  • trunk/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp

    r249001 r249063  
    9191}
    9292
     93void ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge(PageIdentifier pageID, FrameIdentifier frameID, Ref<AuthenticationChallengeProxy>&& challenge)
     94{
     95    UNUSED_PARAM(pageID);
     96    UNUSED_PARAM(frameID);
     97
     98    // FIXME: Expose an API to delegate the actual decision to the application layer.
     99    auto& protectionSpace = challenge->core().protectionSpace();
     100    if (protectionSpace.authenticationScheme() == WebCore::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested && processPool().allowsAnySSLCertificateForServiceWorker()) {
     101        auto credential = WebCore::Credential("accept server trust"_s, emptyString(), WebCore::CredentialPersistenceNone);
     102        challenge->listener().completeChallenge(AuthenticationChallengeDisposition::UseCredential, credential);
     103        return;
     104    }
     105    notImplemented();
     106    challenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
     107}
     108
    93109} // namespace WebKit
    94110
  • trunk/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h

    r249001 r249063  
    4242    static bool hasRegisteredServiceWorkers(const String& serviceWorkerDirectory);
    4343
     44    void didReceiveAuthenticationChallenge(WebCore::PageIdentifier, WebCore::FrameIdentifier, Ref<AuthenticationChallengeProxy>&&);
     45
    4446    void start(const WebPreferencesStore&, Optional<PAL::SessionID> initialSessionID);
    4547    void setUserAgent(const String&);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r249001 r249063  
    73347334#endif
    73357335
     7336WeakPtr<SecKeyProxyStore> WebPageProxy::secKeyProxyStore(const WebCore::AuthenticationChallenge& challenge)
     7337{
     7338#if HAVE(SEC_KEY_PROXY)
     7339    if (challenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
     7340        auto secKeyProxyStore = SecKeyProxyStore::create();
     7341        auto weakPointer = makeWeakPtr(secKeyProxyStore.get());
     7342        m_websiteDataStore->addSecKeyProxyStore(WTFMove(secKeyProxyStore));
     7343        return weakPointer;
     7344    }
     7345#endif
     7346    return nullptr;
     7347}
     7348   
    73367349void WebPageProxy::didReceiveAuthenticationChallengeProxy(FrameIdentifier, Ref<AuthenticationChallengeProxy>&& authenticationChallenge)
    73377350{
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r249001 r249063  
    22322232}
    22332233
    2234 bool WebProcessPool::isServiceWorkerPageID(PageIdentifier pageID) const
    2235 {
    22362234#if ENABLE(SERVICE_WORKER)
     2235ServiceWorkerProcessProxy* WebProcessPool::serviceWorkerProcessProxyFromPageID(PageIdentifier pageID) const
     2236{
    22372237    // FIXME: This is inefficient.
    22382238    for (auto* serviceWorkerProcess : m_serviceWorkerProcesses.values()) {
    22392239        if (serviceWorkerProcess->pageID() == pageID)
    2240             return true;
    2241     }
    2242 #endif
    2243     return false;
    2244 }
     2240            return serviceWorkerProcess;
     2241    }
     2242    return nullptr;
     2243}
     2244#endif
    22452245
    22462246void WebProcessPool::addProcessToOriginCacheSet(WebProcessProxy& process, const URL& url)
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r249001 r249063  
    380380    void getNetworkProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&);
    381381
    382     bool isServiceWorkerPageID(WebCore::PageIdentifier) const;
    383382#if ENABLE(SERVICE_WORKER)
    384383    void establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy&, WebCore::RegistrableDomain&&, Optional<PAL::SessionID>);
     384    ServiceWorkerProcessProxy* serviceWorkerProcessProxyFromPageID(WebCore::PageIdentifier) const;
    385385    const HashMap<WebCore::RegistrableDomain, ServiceWorkerProcessProxy*>& serviceWorkerProxies() const { return m_serviceWorkerProcesses; }
    386386    void setAllowsAnySSLCertificateForServiceWorker(bool allows) { m_allowsAnySSLCertificateForServiceWorker = allows; }
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h

    r249001 r249063  
    2626#pragma once
    2727
    28 #include "AuthenticationChallengeDisposition.h"
    29 #include "AuthenticationChallengeProxy.h"
    30 #include "AuthenticationDecisionListener.h"
    3128#include <wtf/CompletionHandler.h>
    3229
     
    4643        completionHandler({ });
    4744    }
    48 
    49     virtual void didReceiveAuthenticationChallenge(Ref<AuthenticationChallengeProxy>&& challenge)
    50     {
    51         challenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
    52     }
    5345};
    5446
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r249059 r249063  
    31573157                41897ED61F415D860016FA42 /* CacheStorageEngine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CacheStorageEngine.cpp; sourceTree = "<group>"; };
    31583158                419ACF9B1F981D26009F1A83 /* WebServiceWorkerFetchTaskClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebServiceWorkerFetchTaskClient.h; sourceTree = "<group>"; };
    3159                 41A5F7B9226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeDispositionCocoa.h; sourceTree = "<group>"; };
    3160                 41A5F7BA226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AuthenticationChallengeDispositionCocoa.mm; sourceTree = "<group>"; };
    31613159                41AC86811E042E5300303074 /* WebRTCResolver.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; name = WebRTCResolver.messages.in; path = Network/webrtc/WebRTCResolver.messages.in; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = "<none>"; };
    31623160                41B28B081F83AD3E00FB52AC /* RTCPacketOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPacketOptions.h; sourceTree = "<group>"; };
     
    70447042                        isa = PBXGroup;
    70457043                        children = (
    7046                                 41A5F7B9226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.h */,
    7047                                 41A5F7BA226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.mm */,
    70487044                                57B4B45D20B504AB00D4AD79 /* AuthenticationManagerCocoa.mm */,
    70497045                                44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */,
  • trunk/Tools/ChangeLog

    r249061 r249063  
     12019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r249001.
     4
     5        Caused one layout test to fail on all configurations and
     6        another to time out on Catalina / iOS 13.
     7
     8        Reverted changeset:
     9
     10        "Add a WebsiteDataStore delegate to handle
     11        AuthenticationChallenge that do not come from pages"
     12        https://bugs.webkit.org/show_bug.cgi?id=196870
     13        https://trac.webkit.org/changeset/249001
     14
    1152019-08-23  Jonathan Bedard  <jbedard@apple.com>
    216
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r249013 r249063  
    10331033    m_openPanelFileURLsMediaIcon = nullptr;
    10341034#endif
    1035 
    1036     setAllowsAnySSLCertificate(true);
    1037 
     1035   
    10381036    statisticsResetToConsistentState();
    10391037   
     
    11841182}
    11851183
    1186 #if !PLATFORM(COCOA)
    11871184void TestController::setAllowsAnySSLCertificate(bool allows)
    11881185{
    1189     m_allowsAnySSLCertificate = allows;
    11901186    WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows);
    11911187}
    1192 #endif
    11931188
    11941189static std::string testPath(WKURLRef url)
     
    23342329        m_serverTrustEvaluationCallbackCallsCount++;
    23352330
    2336         if (m_allowsAnySSLCertificate) {
    2337             WKRetainPtr<WKCredentialRef> credential = adoptWK(WKCredentialCreate(toWK("accept server trust").get(), toWK("").get(), kWKCredentialPersistenceNone));
    2338             WKAuthenticationDecisionListenerUseCredential(decisionListener, credential.get());
    2339             return;
    2340         }
    2341         WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(decisionListener);
     2331        WKRetainPtr<WKCredentialRef> credential = adoptWK(WKCredentialCreate(toWK("accept server trust").get(), toWK("").get(), kWKCredentialPersistenceNone));
     2332        WKAuthenticationDecisionListenerUseCredential(decisionListener, credential.get());
    23422333        return;
    23432334    }
  • trunk/Tools/WebKitTestRunner/TestController.h

    r249001 r249063  
    592592    uint64_t m_serverTrustEvaluationCallbackCallsCount { 0 };
    593593    bool m_shouldDismissJavaScriptAlertsAsynchronously { false };
    594     bool m_allowsAnySSLCertificate { true };
    595594};
    596595
  • trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

    r249001 r249063  
    3636#import <Security/SecItem.h>
    3737#import <WebKit/WKContextConfigurationRef.h>
    38 #import <WebKit/WKContextPrivate.h>
    3938#import <WebKit/WKCookieManager.h>
    4039#import <WebKit/WKPreferencesRefPrivate.h>
     
    399398}
    400399
    401 void TestController::setAllowsAnySSLCertificate(bool allows)
    402 {
    403     m_allowsAnySSLCertificate = allows;
    404     WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows);
    405     [globalWebsiteDataStoreDelegateClient setAllowAnySSLCertificate: allows];
    406 }
    407 
    408400bool TestController::canDoServerTrustEvaluationInNetworkProcess() const
    409401{
  • trunk/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h

    r249001 r249063  
    3131@private
    3232    BOOL _shouldAllowRaisingQuota;
    33     BOOL _shouldAllowAnySSLCertificate;
    3433}
    3534- (instancetype)init;
    3635- (void)setAllowRaisingQuota:(BOOL)shouldAllowRaisingQuota;
    37 - (void)setAllowAnySSLCertificate:(BOOL)shouldAllowAnySSLCertificate;
    3836@end
  • trunk/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm

    r249001 r249063  
    4343    _shouldAllowRaisingQuota = shouldAllowRaisingQuota;
    4444}
    45 
    46 - (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler
    47 {
    48     NSString *method = challenge.protectionSpace.authenticationMethod;
    49     if ([method isEqualToString:NSURLAuthenticationMethodServerTrust]) {
    50         if (_shouldAllowAnySSLCertificate)
    51             completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust: challenge.protectionSpace.serverTrust]);
    52         else
    53             completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
    54         return;
    55     }
    56     completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
    57 }
    58 
    59 - (void)setAllowAnySSLCertificate:(BOOL)shouldAllowAnySSLCertificate
    60 {
    61     _shouldAllowAnySSLCertificate = shouldAllowAnySSLCertificate;
    62 }
    63 
    6445@end
Note: See TracChangeset for help on using the changeset viewer.