Changeset 239815 in webkit


Ignore:
Timestamp:
Jan 9, 2019, 7:08:07 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Replace SessionTracker with HashMap member of NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193266

Reviewed by Joseph Pecoraro.

  • NetworkProcess/Downloads/DownloadManager.cpp:

(WebKit::DownloadManager::startDownload):

  • NetworkProcess/Downloads/DownloadManager.h:
  • NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:

(WebKit::Download::resume):

  • NetworkProcess/NetworkCORSPreflightChecker.cpp:

(WebKit::NetworkCORSPreflightChecker::startPreflight):

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/NetworkConnectionToWebProcess.messages.in:
  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::clearCachedCredentials):
(WebKit::NetworkProcess::networkSession):
(WebKit::NetworkProcess::setSession):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::preconnectTo):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
(WebKit::NetworkResourceLoader::shouldLogCookieInformation):
(WebKit::NetworkResourceLoader::logCookieInformation const):
(WebKit::logBlockedCookieInformation):
(WebKit::logCookieInformationInternal):
(WebKit::NetworkResourceLoader::logCookieInformation):

  • NetworkProcess/NetworkResourceLoader.h:
  • NetworkProcess/PingLoad.cpp:

(WebKit::PingLoad::loadRequest):

  • NetworkProcess/PingLoad.h:
  • NetworkProcess/PreconnectTask.cpp:

(WebKit::PreconnectTask::PreconnectTask):

  • NetworkProcess/PreconnectTask.h:
  • NetworkProcess/RemoteNetworkingContext.h:
  • NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:

(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

  • NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
  • NetworkProcess/cocoa/NetworkProcessCocoa.mm:
  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:
  • NetworkProcess/mac/RemoteNetworkingContext.mm:

(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

  • Shared/SessionTracker.cpp: Removed.
  • Shared/SessionTracker.h: Removed.
  • Sources.txt:
  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::setPrivateBrowsingEnabled):

  • WebProcess/Network/WebLoaderStrategy.cpp:
  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
  • WebProcess/WebPage/WebPage.cpp:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess):

  • WebProcess/WebProcess.h:
  • WebProcess/cocoa/WebProcessCocoa.mm:
Location:
trunk/Source/WebKit
Files:
2 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r239792 r239815  
     12019-01-09  Alex Christensen  <achristensen@webkit.org>
     2
     3        Replace SessionTracker with HashMap member of NetworkProcess
     4        https://bugs.webkit.org/show_bug.cgi?id=193266
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * NetworkProcess/Downloads/DownloadManager.cpp:
     9        (WebKit::DownloadManager::startDownload):
     10        * NetworkProcess/Downloads/DownloadManager.h:
     11        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
     12        (WebKit::Download::resume):
     13        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
     14        (WebKit::NetworkCORSPreflightChecker::startPreflight):
     15        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     16        (WebKit::NetworkConnectionToWebProcess::preconnectTo):
     17        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
     18        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
     19        (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):
     20        * NetworkProcess/NetworkConnectionToWebProcess.h:
     21        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
     22        * NetworkProcess/NetworkProcess.cpp:
     23        (WebKit::NetworkProcess::initializeNetworkProcess):
     24        (WebKit::NetworkProcess::clearCachedCredentials):
     25        (WebKit::NetworkProcess::networkSession):
     26        (WebKit::NetworkProcess::setSession):
     27        (WebKit::NetworkProcess::destroySession):
     28        (WebKit::NetworkProcess::preconnectTo):
     29        * NetworkProcess/NetworkProcess.h:
     30        * NetworkProcess/NetworkResourceLoader.cpp:
     31        (WebKit::NetworkResourceLoader::startNetworkLoad):
     32        (WebKit::NetworkResourceLoader::didFinishLoading):
     33        (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
     34        (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
     35        (WebKit::NetworkResourceLoader::logCookieInformation const):
     36        (WebKit::logBlockedCookieInformation):
     37        (WebKit::logCookieInformationInternal):
     38        (WebKit::NetworkResourceLoader::logCookieInformation):
     39        * NetworkProcess/NetworkResourceLoader.h:
     40        * NetworkProcess/PingLoad.cpp:
     41        (WebKit::PingLoad::loadRequest):
     42        * NetworkProcess/PingLoad.h:
     43        * NetworkProcess/PreconnectTask.cpp:
     44        (WebKit::PreconnectTask::PreconnectTask):
     45        * NetworkProcess/PreconnectTask.h:
     46        * NetworkProcess/RemoteNetworkingContext.h:
     47        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
     48        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
     49        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
     50        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
     51        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     52        * NetworkProcess/mac/RemoteNetworkingContext.mm:
     53        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
     54        * Shared/SessionTracker.cpp: Removed.
     55        * Shared/SessionTracker.h: Removed.
     56        * Sources.txt:
     57        * WebKit.xcodeproj/project.pbxproj:
     58        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     59        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
     60        * WebProcess/Network/WebLoaderStrategy.cpp:
     61        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     62        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
     63        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
     64        * WebProcess/WebPage/WebPage.cpp:
     65        * WebProcess/WebProcess.cpp:
     66        (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess):
     67        * WebProcess/WebProcess.h:
     68        * WebProcess/cocoa/WebProcessCocoa.mm:
     69
    1702019-01-09  Alex Christensen  <achristensen@webkit.org>
    271
  • trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp

    r239699 r239815  
    3232#include "NetworkSession.h"
    3333#include "PendingDownload.h"
    34 #include "SessionTracker.h"
    3534#include <WebCore/NotImplemented.h>
    3635#include <pal/SessionID.h>
     
    4746void DownloadManager::startDownload(NetworkConnectionToWebProcess* connection, PAL::SessionID sessionID, DownloadID downloadID, const ResourceRequest& request, const String& suggestedName)
    4847{
    49     auto* networkSession = SessionTracker::networkSession(sessionID);
     48    auto* networkSession = client().networkSession(sessionID);
    5049    if (!networkSession)
    5150        return;
  • trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h

    r239699 r239815  
    7373        virtual AuthenticationManager& downloadsAuthenticationManager() = 0;
    7474        virtual void pendingDownloadCanceled(DownloadID) = 0;
     75        virtual NetworkSession* networkSession(const PAL::SessionID&) const = 0;
    7576        virtual void ref() const = 0;
    7677        virtual void deref() const = 0;
  • trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm

    r238771 r239815  
    2929#import "DataReference.h"
    3030#import "NetworkSessionCocoa.h"
    31 #import "SessionTracker.h"
    3231#import "WKDownloadProgress.h"
    3332#import <pal/spi/cf/CFNetworkSPI.h>
     
    4241        m_sandboxExtension->consume();
    4342
    44     auto* networkSession = SessionTracker::networkSession(m_sessionID);
     43    auto* networkSession = m_downloadManager.client().networkSession(m_sessionID);
    4544    if (!networkSession) {
    4645        WTFLogAlways("Could not find network session with given session ID");
  • trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp

    r239741 r239815  
    3232#include "NetworkLoadParameters.h"
    3333#include "NetworkProcess.h"
    34 #include "SessionTracker.h"
    3534#include <WebCore/CrossOriginAccessControl.h>
    3635
     
    7372        m_loadInformation = NetworkTransactionInformation { NetworkTransactionInformation::Type::Preflight, loadParameters.request, { }, { } };
    7473
    75     if (auto* networkSession = SessionTracker::networkSession(loadParameters.sessionID)) {
     74    if (auto* networkSession = m_networkProcess->networkSession(loadParameters.sessionID)) {
    7675        m_task = NetworkDataTask::create(*networkSession, *this, WTFMove(loadParameters));
    7776        m_task->resume();
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r239741 r239815  
    4646#include "PingLoad.h"
    4747#include "PreconnectTask.h"
    48 #include "SessionTracker.h"
    4948#include "WebCoreArgumentCoders.h"
    5049#include "WebErrors.h"
     
    392391{
    393392#if ENABLE(SERVER_PRECONNECT)
    394     new PreconnectTask(WTFMove(parameters), [this, protectedThis = makeRef(*this), identifier = preconnectionIdentifier] (const ResourceError& error) {
     393    new PreconnectTask(networkProcess(), WTFMove(parameters), [this, protectedThis = makeRef(*this), identifier = preconnectionIdentifier] (const ResourceError& error) {
    395394        didFinishPreconnection(identifier, error);
    396395    });
     
    452451    std::tie(cookieString, secureCookiesAccessed) = networkStorageSession.cookiesForDOM(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies);
    453452#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    454     if (auto session = SessionTracker::networkSession(sessionID)) {
     453    if (auto session = networkProcess().networkSession(sessionID)) {
    455454        if (session->shouldLogCookieInformation())
    456             NetworkResourceLoader::logCookieInformation("NetworkConnectionToWebProcess::cookiesForDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, WTF::nullopt);
     455            NetworkResourceLoader::logCookieInformation(*this, "NetworkConnectionToWebProcess::cookiesForDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, WTF::nullopt);
    457456    }
    458457#endif
     
    464463    networkStorageSession.setCookiesFromDOM(firstParty, sameSiteInfo, url, frameID, pageID, cookieString);
    465464#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    466     if (auto session = SessionTracker::networkSession(sessionID)) {
     465    if (auto session = networkProcess().networkSession(sessionID)) {
    467466        if (session->shouldLogCookieInformation())
    468             NetworkResourceLoader::logCookieInformation("NetworkConnectionToWebProcess::setCookiesFromDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, WTF::nullopt);
     467            NetworkResourceLoader::logCookieInformation(*this, "NetworkConnectionToWebProcess::setCookiesFromDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, WTF::nullopt);
    469468    }
    470469#endif
     
    554553{
    555554    m_networkProcess->addWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters());
     555}
     556
     557void NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession()
     558{
     559    m_networkProcess->destroySession(PAL::SessionID::legacyPrivateSessionID());
    556560}
    557561
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r239680 r239815  
    172172   
    173173    void ensureLegacyPrivateBrowsingSession();
     174    void destroyLegacyPrivateBrowsingSession();
    174175
    175176#if ENABLE(INDEXED_DATABASE)
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in

    r239427 r239815  
    5656
    5757    EnsureLegacyPrivateBrowsingSession()
     58    DestroyLegacyPrivateBrowsingSession()
    5859
    5960    RemoveStorageAccessForFrame(PAL::SessionID sessionID, uint64_t frameID, uint64_t pageID);
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r239741 r239815  
    5050#include "PreconnectTask.h"
    5151#include "RemoteNetworkingContext.h"
    52 #include "SessionTracker.h"
    5352#include "StatisticsData.h"
    5453#include "WebCookieManager.h"
     
    303302
    304303    auto sessionID = parameters.defaultDataStoreParameters.networkSessionParameters.sessionID;
    305     SessionTracker::setSession(sessionID, NetworkSession::create(*this, WTFMove(parameters.defaultDataStoreParameters.networkSessionParameters)));
     304    setSession(sessionID, NetworkSession::create(*this, WTFMove(parameters.defaultDataStoreParameters.networkSessionParameters)));
    306305
    307306#if ENABLE(INDEXED_DATABASE)
     
    320319#endif
    321320
    322     auto* defaultSession = SessionTracker::networkSession(PAL::SessionID::defaultSessionID());
     321    auto* defaultSession = networkSession(PAL::SessionID::defaultSessionID());
    323322    for (const auto& cookie : parameters.defaultDataStoreParameters.pendingCookies)
    324323        defaultSession->networkStorageSession().setCookie(cookie);
     
    433432{
    434433    NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials();
    435     if (auto* networkSession = SessionTracker::networkSession(PAL::SessionID::defaultSessionID()))
     434    if (auto* networkSession = this->networkSession(PAL::SessionID::defaultSessionID()))
    436435        networkSession->clearCredentials();
    437436    else
     
    453452}
    454453
    455 void NetworkProcess::destroySession(PAL::SessionID sessionID)
    456 {
    457     SessionTracker::destroySession(sessionID);
     454NetworkSession* NetworkProcess::networkSession(const PAL::SessionID& sessionID) const
     455{
     456    return m_networkSessions.get(sessionID);
     457}
     458
     459void NetworkProcess::setSession(const PAL::SessionID& sessionID, Ref<NetworkSession>&& session)
     460{
     461    m_networkSessions.set(sessionID, WTFMove(session));
     462}
     463
     464void NetworkProcess::destroySession(const PAL::SessionID& sessionID)
     465{
     466    if (auto session = m_networkSessions.take(sessionID))
     467        session->get().invalidateAndCancel();
     468    NetworkStorageSession::destroySession(sessionID);
    458469    m_sessionsControlledByAutomation.remove(sessionID);
    459470    CacheStorage::Engine::destroyEngine(*this, sessionID);
     
    10341045    parameters.shouldPreconnectOnly = PreconnectOnly::Yes;
    10351046
    1036     new PreconnectTask(WTFMove(parameters));
     1047    new PreconnectTask(*this, WTFMove(parameters));
    10371048#else
    10381049    UNUSED_PARAM(url);
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.h

    r239741 r239815  
    126126    NetworkCache::Cache* cache() { return m_cache.get(); }
    127127
     128    void setSession(const PAL::SessionID&, Ref<NetworkSession>&&);
     129    NetworkSession* networkSession(const PAL::SessionID&) const override;
     130    void destroySession(const PAL::SessionID&);
     131   
    128132    bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; }
    129133
     
    266270    void initializeNetworkProcess(NetworkProcessCreationParameters&&);
    267271    void createNetworkConnectionToWebProcess(bool isServiceWorkerProcess, WebCore::SecurityOriginData&&);
    268     void destroySession(PAL::SessionID);
    269272
    270273    void fetchWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, uint64_t callbackID);
     
    376379
    377380    HashSet<PAL::SessionID> m_sessionsControlledByAutomation;
    378 
    379381    HashMap<PAL::SessionID, Vector<CacheStorageParametersCallback>> m_cacheStorageParametersCallbacks;
     382    HashMap<PAL::SessionID, Ref<NetworkSession>> m_networkSessions;
    380383
    381384#if PLATFORM(COCOA)
  • trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp

    r239759 r239815  
    3737#include "NetworkProcess.h"
    3838#include "NetworkProcessConnectionMessages.h"
    39 #include "SessionTracker.h"
    4039#include "SharedBufferDataReference.h"
    4140#include "WebCoreArgumentCoders.h"
     
    285284        parameters.blobFileReferences = NetworkBlobRegistry::singleton().filesInBlob(m_connection, originalRequest().url());
    286285
    287     auto* networkSession = SessionTracker::networkSession(parameters.sessionID);
     286    auto* networkSession = m_connection->networkProcess().networkSession(parameters.sessionID);
    288287    if (!networkSession && parameters.sessionID.isEphemeral()) {
    289288        m_connection->networkProcess().addWebsiteDataStore(WebsiteDataStoreParameters::privateSessionParameters(parameters.sessionID));
    290         networkSession = SessionTracker::networkSession(parameters.sessionID);
     289        networkSession = m_connection->networkProcess().networkSession(parameters.sessionID);
    291290    }
    292291    if (!networkSession) {
     
    551550
    552551#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    553     if (shouldLogCookieInformation(sessionID()))
     552    if (shouldLogCookieInformation(m_connection, sessionID()))
    554553        logCookieInformation();
    555554#endif
     
    851850
    852851#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    853     if (shouldLogCookieInformation(sessionID()))
     852    if (shouldLogCookieInformation(m_connection, sessionID()))
    854853        logCookieInformation();
    855854#endif
     
    950949
    951950#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    952 bool NetworkResourceLoader::shouldLogCookieInformation(const PAL::SessionID& sessionID)
    953 {
    954     if (auto session = SessionTracker::networkSession(sessionID))
     951bool NetworkResourceLoader::shouldLogCookieInformation(NetworkConnectionToWebProcess& connection, const PAL::SessionID& sessionID)
     952{
     953    if (auto session = connection.networkProcess().networkSession(sessionID))
    955954        return session->shouldLogCookieInformation();
    956955    return false;
     
    969968void NetworkResourceLoader::logCookieInformation() const
    970969{
    971     ASSERT(shouldLogCookieInformation(sessionID()));
     970    ASSERT(shouldLogCookieInformation(m_connection, sessionID()));
    972971
    973972    auto networkStorageSession = WebCore::NetworkStorageSession::storageSession(sessionID());
    974973    ASSERT(networkStorageSession);
    975974
    976     logCookieInformation("NetworkResourceLoader", reinterpret_cast<const void*>(this), *networkStorageSession, originalRequest().firstPartyForCookies(), SameSiteInfo::create(originalRequest()), originalRequest().url(), originalRequest().httpReferrer(), frameID(), pageID(), identifier());
    977 }
    978 
    979 static void logBlockedCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier)
    980 {
    981     ASSERT(NetworkResourceLoader::shouldLogCookieInformation(networkStorageSession.sessionID()));
     975    logCookieInformation(m_connection, "NetworkResourceLoader", reinterpret_cast<const void*>(this), *networkStorageSession, originalRequest().firstPartyForCookies(), SameSiteInfo::create(originalRequest()), originalRequest().url(), originalRequest().httpReferrer(), frameID(), pageID(), identifier());
     976}
     977
     978static void logBlockedCookieInformation(NetworkConnectionToWebProcess& connection, const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier)
     979{
     980    ASSERT(NetworkResourceLoader::shouldLogCookieInformation(connection, networkStorageSession.sessionID()));
    982981
    983982    auto escapedURL = escapeForJSON(url.string());
     
    10041003}
    10051004
    1006 static void logCookieInformationInternal(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier)
    1007 {
    1008     ASSERT(NetworkResourceLoader::shouldLogCookieInformation(networkStorageSession.sessionID()));
     1005static void logCookieInformationInternal(NetworkConnectionToWebProcess& connection, const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier)
     1006{
     1007    ASSERT(NetworkResourceLoader::shouldLogCookieInformation(connection, networkStorageSession.sessionID()));
    10091008
    10101009    Vector<WebCore::Cookie> cookies;
     
    10651064}
    10661065
    1067 void NetworkResourceLoader::logCookieInformation(const String& label, const void* loggedObject, const NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier)
    1068 {
    1069     ASSERT(shouldLogCookieInformation(networkStorageSession.sessionID()));
     1066void NetworkResourceLoader::logCookieInformation(NetworkConnectionToWebProcess& connection, const String& label, const void* loggedObject, const NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier)
     1067{
     1068    ASSERT(shouldLogCookieInformation(connection, networkStorageSession.sessionID()));
    10701069
    10711070    if (networkStorageSession.shouldBlockCookies(firstParty, url, frameID, pageID))
    1072         logBlockedCookieInformation(label, loggedObject, networkStorageSession, firstParty, sameSiteInfo, url, referrer, frameID, pageID, identifier);
     1071        logBlockedCookieInformation(connection, label, loggedObject, networkStorageSession, firstParty, sameSiteInfo, url, referrer, frameID, pageID, identifier);
    10731072    else
    1074         logCookieInformationInternal(label, loggedObject, networkStorageSession, firstParty, sameSiteInfo, url, referrer, frameID, pageID, identifier);
     1073        logCookieInformationInternal(connection, label, loggedObject, networkStorageSession, firstParty, sameSiteInfo, url, referrer, frameID, pageID, identifier);
    10751074}
    10761075#endif
  • trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h

    r239427 r239815  
    110110
    111111#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    112     static bool shouldLogCookieInformation(const PAL::SessionID&);
    113     static void logCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier);
     112    static bool shouldLogCookieInformation(NetworkConnectionToWebProcess&, const PAL::SessionID&);
     113    static void logCookieInformation(NetworkConnectionToWebProcess&, const String& label, const void* loggedObject, const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier);
    114114#endif
    115115
  • trunk/Source/WebKit/NetworkProcess/PingLoad.cpp

    r239741 r239815  
    3131#include "Logging.h"
    3232#include "NetworkLoadChecker.h"
    33 #include "SessionTracker.h"
     33#include "NetworkProcess.h"
    3434#include "WebErrors.h"
    3535
     
    5757    m_timeoutTimer.startOneShot(60000_s);
    5858
    59     m_networkLoadChecker->check(ResourceRequest { m_parameters.request }, nullptr, [this] (auto&& result) {
     59    m_networkLoadChecker->check(ResourceRequest { m_parameters.request }, nullptr, [this, networkProcess = makeRef(networkProcess)] (auto&& result) {
    6060        WTF::switchOn(result,
    6161            [this] (ResourceError& error) {
     
    6666                ASSERT_NOT_REACHED();
    6767            },
    68             [this] (ResourceRequest& request) {
    69                 this->loadRequest(WTFMove(request));
     68            [&] (ResourceRequest& request) {
     69                this->loadRequest(networkProcess, WTFMove(request));
    7070            }
    7171        );
     
    8888}
    8989
    90 void PingLoad::loadRequest(ResourceRequest&& request)
     90void PingLoad::loadRequest(NetworkProcess& networkProcess, ResourceRequest&& request)
    9191{
    9292    RELEASE_LOG_IF_ALLOWED("startNetworkLoad");
    93     if (auto* networkSession = SessionTracker::networkSession(m_parameters.sessionID)) {
     93    if (auto* networkSession = networkProcess.networkSession(m_parameters.sessionID)) {
    9494        auto loadParameters = m_parameters;
    9595        loadParameters.request = WTFMove(request);
  • trunk/Source/WebKit/NetworkProcess/PingLoad.h

    r239741 r239815  
    5858    void timeoutTimerFired();
    5959
    60     void loadRequest(WebCore::ResourceRequest&&);
     60    void loadRequest(NetworkProcess&, WebCore::ResourceRequest&&);
    6161
    6262    void didFinish(const WebCore::ResourceError& = { }, const WebCore::ResourceResponse& response = { });
  • trunk/Source/WebKit/NetworkProcess/PreconnectTask.cpp

    r239007 r239815  
    3333#include "NetworkLoadParameters.h"
    3434#include "NetworkProcess.h"
    35 #include "SessionTracker.h"
    3635#include "WebErrors.h"
    3736#include <WebCore/ResourceError.h>
     
    4140using namespace WebCore;
    4241
    43 PreconnectTask::PreconnectTask(NetworkLoadParameters&& parameters, CompletionHandler<void(const ResourceError&)>&& completionHandler)
     42PreconnectTask::PreconnectTask(NetworkProcess& networkProcess, NetworkLoadParameters&& parameters, CompletionHandler<void(const ResourceError&)>&& completionHandler)
    4443    : m_completionHandler(WTFMove(completionHandler))
    4544    , m_timeoutTimer([this] { didFinish(ResourceError { String(), 0, m_networkLoad->parameters().request.url(), "Preconnection timed out"_s, ResourceError::Type::Timeout }); })
     
    4746    RELEASE_LOG(Network, "%p - PreconnectTask::PreconnectTask()", this);
    4847
    49     auto* networkSession = SessionTracker::networkSession(parameters.sessionID);
     48    auto* networkSession = networkProcess.networkSession(parameters.sessionID);
    5049    if (!networkSession) {
    5150        ASSERT_NOT_REACHED();
  • trunk/Source/WebKit/NetworkProcess/PreconnectTask.h

    r239007 r239815  
    3737class NetworkLoad;
    3838class NetworkLoadParameters;
     39class NetworkProcess;
    3940
    4041class PreconnectTask final : public NetworkLoadClient {
    4142public:
    42     explicit PreconnectTask(NetworkLoadParameters&&, CompletionHandler<void(const WebCore::ResourceError&)>&& completionHandler = { });
     43    explicit PreconnectTask(NetworkProcess&, NetworkLoadParameters&&, CompletionHandler<void(const WebCore::ResourceError&)>&& completionHandler = { });
    4344    ~PreconnectTask();
    4445
  • trunk/Source/WebKit/NetworkProcess/RemoteNetworkingContext.h

    r239680 r239815  
    3636class RemoteNetworkingContext {
    3737public:
    38     // FIXME: Remove platform-specific code and use SessionTracker.
     38    // FIXME: Remove platform-specific code.
    3939    static void ensureWebsiteDataStoreSession(NetworkProcess&, WebsiteDataStoreParameters&&);
    4040};
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp

    r239759 r239815  
    3232#include "NetworkCache.h"
    3333#include "NetworkLoad.h"
     34#include "NetworkProcess.h"
    3435#include "NetworkSession.h"
    35 #include "SessionTracker.h"
    3636#include <WebCore/NetworkStorageSession.h>
    3737#include <pal/SessionID.h>
     
    6161    parameters.contentEncodingSniffingPolicy = ContentEncodingSniffingPolicy::Sniff;
    6262    parameters.request = m_originalRequest;
    63     m_networkLoad = std::make_unique<NetworkLoad>(*this, WTFMove(parameters), *SessionTracker::networkSession(PAL::SessionID::defaultSessionID()));
     63    m_networkLoad = std::make_unique<NetworkLoad>(*this, WTFMove(parameters), *cache.networkProcess().networkSession(PAL::SessionID::defaultSessionID()));
    6464}
    6565
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm

    r239749 r239815  
    3535#import "NetworkProximityManager.h"
    3636#import "NetworkSessionCocoa.h"
    37 #import "SessionTracker.h"
    3837#import "WebCoreArgumentCoders.h"
    3938#import <WebCore/AuthenticationChallenge.h>
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm

    r239792 r239815  
    3535#import "NetworkSessionCocoa.h"
    3636#import "SandboxExtension.h"
    37 #import "SessionTracker.h"
    3837#import <WebCore/NetworkStorageSession.h>
    3938#import <WebCore/PublicSuffix.h>
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r239698 r239815  
    3636#import "NetworkProcess.h"
    3737#import "NetworkSessionCreationParameters.h"
    38 #import "SessionTracker.h"
    3938#import <Foundation/NSURLSession.h>
    4039#import <WebCore/Credential.h>
  • trunk/Source/WebKit/NetworkProcess/curl/RemoteNetworkingContextCurl.cpp

    r239680 r239815  
    2727#include "RemoteNetworkingContext.h"
    2828
     29#include "NetworkProcess.h"
    2930#include "NetworkSession.h"
    30 #include "SessionTracker.h"
    3131#include "WebsiteDataStoreParameters.h"
    3232#include <WebCore/NetworkStorageSession.h>
     
    4343
    4444    NetworkStorageSession::ensureSession(sessionID, String::number(sessionID.sessionID()));
    45     SessionTracker::setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
     45    networkProcess.setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
    4646}
    4747
  • trunk/Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm

    r239683 r239815  
    3232#import "NetworkSession.h"
    3333#import "NetworkSessionCreationParameters.h"
    34 #import "SessionTracker.h"
    3534#import "WebErrors.h"
    3635#import "WebsiteDataStoreParameters.h"
     
    6665        session->setCookie(cookie);
    6766
    68     SessionTracker::setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
     67    networkProcess.setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
    6968}
    7069
  • trunk/Source/WebKit/NetworkProcess/soup/RemoteNetworkingContextSoup.cpp

    r239680 r239815  
    3030
    3131#include "NetworkSession.h"
    32 #include "SessionTracker.h"
    3332#include "WebsiteDataStoreParameters.h"
    3433#include <WebCore/NetworkStorageSession.h>
     
    4443
    4544    NetworkStorageSession::ensureSession(sessionID, String::number(sessionID.sessionID()));
    46     SessionTracker::setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
     45    networkProcess.setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
    4746}
    4847
  • trunk/Source/WebKit/Sources.txt

    r239752 r239815  
    117117Shared/RTCPacketOptions.cpp
    118118Shared/SessionState.cpp
    119 Shared/SessionTracker.cpp
    120119Shared/ShareableBitmap.cpp @no-unify
    121120Shared/ShareableResource.cpp
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r239792 r239815  
    10891089                6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10901090                728E86F11795188C0087879E /* WebColorPickerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 728E86EF1795188C0087879E /* WebColorPickerMac.h */; };
    1091                 753E3E0E1887398900188496 /* SessionTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 753E3E091887394B00188496 /* SessionTracker.h */; };
    10921091                75A8D2C8187CCFAB00C39C9E /* WKWebsiteDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 75A8D2C4187CCF9F00C39C9E /* WKWebsiteDataStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
    10931092                75A8D2D6187D1C0E00C39C9E /* WKWebsiteDataStoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75A8D2D4187D1C0100C39C9E /* WKWebsiteDataStoreInternal.h */; };
     
    35163515                728E86EF1795188C0087879E /* WebColorPickerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPickerMac.h; sourceTree = "<group>"; };
    35173516                728E86F01795188C0087879E /* WebColorPickerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebColorPickerMac.mm; sourceTree = "<group>"; };
    3518                 753E3E091887394B00188496 /* SessionTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionTracker.h; sourceTree = "<group>"; };
    3519                 753E3E0B1887397300188496 /* SessionTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SessionTracker.cpp; sourceTree = "<group>"; };
    35203517                75A8D2C4187CCF9F00C39C9E /* WKWebsiteDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsiteDataStore.h; sourceTree = "<group>"; };
    35213518                75A8D2C5187CCF9F00C39C9E /* WKWebsiteDataStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebsiteDataStore.mm; sourceTree = "<group>"; };
     
    50725069                                1AFDE6571954A42B00C48FFA /* SessionState.cpp */,
    50735070                                1AFDE6581954A42B00C48FFA /* SessionState.h */,
    5074                                 753E3E0B1887397300188496 /* SessionTracker.cpp */,
    5075                                 753E3E091887394B00188496 /* SessionTracker.h */,
    50765071                                1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */,
    50775072                                1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */,
     
    92999294                                1AFDE65A1954A42B00C48FFA /* SessionState.h in Headers */,
    93009295                                1A002D49196B345D00B9AD44 /* SessionStateCoding.h in Headers */,
    9301                                 753E3E0E1887398900188496 /* SessionTracker.h in Headers */,
    93029296                                1A6420E512DCE2FF00CAAE2C /* ShareableBitmap.h in Headers */,
    93039297                                51217461164C20E30037A5C1 /* ShareableResource.h in Headers */,
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp

    r239737 r239815  
    3434#include "NetworkSessionCreationParameters.h"
    3535#include "NotificationPermissionRequestManager.h"
    36 #include "SessionTracker.h"
    3736#include "UserData.h"
    3837#include "WebConnectionToUIProcess.h"
     
    356355{
    357356    ASSERT(!hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies));
    358     if (enabled) {
     357    if (enabled)
    359358        WebProcess::singleton().ensureLegacyPrivateBrowsingSessionInNetworkProcess();
    360     } else
    361         SessionTracker::destroySession(PAL::SessionID::legacyPrivateSessionID());
     359    else
     360        WebProcess::singleton().destroyLegacyPrivateBrowsingSessionInNetworkProcess();
    362361
    363362    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
  • trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp

    r239634 r239815  
    3333#include "NetworkProcessConnection.h"
    3434#include "NetworkResourceLoadParameters.h"
    35 #include "SessionTracker.h"
    3635#include "SharedBufferDataReference.h"
    3736#include "WebCompiledContentRuleList.h"
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r239737 r239815  
    3535#include "NetworkResourceLoadParameters.h"
    3636#include "PluginInfoStore.h"
    37 #include "SessionTracker.h"
    3837#include "WebCoreArgumentCoders.h"
    3938#include "WebErrors.h"
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp

    r239737 r239815  
    2828
    2929#include "NetworkSession.h"
    30 #include "SessionTracker.h"
    3130#include "WebFrame.h"
    3231#include "WebPage.h"
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h

    r239737 r239815  
    4141    }
    4242
    43     // FIXME: remove platform-specific code and use SessionTracker
     43    // FIXME: remove platform-specific code.
    4444    static void ensureWebsiteDataStoreSession(WebsiteDataStoreParameters&&);
    4545
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r239737 r239815  
    2828
    2929#include "NetworkSession.h"
    30 #include "SessionTracker.h"
    3130#include "WebPage.h"
    3231#include "WebProcess.h"
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp

    r239737 r239815  
    3030#include "NetworkSession.h"
    3131#include "NetworkSessionCreationParameters.h"
    32 #include "SessionTracker.h"
    3332#include "WebFrame.h"
    3433#include "WebPage.h"
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r239777 r239815  
    5959#include "SessionState.h"
    6060#include "SessionStateConversion.h"
    61 #include "SessionTracker.h"
    6261#include "ShareSheetCallbackID.h"
    6362#include "ShareableBitmap.h"
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r239792 r239815  
    4242#include "NetworkSessionCreationParameters.h"
    4343#include "PluginProcessConnectionManager.h"
    44 #include "SessionTracker.h"
    4544#include "StatisticsData.h"
    4645#include "UserData.h"
     
    542541}
    543542
     543void WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess()
     544{
     545    ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::DestroyLegacyPrivateBrowsingSession(), 0);
     546}
     547
    544548#if ENABLE(NETSCAPE_PLUGIN_API)
    545549PluginProcessConnectionManager& WebProcess::pluginProcessConnectionManager()
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r239737 r239815  
    179179
    180180    void ensureLegacyPrivateBrowsingSessionInNetworkProcess();
     181    void destroyLegacyPrivateBrowsingSessionInNetworkProcess();
    181182
    182183    void pageDidEnterWindow(uint64_t pageID);
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r239792 r239815  
    3434#import "SandboxExtension.h"
    3535#import "SandboxInitializationParameters.h"
    36 #import "SessionTracker.h"
    3736#import "WKAPICast.h"
    3837#import "WKBrowsingContextHandleInternal.h"
Note: See TracChangeset for help on using the changeset viewer.