Changeset 239735 in webkit


Ignore:
Timestamp:
Jan 8, 2019, 12:12:38 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Unreviewed, rolling out r239727.

Broke API tests

Reverted changeset:

"Stop using NetworkStorageSession in WebProcess"
https://bugs.webkit.org/show_bug.cgi?id=193236
https://trac.webkit.org/changeset/239727

Location:
trunk/Source
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239727 r239735  
     12019-01-08  Alex Christensen  <achristensen@webkit.org>
     2
     3        Unreviewed, rolling out r239727.
     4
     5        Broke API tests
     6
     7        Reverted changeset:
     8
     9        "Stop using NetworkStorageSession in WebProcess"
     10        https://bugs.webkit.org/show_bug.cgi?id=193236
     11        https://trac.webkit.org/changeset/239727
     12
    1132019-01-08  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebCore/loader/CookieJar.cpp

    r239727 r239735  
    5555{
    5656    NetworkingContext* context = networkingContext(document);
    57     return context ? *context->storageSession() : NetworkStorageSession::defaultStorageSession();
     57    return context ? context->storageSession() : NetworkStorageSession::defaultStorageSession();
    5858}
    5959
  • trunk/Source/WebCore/loader/EmptyClients.cpp

    r239727 r239735  
    288288
    289289    bool shouldClearReferrerOnHTTPSToHTTPRedirect() const { return true; }
    290     NetworkStorageSession* storageSession() const final { return &NetworkStorageSession::defaultStorageSession(); }
     290    NetworkStorageSession& storageSession() const final { return NetworkStorageSession::defaultStorageSession(); }
    291291
    292292#if PLATFORM(COCOA)
  • trunk/Source/WebCore/platform/network/NetworkingContext.h

    r239727 r239735  
    5959    virtual String sourceApplicationIdentifier() const { return emptyString(); }
    6060
    61     virtual NetworkStorageSession* storageSession() const = 0;
     61    virtual NetworkStorageSession& storageSession() const = 0;
    6262
    6363#if PLATFORM(WIN)
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp

    r239727 r239735  
    150150            // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
    151151            // try and reuse the credential preemptively, as allowed by RFC 2617.
    152             d->m_initialCredential = d->m_context->storageSession()->credentialStorage().get(partition, firstRequest().url());
     152            d->m_initialCredential = d->m_context->storageSession().credentialStorage().get(partition, firstRequest().url());
    153153        } else {
    154154            // If there is already a protection space known for the URL, update stored credentials before sending a request.
    155155            // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
    156156            // (so that an authentication dialog doesn't pop up).
    157             d->m_context->storageSession()->credentialStorage().set(partition, Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
     157            d->m_context->storageSession().credentialStorage().set(partition, Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
    158158        }
    159159    }
     
    262262        return false;
    263263
    264     d->m_storageSession = d->m_context->storageSession()->platformSession();
     264    d->m_storageSession = d->m_context->storageSession().platformSession();
    265265
    266266    bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
     
    308308        // URL didn't include credentials of its own.
    309309        if (d->m_user.isEmpty() && d->m_pass.isEmpty() && !redirectResponse.isNull()) {
    310             Credential credential = d->m_context->storageSession()->credentialStorage().get(partition, request.url());
     310            Credential credential = d->m_context->storageSession().credentialStorage().get(partition, request.url());
    311311            if (!credential.isEmpty()) {
    312312                d->m_initialCredential = credential;
     
    383383        if (challenge.failureResponse().httpStatusCode() == 401)
    384384            urlToStore = challenge.failureResponse().url();
    385         d->m_context->storageSession()->credentialStorage().set(partition, credential, challenge.protectionSpace(), urlToStore);
     385        d->m_context->storageSession().credentialStorage().set(partition, credential, challenge.protectionSpace(), urlToStore);
    386386       
    387387        CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
     
    397397            // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
    398398            // but the observable effect should be very minor, if any.
    399             d->m_context->storageSession()->credentialStorage().remove(partition, challenge.protectionSpace());
     399            d->m_context->storageSession().credentialStorage().remove(partition, challenge.protectionSpace());
    400400        }
    401401
    402402        if (!challenge.previousFailureCount()) {
    403             Credential credential = d->m_context->storageSession()->credentialStorage().get(partition, challenge.protectionSpace());
     403            Credential credential = d->m_context->storageSession().credentialStorage().get(partition, challenge.protectionSpace());
    404404            if (!credential.isEmpty() && credential != d->m_initialCredential) {
    405405                ASSERT(credential.persistence() == CredentialPersistenceNone);
    406406                if (challenge.failureResponse().httpStatusCode() == 401) {
    407407                    // Store the credential back, possibly adding it as a default for this directory.
    408                     d->m_context->storageSession()->credentialStorage().set(partition, credential, challenge.protectionSpace(), challenge.failureResponse().url());
     408                    d->m_context->storageSession().credentialStorage().set(partition, credential, challenge.protectionSpace(), challenge.failureResponse().url());
    409409                }
    410410#if PLATFORM(COCOA)
     
    456456            urlToStore = challenge.failureResponse().url();
    457457
    458         d->m_context->storageSession()->credentialStorage().set(firstRequest().cachePartition(), webCredential, challenge.protectionSpace(), urlToStore);
     458        d->m_context->storageSession().credentialStorage().set(firstRequest().cachePartition(), webCredential, challenge.protectionSpace(), urlToStore);
    459459
    460460        if (d->m_connection) {
     
    572572    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff));
    573573
    574     handle->d->m_storageSession = context->storageSession()->platformSession();
     574    handle->d->m_storageSession = context->storageSession().platformSession();
    575575
    576576    if (handle->d->m_scheduledFailureType != NoFailure) {
  • trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm

    r239727 r239735  
    158158            // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
    159159            // try and reuse the credential preemptively, as allowed by RFC 2617.
    160             d->m_initialCredential = d->m_context->storageSession()->credentialStorage().get(firstRequest().cachePartition(), firstRequest().url());
     160            d->m_initialCredential = d->m_context->storageSession().credentialStorage().get(firstRequest().cachePartition(), firstRequest().url());
    161161        } else {
    162162            // If there is already a protection space known for the URL, update stored credentials before sending a request.
    163163            // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
    164164            // (so that an authentication dialog doesn't pop up).
    165             d->m_context->storageSession()->credentialStorage().set(firstRequest().cachePartition(), Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
     165            d->m_context->storageSession().credentialStorage().set(firstRequest().cachePartition(), Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
    166166        }
    167167    }
     
    241241        return false;
    242242
    243     d->m_storageSession = d->m_context->storageSession()->platformSession();
     243    d->m_storageSession = d->m_context->storageSession().platformSession();
    244244
    245245    // FIXME: Do not use the sync version of shouldUseCredentialStorage when the client returns true from usesAsyncCallbacks.
     
    368368    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &client, defersLoading, shouldContentSniff, shouldContentEncodingSniff));
    369369
    370     handle->d->m_storageSession = context->storageSession()->platformSession();
     370    handle->d->m_storageSession = context->storageSession().platformSession();
    371371
    372372    if (context && handle->d->m_scheduledFailureType != NoFailure) {
     
    450450        // URL didn't include credentials of its own.
    451451        if (d->m_user.isEmpty() && d->m_pass.isEmpty() && !redirectResponse.isNull()) {
    452             Credential credential = d->m_context->storageSession()->credentialStorage().get(request.cachePartition(), request.url());
     452            Credential credential = d->m_context->storageSession().credentialStorage().get(request.cachePartition(), request.url());
    453453            if (!credential.isEmpty()) {
    454454                d->m_initialCredential = credential;
     
    541541            // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
    542542            // but the observable effect should be very minor, if any.
    543             d->m_context->storageSession()->credentialStorage().remove(d->m_partition, challenge.protectionSpace());
     543            d->m_context->storageSession().credentialStorage().remove(d->m_partition, challenge.protectionSpace());
    544544        }
    545545
    546546        if (!challenge.previousFailureCount()) {
    547             Credential credential = d->m_context->storageSession()->credentialStorage().get(d->m_partition, challenge.protectionSpace());
     547            Credential credential = d->m_context->storageSession().credentialStorage().get(d->m_partition, challenge.protectionSpace());
    548548            if (!credential.isEmpty() && credential != d->m_initialCredential) {
    549549                ASSERT(credential.persistence() == CredentialPersistenceNone);
    550550                if (challenge.failureResponse().httpStatusCode() == 401) {
    551551                    // Store the credential back, possibly adding it as a default for this directory.
    552                     d->m_context->storageSession()->credentialStorage().set(d->m_partition, credential, challenge.protectionSpace(), challenge.failureResponse().url());
     552                    d->m_context->storageSession().credentialStorage().set(d->m_partition, credential, challenge.protectionSpace(), challenge.failureResponse().url());
    553553                }
    554554                [challenge.sender() useCredential:credential.nsCredential() forAuthenticationChallenge:mac(challenge)];
     
    592592        if (challenge.failureResponse().httpStatusCode() == 401)
    593593            urlToStore = challenge.failureResponse().url();
    594         d->m_context->storageSession()->credentialStorage().set(d->m_partition, webCredential, ProtectionSpace([d->m_currentMacChallenge protectionSpace]), urlToStore);
     594        d->m_context->storageSession().credentialStorage().set(d->m_partition, webCredential, ProtectionSpace([d->m_currentMacChallenge protectionSpace]), urlToStore);
    595595        [[d->m_currentMacChallenge sender] useCredential:webCredential.nsCredential() forAuthenticationChallenge:d->m_currentMacChallenge];
    596596    } else
  • trunk/Source/WebKit/ChangeLog

    r239733 r239735  
     12019-01-08  Alex Christensen  <achristensen@webkit.org>
     2
     3        Unreviewed, rolling out r239727.
     4
     5        Broke API tests
     6
     7        Reverted changeset:
     8
     9        "Stop using NetworkStorageSession in WebProcess"
     10        https://bugs.webkit.org/show_bug.cgi?id=193236
     11        https://trac.webkit.org/changeset/239727
     12
    1132019-01-08  Brian Burg  <bburg@apple.com>
    214
  • trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp

    r239727 r239735  
    7373    encoder << shouldCaptureDisplayInUIProcess;
    7474#endif
     75    encoder << shouldUseTestingNetworkSession;
    7576    encoder << urlSchemesRegisteredAsEmptyDocument;
    7677    encoder << urlSchemesRegisteredAsSecure;
     
    267268        return false;
    268269#endif
     270    if (!decoder.decode(parameters.shouldUseTestingNetworkSession))
     271        return false;
    269272    if (!decoder.decode(parameters.urlSchemesRegisteredAsEmptyDocument))
    270273        return false;
  • trunk/Source/WebKit/Shared/WebProcessCreationParameters.h

    r239727 r239735  
    125125    double defaultRequestTimeoutInterval { INT_MAX };
    126126
     127    bool shouldUseTestingNetworkSession { false };
    127128    bool shouldAlwaysUseComplexTextCodePath { false };
    128129    bool shouldEnableMemoryPressureReliefLogging { false };
  • trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp

    r239727 r239735  
    162162    if (websitePolicies.websiteDataStoreParameters) {
    163163        if (auto* frame = documentLoader.frame()) {
    164             if (auto* page = frame->page())
    165                 page->setSessionID(websitePolicies.websiteDataStoreParameters->networkSessionParameters.sessionID);
     164            if (auto* page = frame->page()) {
     165                auto sessionID = websitePolicies.websiteDataStoreParameters->networkSessionParameters.sessionID;
     166                WebProcess::singleton().addWebsiteDataStore(WTFMove(*websitePolicies.websiteDataStoreParameters));
     167                page->setSessionID(sessionID);
     168            }
    166169        }
    167170    }
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r239727 r239735  
    690690    if (privateBrowsingEnabled) {
    691691        sendToNetworkingProcess(Messages::NetworkProcess::AddWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters()));
     692        sendToAllProcesses(Messages::WebProcess::AddWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters()));
    692693    } else {
    693694        networkProcess()->removeSession(PAL::SessionID::legacyPrivateSessionID());
     695        sendToAllProcesses(Messages::WebProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()));
    694696    }
    695697}
     
    764766    ASSERT(m_prewarmedProcess->isPrewarmed());
    765767    m_prewarmedProcess->markIsNoLongerInPrewarmedPool();
     768    if (&m_prewarmedProcess->websiteDataStore() != &websiteDataStore)
     769        m_prewarmedProcess->send(Messages::WebProcess::AddWebsiteDataStore(websiteDataStore.parameters()), 0);
    766770
    767771    return std::exchange(m_prewarmedProcess, nullptr);
     
    850854            SandboxExtension::createHandleWithoutResolvingPath(parameters.javaScriptConfigurationDirectory, SandboxExtension::Type::ReadWrite, parameters.javaScriptConfigurationDirectoryExtensionHandle);
    851855    }
     856
     857    parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession;
    852858
    853859    parameters.cacheModel = cacheModel();
     
    937943#endif
    938944
     945    if (WebPreferences::anyPagesAreUsingPrivateBrowsing())
     946        process.send(Messages::WebProcess::AddWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters()), 0);
     947
    939948    if (m_automationSession)
    940949        process.send(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession->sessionIdentifier()), 0);
     
    11801189        if (m_networkProcess)
    11811190            m_networkProcess->addSession(makeRef(page.websiteDataStore()));
     1191        page.process().send(Messages::WebProcess::AddWebsiteDataStore(WebsiteDataStoreParameters::privateSessionParameters(sessionID)), 0);
    11821192        page.websiteDataStore().clearPendingCookies();
    11831193    } else if (sessionID != PAL::SessionID::defaultSessionID()) {
    11841194        if (m_networkProcess)
    11851195            m_networkProcess->addSession(makeRef(page.websiteDataStore()));
     1196        page.process().send(Messages::WebProcess::AddWebsiteDataStore(page.websiteDataStore().parameters()), 0);
    11861197        page.websiteDataStore().clearPendingCookies();
    11871198    }
     
    12141225        if (networkProcess())
    12151226            networkProcess()->removeSession(sessionID);
     1227        page.process().send(Messages::WebProcess::DestroySession(sessionID), 0);
    12161228    }
    12171229}
     
    22272239            m_suspendedPages.remove(it);
    22282240
     2241        if (&process->websiteDataStore() != &page.websiteDataStore())
     2242            process->send(Messages::WebProcess::AddWebsiteDataStore(page.websiteDataStore().parameters()), 0);
     2243
    22292244        return completionHandler(WTFMove(process), nullptr, reason);
    22302245    }
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp

    r239727 r239735  
    358358    if (enabled) {
    359359        WebProcess::singleton().ensureLegacyPrivateBrowsingSessionInNetworkProcess();
     360        WebFrameNetworkingContext::ensureWebsiteDataStoreSession(WebsiteDataStoreParameters::legacyPrivateSessionParameters());
    360361    } else
    361362        SessionTracker::destroySession(PAL::SessionID::legacyPrivateSessionID());
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp

    r239727 r239735  
    5757}
    5858
     59NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
     60{
     61    if (frame()) {
     62        if (auto* storageSession = NetworkStorageSession::storageSession(frame()->page()->sessionID()))
     63            return *storageSession;
     64    }
     65    return NetworkStorageSession::defaultStorageSession();
     66}
     67
    5968WebFrameLoaderClient* WebFrameNetworkingContext::webFrameLoaderClient() const
    6069{
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h

    r239727 r239735  
    5454    WebFrameNetworkingContext(WebFrame*);
    5555
    56     WebCore::NetworkStorageSession* storageSession() const override { return nullptr; }
     56    WebCore::NetworkStorageSession& storageSession() const override;
    5757};
    5858
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h

    r239727 r239735  
    5757    String sourceApplicationIdentifier() const override;
    5858    WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const override;
    59     WebCore::NetworkStorageSession* storageSession() const override { return nullptr; }
     59    WebCore::NetworkStorageSession& storageSession() const override;
    6060};
    6161
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r239727 r239735  
    4444using namespace WebCore;
    4545
     46void WebFrameNetworkingContext::ensureWebsiteDataStoreSession(WebsiteDataStoreParameters&& parameters)
     47{
     48    ASSERT(!hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies));
     49    auto sessionID = parameters.networkSessionParameters.sessionID;
     50    if (NetworkStorageSession::storageSession(sessionID))
     51        return;
     52
     53    String base = WebProcess::singleton().uiProcessBundleIdentifier();
     54    if (base.isNull())
     55        base = [[NSBundle mainBundle] bundleIdentifier];
     56
     57    NetworkStorageSession::ensureSession(sessionID, base + '.' + String::number(sessionID.sessionID()));
     58}
     59
    4660bool WebFrameNetworkingContext::localFileContentSniffingEnabled() const
    4761{
     
    7185}
    7286
     87NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
     88{
     89    ASSERT(RunLoop::isMain());
     90    ASSERT(!hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies));
     91    if (frame()) {
     92        if (auto* storageSession = WebCore::NetworkStorageSession::storageSession(frame()->page()->sessionID()))
     93            return *storageSession;
     94        // Some requests may still be coming shortly after WebProcess was told to destroy its session.
     95        LOG_ERROR("WEB Invalid session ID. Please file a bug unless you just disabled private browsing, in which case it's an expected race.");
     96    }
     97    return NetworkStorageSession::defaultStorageSession();
     98}
     99
    73100WebFrameLoaderClient* WebFrameNetworkingContext::webFrameLoaderClient() const
    74101{
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp

    r239727 r239735  
    5959}
    6060
     61NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
     62{
     63    if (frame()) {
     64        if (auto* storageSession = NetworkStorageSession::storageSession(frame()->page()->sessionID()))
     65            return *storageSession;
     66    }
     67    return NetworkStorageSession::defaultStorageSession();
     68}
     69
    6170WebFrameLoaderClient* WebFrameNetworkingContext::webFrameLoaderClient() const
    6271{
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h

    r239727 r239735  
    5252    WebFrameNetworkingContext(WebFrame*);
    5353
    54     WebCore::NetworkStorageSession* storageSession() const override { return nullptr; }
     54    WebCore::NetworkStorageSession& storageSession() const override;
    5555};
    5656
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r239727 r239735  
    30443044void WebPage::setSessionID(PAL::SessionID sessionID)
    30453045{
     3046    if (sessionID.isEphemeral())
     3047        WebProcess::singleton().addWebsiteDataStore(WebsiteDataStoreParameters::privateSessionParameters(sessionID));
    30463048    m_page->setSessionID(sessionID);
    30473049}
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r239727 r239735  
    382382    setShouldUseFontSmoothing(parameters.shouldUseFontSmoothing);
    383383
     384    if (parameters.shouldUseTestingNetworkSession)
     385        NetworkStorageSession::switchToNewTestingSession();
     386
    384387    ensureNetworkProcessConnection();
    385388
     
    536539{
    537540    m_fullKeyboardAccessEnabled = fullKeyboardAccessEnabled;
     541}
     542
     543void WebProcess::addWebsiteDataStore(WebsiteDataStoreParameters&& parameters)
     544{
     545    WebFrameNetworkingContext::ensureWebsiteDataStoreSession(WTFMove(parameters));
     546}
     547
     548void WebProcess::destroySession(PAL::SessionID sessionID)
     549{
     550    SessionTracker::destroySession(sessionID);
    538551}
    539552
     
    12821295            websiteData.entries.append(WebsiteData::Entry { origin->data(), WebsiteDataType::MemoryCache, 0 });
    12831296    }
     1297
     1298    if (websiteDataTypes.contains(WebsiteDataType::Credentials)) {
     1299        if (NetworkStorageSession::storageSession(sessionID))
     1300            websiteData.originsWithCredentials = NetworkStorageSession::storageSession(sessionID)->credentialStorage().originsWithCredentials();
     1301    }
    12841302}
    12851303
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r239727 r239735  
    179179
    180180    void ensureLegacyPrivateBrowsingSessionInNetworkProcess();
     181    void addWebsiteDataStore(WebsiteDataStoreParameters&&);
     182    void destroySession(PAL::SessionID);
    181183
    182184    void pageDidEnterWindow(uint64_t pageID);
  • trunk/Source/WebKit/WebProcess/WebProcess.messages.in

    r239727 r239735  
    5353
    5454    ClearCachedCredentials()
     55
     56    AddWebsiteDataStore(struct WebKit::WebsiteDataStoreParameters websiteDataStoreParameters);
     57    DestroySession(PAL::SessionID sessionID)
    5558
    5659    # Plug-ins.
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r239727 r239735  
     12019-01-08  Alex Christensen  <achristensen@webkit.org>
     2
     3        Unreviewed, rolling out r239727.
     4
     5        Broke API tests
     6
     7        Reverted changeset:
     8
     9        "Stop using NetworkStorageSession in WebProcess"
     10        https://bugs.webkit.org/show_bug.cgi?id=193236
     11        https://trac.webkit.org/changeset/239727
     12
    1132019-01-08  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.h

    r239727 r239735  
    5050    String sourceApplicationIdentifier() const override;
    5151    WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const override;
    52     WebCore::NetworkStorageSession* storageSession() const override;
     52    WebCore::NetworkStorageSession& storageSession() const override;
    5353};
  • trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm

    r239727 r239735  
    9191}
    9292
    93 NetworkStorageSession* WebFrameNetworkingContext::storageSession() const
     93NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
    9494{
    9595    ASSERT(isMainThread());
    9696    if (frame() && frame()->page() && frame()->page()->sessionID().isEphemeral()) {
    9797        if (auto* session = NetworkStorageSession::storageSession(PAL::SessionID::legacyPrivateSessionID()))
    98             return session;
     98            return *session;
    9999        // Some requests may still be coming shortly before WebCore updates the session ID and after WebKit destroys the private browsing session.
    100100        LOG_ERROR("Invalid session ID. Please file a bug unless you just disabled private browsing, in which case it's an expected race.");
    101101    }
    102     return &NetworkStorageSession::defaultStorageSession();
     102    return NetworkStorageSession::defaultStorageSession();
    103103}
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r239727 r239735  
    36693669        return nil;
    36703670
    3671     if (auto storageSession = _private->page->mainFrame().loader().networkingContext()->storageSession()->platformSession())
     3671    if (CFURLStorageSessionRef storageSession = _private->page->mainFrame().loader().networkingContext()->storageSession().platformSession())
    36723672        cachedResponse = cachedResponseForRequest(storageSession, request.get());
    36733673    else
     
    92529252        return;
    92539253
    9254     networkingContext->storageSession()->credentialStorage().clearCredentials();
     9254    networkingContext->storageSession().credentialStorage().clearCredentials();
    92559255}
    92569256
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r239549 r239735  
     12019-01-08  Alex Christensen  <achristensen@webkit.org>
     2
     3        Unreviewed, rolling out r239727.
     4
     5        Broke API tests
     6
     7        Reverted changeset:
     8
     9        "Stop using NetworkStorageSession in WebProcess"
     10        https://bugs.webkit.org/show_bug.cgi?id=193236
     11        https://trac.webkit.org/changeset/239727
     12
    1132018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
    214
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameNetworkingContext.cpp

    r239727 r239735  
    100100}
    101101
    102 NetworkStorageSession* WebFrameNetworkingContext::storageSession() const
     102NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
    103103{
    104104    ASSERT(isMainThread());
    105105
    106106    if (frame() && frame()->page()->usesEphemeralSession())
    107         return NetworkStorageSession::storageSession(PAL::SessionID::legacyPrivateSessionID());
     107        return *NetworkStorageSession::storageSession(PAL::SessionID::legacyPrivateSessionID());
    108108
    109     return &NetworkStorageSession::defaultStorageSession();
     109    return NetworkStorageSession::defaultStorageSession();
    110110}
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameNetworkingContext.h

    r239727 r239735  
    4848
    4949    WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const override;
    50     WebCore::NetworkStorageSession* storageSession() const override;
     50    WebCore::NetworkStorageSession& storageSession() const override;
    5151};
Note: See TracChangeset for help on using the changeset viewer.