Changeset 162245 in webkit


Ignore:
Timestamp:
Jan 17, 2014 10:27:51 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r162237 and r162241.
http://trac.webkit.org/changeset/162237
http://trac.webkit.org/changeset/162241
https://bugs.webkit.org/show_bug.cgi?id=127216

Broke lots of API tests (Requested by ap on #webkit).

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::storageSession):
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):

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

(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
(WebKit::NetworkProcess::destroyPrivateBrowsingSession):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/RemoteNetworkingContext.h:
  • NetworkProcess/mac/RemoteNetworkingContext.mm:

(WebKit::privateBrowsingStorageSession):
(WebKit::RemoteNetworkingContext::storageSession):
(WebKit::RemoteNetworkingContext::privateBrowsingSession):
(WebKit::privateBrowsingStorageSessionIdentifierBase):
(WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):

  • NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:

(WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::privateBrowsingSession):

  • Shared/SessionTracker.cpp: Removed.
  • Shared/SessionTracker.h: Removed.
  • UIProcess/APISession.cpp:

(API::Session::Session):
(API::Session::create):
(API::Session::isEphemeral):

  • UIProcess/APISession.h:
  • UIProcess/WebContext.cpp:

(WebKit::WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::createWebPage):

  • UIProcess/WebContext.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::create):
(WebKit::WebPageProxy::WebPageProxy):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::createWebPage):

  • UIProcess/WebProcessProxy.h:
  • WebKit2.xcodeproj/project.pbxproj:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::setPrivateBrowsingEnabled):

  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):

  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:

(WebKit::privateSession):
(WebKit::identifierBase):
(WebKit::WebFrameNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::destroyPrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
(WebKit::WebFrameNetworkingContext::storageSession):

  • WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:

(WebKit::privateSession):
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::destroyPrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::storageSession):

  • WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::ensurePrivateBrowsingSession):
(WebKit::WebProcess::destroyPrivateBrowsingSession):

  • WebProcess/WebProcess.h:
  • WebProcess/WebProcess.messages.in:
Location:
trunk/Source/WebKit2
Files:
2 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/CMakeLists.txt

    r162237 r162245  
    205205    Shared/SecurityOriginData.cpp
    206206    Shared/SessionState.cpp
    207     Shared/SessionTracker.cpp
    208207    Shared/ShareableBitmap.cpp
    209208    Shared/ShareableResource.cpp
     
    295294
    296295    UIProcess/APINavigationData.cpp
    297     UIProcess/APISession.cpp
    298296    UIProcess/BackingStore.cpp
    299297    UIProcess/DrawingAreaProxy.cpp
  • trunk/Source/WebKit2/ChangeLog

    r162241 r162245  
     12014-01-17  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r162237 and r162241.
     4        http://trac.webkit.org/changeset/162237
     5        http://trac.webkit.org/changeset/162241
     6        https://bugs.webkit.org/show_bug.cgi?id=127216
     7
     8        Broke lots of API tests (Requested by ap on #webkit).
     9
     10        * CMakeLists.txt:
     11        * GNUmakefile.list.am:
     12        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     13        (WebKit::storageSession):
     14        (WebKit::NetworkConnectionToWebProcess::startDownload):
     15        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
     16        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
     17        (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
     18        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
     19        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
     20        (WebKit::NetworkConnectionToWebProcess::deleteCookie):
     21        * NetworkProcess/NetworkConnectionToWebProcess.h:
     22        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
     23        * NetworkProcess/NetworkProcess.cpp:
     24        (WebKit::NetworkProcess::initializeNetworkProcess):
     25        (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
     26        (WebKit::NetworkProcess::destroyPrivateBrowsingSession):
     27        * NetworkProcess/NetworkProcess.h:
     28        * NetworkProcess/NetworkProcess.messages.in:
     29        * NetworkProcess/RemoteNetworkingContext.h:
     30        * NetworkProcess/mac/RemoteNetworkingContext.mm:
     31        (WebKit::privateBrowsingStorageSession):
     32        (WebKit::RemoteNetworkingContext::storageSession):
     33        (WebKit::RemoteNetworkingContext::privateBrowsingSession):
     34        (WebKit::privateBrowsingStorageSessionIdentifierBase):
     35        (WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
     36        (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
     37        (WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):
     38        * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
     39        (WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
     40        (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
     41        (WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):
     42        (WebKit::RemoteNetworkingContext::privateBrowsingSession):
     43        * Shared/SessionTracker.cpp: Removed.
     44        * Shared/SessionTracker.h: Removed.
     45        * UIProcess/APISession.cpp:
     46        (API::Session::Session):
     47        (API::Session::create):
     48        (API::Session::isEphemeral):
     49        * UIProcess/APISession.h:
     50        * UIProcess/WebContext.cpp:
     51        (WebKit::WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled):
     52        (WebKit::WebContext::createNewWebProcess):
     53        (WebKit::WebContext::createWebPage):
     54        * UIProcess/WebContext.h:
     55        * UIProcess/WebPageProxy.cpp:
     56        (WebKit::WebPageProxy::create):
     57        (WebKit::WebPageProxy::WebPageProxy):
     58        * UIProcess/WebPageProxy.h:
     59        * UIProcess/WebProcessProxy.cpp:
     60        (WebKit::WebProcessProxy::createWebPage):
     61        * UIProcess/WebProcessProxy.h:
     62        * WebKit2.xcodeproj/project.pbxproj:
     63        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     64        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
     65        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     66        (WebKit::WebPlatformStrategies::cookiesForDOM):
     67        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
     68        (WebKit::WebPlatformStrategies::cookiesEnabled):
     69        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
     70        (WebKit::WebPlatformStrategies::getRawCookies):
     71        (WebKit::WebPlatformStrategies::deleteCookie):
     72        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
     73        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
     74        (WebKit::privateSession):
     75        (WebKit::identifierBase):
     76        (WebKit::WebFrameNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
     77        (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
     78        (WebKit::WebFrameNetworkingContext::destroyPrivateBrowsingSession):
     79        (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
     80        (WebKit::WebFrameNetworkingContext::storageSession):
     81        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
     82        (WebKit::privateSession):
     83        (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
     84        (WebKit::WebFrameNetworkingContext::destroyPrivateBrowsingSession):
     85        (WebKit::WebFrameNetworkingContext::storageSession):
     86        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
     87        * WebProcess/WebProcess.cpp:
     88        (WebKit::WebProcess::initializeWebProcess):
     89        (WebKit::WebProcess::ensurePrivateBrowsingSession):
     90        (WebKit::WebProcess::destroyPrivateBrowsingSession):
     91        * WebProcess/WebProcess.h:
     92        * WebProcess/WebProcess.messages.in:
     93
    1942014-01-17  Ryuan Choi  <ryuan.choi@samsung.com>
    295
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r162237 r162245  
    443443        Source/WebKit2/Shared/SessionState.cpp \
    444444        Source/WebKit2/Shared/SessionState.h \
    445         Source/WebKit2/Shared/SessionTracker.cpp \
    446         Source/WebKit2/Shared/SessionTracker.h \
    447445        Source/WebKit2/Shared/StatisticsData.cpp \
    448446        Source/WebKit2/Shared/StatisticsData.h \
  • trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r162237 r162245  
    3838#include "NetworkResourceLoaderMessages.h"
    3939#include "RemoteNetworkingContext.h"
    40 #include "SessionTracker.h"
    4140#include <WebCore/BlobData.h>
    4241#include <WebCore/PlatformCookieJar.h>
     
    149148}
    150149
    151 static NetworkStorageSession& storageSession(uint64_t sessionID)
    152 {
    153     if (SessionTracker::isEphemeralID(sessionID)) {
    154         NetworkStorageSession* privateSession = SessionTracker::session(sessionID).get();
     150static NetworkStorageSession& storageSession(bool privateBrowsingEnabled)
     151{
     152    if (privateBrowsingEnabled) {
     153        NetworkStorageSession* privateSession = RemoteNetworkingContext::privateBrowsingSession();
    155154        if (privateSession)
    156155            return *privateSession;
     
    162161}
    163162
    164 void NetworkConnectionToWebProcess::startDownload(uint64_t sessionID, uint64_t downloadID, const ResourceRequest& request)
    165 {
    166     // FIXME: Do something with the session ID.
     163void NetworkConnectionToWebProcess::startDownload(bool privateBrowsingEnabled, uint64_t downloadID, const ResourceRequest& request)
     164{
     165    // FIXME: Do something with the private browsing flag.
    167166    NetworkProcess::shared().downloadManager().startDownload(downloadID, request);
    168167}
     
    184183}
    185184
    186 void NetworkConnectionToWebProcess::cookiesForDOM(uint64_t sessionID, const URL& firstParty, const URL& url, String& result)
    187 {
    188     result = WebCore::cookiesForDOM(storageSession(sessionID), firstParty, url);
    189 }
    190 
    191 void NetworkConnectionToWebProcess::setCookiesFromDOM(uint64_t sessionID, const URL& firstParty, const URL& url, const String& cookieString)
    192 {
    193     WebCore::setCookiesFromDOM(storageSession(sessionID), firstParty, url, cookieString);
    194 }
    195 
    196 void NetworkConnectionToWebProcess::cookiesEnabled(uint64_t sessionID, const URL& firstParty, const URL& url, bool& result)
    197 {
    198     result = WebCore::cookiesEnabled(storageSession(sessionID), firstParty, url);
    199 }
    200 
    201 void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(uint64_t sessionID, const URL& firstParty, const URL& url, String& result)
    202 {
    203     result = WebCore::cookieRequestHeaderFieldValue(storageSession(sessionID), firstParty, url);
    204 }
    205 
    206 void NetworkConnectionToWebProcess::getRawCookies(uint64_t sessionID, const URL& firstParty, const URL& url, Vector<Cookie>& result)
    207 {
    208     WebCore::getRawCookies(storageSession(sessionID), firstParty, url, result);
    209 }
    210 
    211 void NetworkConnectionToWebProcess::deleteCookie(uint64_t sessionID, const URL& url, const String& cookieName)
    212 {
    213     WebCore::deleteCookie(storageSession(sessionID), url, cookieName);
     185void NetworkConnectionToWebProcess::cookiesForDOM(bool privateBrowsingEnabled, const URL& firstParty, const URL& url, String& result)
     186{
     187    result = WebCore::cookiesForDOM(storageSession(privateBrowsingEnabled), firstParty, url);
     188}
     189
     190void NetworkConnectionToWebProcess::setCookiesFromDOM(bool privateBrowsingEnabled, const URL& firstParty, const URL& url, const String& cookieString)
     191{
     192    WebCore::setCookiesFromDOM(storageSession(privateBrowsingEnabled), firstParty, url, cookieString);
     193}
     194
     195void NetworkConnectionToWebProcess::cookiesEnabled(bool privateBrowsingEnabled, const URL& firstParty, const URL& url, bool& result)
     196{
     197    result = WebCore::cookiesEnabled(storageSession(privateBrowsingEnabled), firstParty, url);
     198}
     199
     200void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(bool privateBrowsingEnabled, const URL& firstParty, const URL& url, String& result)
     201{
     202    result = WebCore::cookieRequestHeaderFieldValue(storageSession(privateBrowsingEnabled), firstParty, url);
     203}
     204
     205void NetworkConnectionToWebProcess::getRawCookies(bool privateBrowsingEnabled, const URL& firstParty, const URL& url, Vector<Cookie>& result)
     206{
     207    WebCore::getRawCookies(storageSession(privateBrowsingEnabled), firstParty, url, result);
     208}
     209
     210void NetworkConnectionToWebProcess::deleteCookie(bool privateBrowsingEnabled, const URL& url, const String& cookieName)
     211{
     212    WebCore::deleteCookie(storageSession(privateBrowsingEnabled), url, cookieName);
    214213}
    215214
  • trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h

    r162237 r162245  
    7777    void servePendingRequests(uint32_t resourceLoadPriority);
    7878    void setSerialLoadingEnabled(bool);
    79     void startDownload(uint64_t sessionID, uint64_t downloadID, const WebCore::ResourceRequest&);
     79    void startDownload(bool privateBrowsingEnabled, uint64_t downloadID, const WebCore::ResourceRequest&);
    8080    void convertMainResourceLoadToDownload(uint64_t mainResourceLoadIdentifier, uint64_t downloadID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
    8181
    82     void cookiesForDOM(uint64_t sessionID, const WebCore::URL& firstParty, const WebCore::URL&, String& result);
    83     void setCookiesFromDOM(uint64_t sessionID, const WebCore::URL& firstParty, const WebCore::URL&, const String&);
    84     void cookiesEnabled(uint64_t sessionID, const WebCore::URL& firstParty, const WebCore::URL&, bool& result);
    85     void cookieRequestHeaderFieldValue(uint64_t sessionID, const WebCore::URL& firstParty, const WebCore::URL&, String& result);
    86     void getRawCookies(uint64_t sessionID, const WebCore::URL& firstParty, const WebCore::URL&, Vector<WebCore::Cookie>&);
    87     void deleteCookie(uint64_t sessionID, const WebCore::URL&, const String& cookieName);
     82    void cookiesForDOM(bool privateBrowsingEnabled, const WebCore::URL& firstParty, const WebCore::URL&, String& result);
     83    void setCookiesFromDOM(bool privateBrowsingEnabled, const WebCore::URL& firstParty, const WebCore::URL&, const String&);
     84    void cookiesEnabled(bool privateBrowsingEnabled, const WebCore::URL& firstParty, const WebCore::URL&, bool& result);
     85    void cookieRequestHeaderFieldValue(bool privateBrowsingEnabled, const WebCore::URL& firstParty, const WebCore::URL&, String& result);
     86    void getRawCookies(bool privateBrowsingEnabled, const WebCore::URL& firstParty, const WebCore::URL&, Vector<WebCore::Cookie>&);
     87    void deleteCookie(bool privateBrowsingEnabled, const WebCore::URL&, const String& cookieName);
    8888
    8989    void registerBlobURL(const WebCore::URL&, const BlobRegistrationData&);
  • trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in

    r162237 r162245  
    3333    SetSerialLoadingEnabled(bool enabled) -> ()
    3434
    35     StartDownload(uint64_t sessionID, uint64_t downloadID, WebCore::ResourceRequest request)
     35    StartDownload(bool privateBrowsingEnabled, uint64_t downloadID, WebCore::ResourceRequest request)
    3636    ConvertMainResourceLoadToDownload(uint64_t mainResourceLoadIdentifier, uint64_t downloadID, WebCore::ResourceRequest request, WebCore::ResourceResponse response)
    3737
    38     CookiesForDOM(uint64_t sessionID, WebCore::URL firstParty, WebCore::URL url) -> (String result)
    39     SetCookiesFromDOM(uint64_t sessionID, WebCore::URL firstParty, WebCore::URL url, String cookieString)
    40     CookiesEnabled(uint64_t sessionID, WebCore::URL firstParty, WebCore::URL url) -> (bool enabled)
    41     CookieRequestHeaderFieldValue(uint64_t sessionID, WebCore::URL firstParty, WebCore::URL url) -> (String result)
    42     GetRawCookies(uint64_t sessionID, WebCore::URL firstParty, WebCore::URL url) -> (Vector<WebCore::Cookie> cookies)
    43     DeleteCookie(uint64_t sessionID, WebCore::URL url, String cookieName)
     38    CookiesForDOM(bool privateBrowsingEnabled, WebCore::URL firstParty, WebCore::URL url) -> (String result)
     39    SetCookiesFromDOM(bool privateBrowsingEnabled, WebCore::URL firstParty, WebCore::URL url, String cookieString)
     40    CookiesEnabled(bool privateBrowsingEnabled, WebCore::URL firstParty, WebCore::URL url) -> (bool enabled)
     41    CookieRequestHeaderFieldValue(bool privateBrowsingEnabled, WebCore::URL firstParty, WebCore::URL url) -> (String result)
     42    GetRawCookies(bool privateBrowsingEnabled, WebCore::URL firstParty, WebCore::URL url) -> (Vector<WebCore::Cookie> cookies)
     43    DeleteCookie(bool privateBrowsingEnabled, WebCore::URL url, String cookieName)
    4444
    4545    RegisterBlobURL(WebCore::URL url, WebKit::BlobRegistrationData data)
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp

    r162237 r162245  
    4040#include "NetworkResourceLoader.h"
    4141#include "RemoteNetworkingContext.h"
    42 #include "SessionTracker.h"
    4342#include "StatisticsData.h"
    4443#include "WebContextMessages.h"
     
    159158
    160159#if PLATFORM(MAC) || USE(CFNETWORK)
    161     SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
    162 #endif
    163 
    164     // FIXME: instead of handling this here, a message should be sent later (scales to multiple sessions)
     160    RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase(parameters.uiProcessBundleIdentifier);
     161#endif
     162
    165163    if (parameters.privateBrowsingEnabled)
    166         RemoteNetworkingContext::ensurePrivateBrowsingSession(SessionTracker::legacyPrivateSessionID);
     164        RemoteNetworkingContext::ensurePrivateBrowsingSession();
    167165
    168166    if (parameters.shouldUseTestingNetworkSession)
     
    215213}
    216214
    217 void NetworkProcess::ensurePrivateBrowsingSession(uint64_t sessionID)
    218 {
    219     RemoteNetworkingContext::ensurePrivateBrowsingSession(sessionID);
    220 }
    221 
    222 void NetworkProcess::destroyPrivateBrowsingSession(uint64_t sessionID)
    223 {
    224     SessionTracker::destroySession(sessionID);
     215void NetworkProcess::ensurePrivateBrowsingSession()
     216{
     217    RemoteNetworkingContext::ensurePrivateBrowsingSession();
     218}
     219
     220void NetworkProcess::destroyPrivateBrowsingSession()
     221{
     222    RemoteNetworkingContext::destroyPrivateBrowsingSession();
    225223}
    226224
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h

    r162237 r162245  
    105105    void initializeNetworkProcess(const NetworkProcessCreationParameters&);
    106106    void createNetworkConnectionToWebProcess();
    107     void ensurePrivateBrowsingSession(uint64_t sessionID);
    108     void destroyPrivateBrowsingSession(uint64_t sessionID);
     107    void ensurePrivateBrowsingSession();
     108    void destroyPrivateBrowsingSession();
    109109    void downloadRequest(uint64_t downloadID, const WebCore::ResourceRequest&);
    110110    void cancelDownload(uint64_t downloadID);
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in

    r162237 r162245  
    3535#endif
    3636
    37     EnsurePrivateBrowsingSession(uint64_t sessionID)
    38     DestroyPrivateBrowsingSession(uint64_t sessionID)
     37    EnsurePrivateBrowsingSession()
     38    DestroyPrivateBrowsingSession()
    3939
    4040    DownloadRequest(uint64_t downloadID, WebCore::ResourceRequest request)
  • trunk/Source/WebKit2/NetworkProcess/RemoteNetworkingContext.h

    r162237 r162245  
    4040    virtual ~RemoteNetworkingContext();
    4141
    42     // FIXME: remove platform-specific code and use SessionTracker
    43     static void ensurePrivateBrowsingSession(uint64_t sessionID);
     42    static void setPrivateBrowsingStorageSessionIdentifierBase(const String&);
     43    static void ensurePrivateBrowsingSession();
     44    static void destroyPrivateBrowsingSession();
     45
     46    static WebCore::NetworkStorageSession* privateBrowsingSession();
    4447
    4548    virtual bool shouldClearReferrerOnHTTPSToHTTPRedirect() const override { return m_shouldClearReferrerOnHTTPSToHTTPRedirect; }
  • trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm

    r162237 r162245  
    2727#import "RemoteNetworkingContext.h"
    2828
    29 #import "SessionTracker.h"
    3029#import "WebErrors.h"
    3130#import <WebCore/ResourceError.h>
     
    3837namespace WebKit {
    3938
     39static std::unique_ptr<NetworkStorageSession>& privateBrowsingStorageSession()
     40{
     41    ASSERT(isMainThread());
     42    static NeverDestroyed<std::unique_ptr<NetworkStorageSession>> session;
     43    return session;
     44}
    4045
    4146RemoteNetworkingContext::~RemoteNetworkingContext()
     
    6166{
    6267    if (m_privateBrowsingEnabled) {
    63         NetworkStorageSession* privateSession = SessionTracker::session(SessionTracker::legacyPrivateSessionID).get();
     68        NetworkStorageSession* privateSession = privateBrowsingStorageSession().get();
    6469        if (privateSession)
    6570            return *privateSession;
     
    7075
    7176    return NetworkStorageSession::defaultStorageSession();
     77}
     78
     79NetworkStorageSession* RemoteNetworkingContext::privateBrowsingSession()
     80{
     81    return privateBrowsingStorageSession().get();
    7282}
    7383
     
    8292}
    8393
    84 void RemoteNetworkingContext::ensurePrivateBrowsingSession(uint64_t sessionID)
     94static String& privateBrowsingStorageSessionIdentifierBase()
    8595{
    86     if (SessionTracker::session(sessionID))
     96    ASSERT(isMainThread());
     97    static NeverDestroyed<String> base;
     98    return base;
     99}
     100
     101void RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase(const String& identifier)
     102{
     103    privateBrowsingStorageSessionIdentifierBase() = identifier;
     104}
     105
     106void RemoteNetworkingContext::ensurePrivateBrowsingSession()
     107{
     108    if (privateBrowsingStorageSession())
    87109        return;
    88110
    89     ASSERT(!SessionTracker::getIdentifierBase().isNull());
    90     SessionTracker::session(sessionID) = NetworkStorageSession::createPrivateBrowsingSession(SessionTracker::getIdentifierBase() + '.' + String::number(sessionID));
     111    ASSERT(!privateBrowsingStorageSessionIdentifierBase().isNull());
     112    RetainPtr<CFStringRef> cfIdentifier = String(privateBrowsingStorageSessionIdentifierBase() + ".PrivateBrowsing").createCFString();
     113
     114    privateBrowsingStorageSession() = std::move(NetworkStorageSession::createPrivateBrowsingSession(privateBrowsingStorageSessionIdentifierBase()));
     115}
     116
     117void RemoteNetworkingContext::destroyPrivateBrowsingSession()
     118{
     119    privateBrowsingStorageSession() = nullptr;
    91120}
    92121
  • trunk/Source/WebKit2/NetworkProcess/soup/RemoteNetworkingContextSoup.cpp

    r162237 r162245  
    5353}
    5454
    55 void RemoteNetworkingContext::ensurePrivateBrowsingSession(uint64_t sessionID)
     55void RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase(const String&)
    5656{
    5757    notImplemented();
     58}
     59
     60void RemoteNetworkingContext::ensurePrivateBrowsingSession()
     61{
     62    notImplemented();
     63}
     64
     65void RemoteNetworkingContext::destroyPrivateBrowsingSession()
     66{
    5867}
    5968
     
    6372}
    6473
     74NetworkStorageSession* RemoteNetworkingContext::privateBrowsingSession()
     75{
     76    notImplemented();
     77    return &NetworkStorageSession::defaultStorageSession();
     78}
     79
    6580}
    6681
  • trunk/Source/WebKit2/UIProcess/APISession.cpp

    r162237 r162245  
    2727#include "APISession.h"
    2828
    29 #include <wtf/MainThread.h>
    30 
    3129namespace API {
    32 
    33 static uint64_t generateID(bool isEphemeral)
    34 {
    35     ASSERT(isMainThread());
    36 
    37     static uint64_t uniqueSessionID = WebKit::SessionTracker::legacyPrivateSessionID;
    38     ASSERT(isEphemeral);
    39     return ++uniqueSessionID;
    40 }
    41 
    42 Session& Session::defaultSession()
    43 {
    44     ASSERT(isMainThread());
    45 
    46     static Session* defaultSession = new Session(false, WebKit::SessionTracker::defaultSessionID);
    47     return *defaultSession;
    48 }
    49 
    50 Session& Session::legacyPrivateSession()
    51 {
    52     ASSERT(isMainThread());
    53 
    54     static Session* legacyPrivateSession = new Session(true, WebKit::SessionTracker::legacyPrivateSessionID);
    55     return *legacyPrivateSession;
    56 }
    5730
    5831Session::Session(bool isEphemeral)
    5932    : m_isEphemeral(isEphemeral)
    60     , m_sessionID(generateID(isEphemeral))
    61 {
    62 }
    63 
    64 Session::Session(bool isEphemeral, uint64_t sessionID)
    65     : m_isEphemeral(isEphemeral)
    66     , m_sessionID(sessionID)
    6733{
    6834}
     
    7036PassRefPtr<Session> Session::create(bool isEphemeral)
    7137{
    72     // FIXME: support creation of non-default, non-ephemeral sessions
    7338    return adoptRef(new Session(isEphemeral));
    7439}
    7540
    76 bool Session::isEphemeral() const
     41bool Session::isEphemeral()
    7742{
    7843    return m_isEphemeral;
    79 }
    80 
    81 uint64_t Session::getID() const
    82 {
    83     return m_sessionID;
    8444}
    8545
  • trunk/Source/WebKit2/UIProcess/APISession.h

    r162237 r162245  
    2828
    2929#include "APIObject.h"
    30 #include "SessionTracker.h"
    3130#include <wtf/PassRefPtr.h>
    3231
     
    3635public:
    3736    static PassRefPtr<Session> create(bool isEphemeral);
    38     static Session& defaultSession();
    39     static Session& legacyPrivateSession();
    40     bool isEphemeral() const;
    41     uint64_t getID() const;
     37    bool isEphemeral();
    4238    virtual ~Session();
    4339
    4440private:
    4541    explicit Session(bool isEphemeral);
    46     Session(bool isEphemeral, uint64_t sessionID);
    4742    bool m_isEphemeral;
    48     uint64_t m_sessionID;
    4943};
    5044
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r162237 r162245  
    3333#include "MutableDictionary.h"
    3434#include "SandboxExtension.h"
    35 #include "SessionTracker.h"
    3635#include "StatisticsData.h"
    3736#include "TextChecker.h"
     
    469468    if (usesNetworkProcess() && networkProcess()) {
    470469        if (privateBrowsingEnabled)
    471             networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession(SessionTracker::legacyPrivateSessionID), 0);
     470            networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession(), 0);
    472471        else
    473             networkProcess()->send(Messages::NetworkProcess::DestroyPrivateBrowsingSession(SessionTracker::legacyPrivateSessionID), 0);
     472            networkProcess()->send(Messages::NetworkProcess::DestroyPrivateBrowsingSession(), 0);
    474473    }
    475474#endif // ENABLED(NETWORK_PROCESS)
    476475
    477476    if (privateBrowsingEnabled)
    478         sendToAllProcesses(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionTracker::legacyPrivateSessionID));
     477        sendToAllProcesses(Messages::WebProcess::EnsurePrivateBrowsingSession());
    479478    else
    480         sendToAllProcesses(Messages::WebProcess::DestroyPrivateBrowsingSession(SessionTracker::legacyPrivateSessionID));
     479        sendToAllProcesses(Messages::WebProcess::DestroyPrivateBrowsingSession());
    481480}
    482481
     
    599598
    600599    if (WebPreferences::anyPageGroupsAreUsingPrivateBrowsing())
    601         process->send(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionTracker::legacyPrivateSessionID), 0);
     600        process->send(Messages::WebProcess::EnsurePrivateBrowsingSession(), 0);
    602601
    603602    m_processes.append(process);
     
    742741}
    743742
    744 PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient& pageClient, WebPageGroup* pageGroup, API::Session& session, WebPageProxy* relatedPage)
     743PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient& pageClient, WebPageGroup* pageGroup, WebPageProxy* relatedPage)
    745744{
    746745    RefPtr<WebProcessProxy> process;
     
    758757    }
    759758
    760     return process->createWebPage(pageClient, pageGroup ? *pageGroup : m_defaultPageGroup.get(), session);
    761 }
    762 
    763 PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient& pageClient, WebPageGroup* pageGroup, WebPageProxy* relatedPage)
    764 {
    765     return createWebPage(pageClient, pageGroup, pageGroup->preferences()->privateBrowsingEnabled() ? API::Session::legacyPrivateSession() : API::Session::defaultSession(), relatedPage);
     759    return process->createWebPage(pageClient, pageGroup ? *pageGroup : m_defaultPageGroup.get());
    766760}
    767761
  • trunk/Source/WebKit2/UIProcess/WebContext.h

    r162237 r162245  
    150150    StorageManager& storageManager() const { return *m_storageManager; }
    151151
    152     PassRefPtr<WebPageProxy> createWebPage(PageClient&, WebPageGroup*, API::Session&, WebPageProxy* relatedPage = 0);
    153152    PassRefPtr<WebPageProxy> createWebPage(PageClient&, WebPageGroup*, WebPageProxy* relatedPage = 0);
    154153
     
    293292    static void willStartUsingPrivateBrowsing();
    294293    static void willStopUsingPrivateBrowsing();
    295 
    296     static bool isEphemeralSession(uint64_t sessionID);
    297294
    298295#if USE(SOUP)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r162237 r162245  
    229229#endif // !LOG_DISABLED
    230230
    231 PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, API::Session& session, uint64_t pageID)
    232 {
    233     return adoptRef(new WebPageProxy(pageClient, process, pageGroup, session, pageID));
    234 }
    235 
    236 WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, API::Session& session, uint64_t pageID)
     231PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, uint64_t pageID)
     232{
     233    return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID));
     234}
     235
     236WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, uint64_t pageID)
    237237    : m_pageClient(pageClient)
    238238    , m_process(process)
     
    280280#endif
    281281    , m_pageID(pageID)
    282     , m_session(session)
    283282    , m_isPageSuspended(false)
    284283#if PLATFORM(MAC)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r162237 r162245  
    2828
    2929#include "APIObject.h"
    30 #include "APISession.h"
    3130#include "AutoCorrectionCallback.h"
    3231#include "Connection.h"
     
    7675#include <wtf/PassOwnPtr.h>
    7776#include <wtf/PassRefPtr.h>
    78 #include <wtf/Ref.h>
    7977#include <wtf/RefPtr.h>
    8078#include <wtf/Vector.h>
     
    330328public:
    331329
    332     static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, API::Session&, uint64_t pageID);
     330    static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, uint64_t pageID);
    333331    virtual ~WebPageProxy();
    334332
    335333    uint64_t pageID() const { return m_pageID; }
    336     uint64_t sessionID() const { return m_session->getID(); }
    337334
    338335    WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
     
    859856       
    860857private:
    861     WebPageProxy(PageClient&, WebProcessProxy&, WebPageGroup&, API::Session&, uint64_t pageID);
     858    WebPageProxy(PageClient&, WebProcessProxy&, WebPageGroup&, uint64_t pageID);
    862859    void platformInitialize();
    863860
     
    13161313
    13171314    uint64_t m_pageID;
    1318     Ref<API::Session> m_session;
    13191315
    13201316    bool m_isPageSuspended;
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r162237 r162245  
    168168}
    169169
    170 PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient& pageClient, WebPageGroup& pageGroup, API::Session& session)
     170PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient& pageClient, WebPageGroup& pageGroup)
    171171{
    172172    uint64_t pageID = generatePageID();
    173     RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, *this, pageGroup, session, pageID);
     173    RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, *this, pageGroup, pageID);
    174174    m_pageMap.set(pageID, webPage.get());
    175175    globalPageMap().set(pageID, webPage.get());
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.h

    r162237 r162245  
    2727#define WebProcessProxy_h
    2828
    29 #include "APISession.h"
    3029#include "ChildProcessProxy.h"
    3130#include "MessageReceiverMap.h"
     
    7978
    8079    static WebPageProxy* webPage(uint64_t pageID);
    81     PassRefPtr<WebPageProxy> createWebPage(PageClient&, WebPageGroup&, API::Session&);
     80    PassRefPtr<WebPageProxy> createWebPage(PageClient&, WebPageGroup&);
    8281    void addExistingWebPage(WebPageProxy*, uint64_t pageID);
    8382    void removeWebPage(uint64_t pageID);
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r162237 r162245  
    786786                728E86F11795188C0087879E /* WebColorPickerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 728E86EF1795188C0087879E /* WebColorPickerMac.h */; };
    787787                728E86F21795188C0087879E /* WebColorPickerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 728E86F01795188C0087879E /* WebColorPickerMac.mm */; };
    788                 753E3E0D1887398500188496 /* SessionTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 753E3E0B1887397300188496 /* SessionTracker.cpp */; };
    789                 753E3E0E1887398900188496 /* SessionTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 753E3E091887394B00188496 /* SessionTracker.h */; };
    790788                755422BD18062BB20046F6A8 /* WKOriginDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 755422B918062B9C0046F6A8 /* WKOriginDataManager.cpp */; };
    791789                755422C418062BF90046F6A8 /* WebOriginDataManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 755422BE18062BE40046F6A8 /* WebOriginDataManagerProxy.cpp */; };
     
    24672465                728E86EF1795188C0087879E /* WebColorPickerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPickerMac.h; sourceTree = "<group>"; };
    24682466                728E86F01795188C0087879E /* WebColorPickerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebColorPickerMac.mm; sourceTree = "<group>"; };
    2469                 753E3E091887394B00188496 /* SessionTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionTracker.h; sourceTree = "<group>"; };
    2470                 753E3E0B1887397300188496 /* SessionTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SessionTracker.cpp; sourceTree = "<group>"; };
    24712467                755422B918062B9C0046F6A8 /* WKOriginDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKOriginDataManager.cpp; sourceTree = "<group>"; };
    24722468                755422BA18062B9C0046F6A8 /* WKOriginDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOriginDataManager.h; sourceTree = "<group>"; };
     
    37293725                                518D2CC812D51DFB003BB93B /* SessionState.cpp */,
    37303726                                518D2CC912D51DFB003BB93B /* SessionState.h */,
    3731                                 753E3E0B1887397300188496 /* SessionTracker.cpp */,
    3732                                 753E3E091887394B00188496 /* SessionTracker.h */,
    37333727                                1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */,
    37343728                                1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */,
     
    66526646                                BC40760C124FF0270068F20A /* WKURLRequest.h in Headers */,
    66536647                                BC407629124FF0400068F20A /* WKURLRequestNS.h in Headers */,
    6654                                 753E3E0E1887398900188496 /* SessionTracker.h in Headers */,
    66556648                                BC40760E124FF0270068F20A /* WKURLResponse.h in Headers */,
    66566649                                759CCD5A1808F6160078E8A8 /* WebOriginDataManagerProxy.h in Headers */,
     
    79117904                                BC498630124D18C100D834E1 /* WKBundleHitTestResult.cpp in Sources */,
    79127905                                6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */,
    7913                                 753E3E0D1887398500188496 /* SessionTracker.cpp in Sources */,
    79147906                                BC7043CD12F75EE0006472B9 /* WKBundleNavigationAction.cpp in Sources */,
    79157907                                BC4BEFE2120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp in Sources */,
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r162237 r162245  
    3333#include "LayerTreeHost.h"
    3434#include "NotificationPermissionRequestManager.h"
    35 #include "SessionTracker.h"
    3635#include "WKAPICast.h"
    3736#include "WKBundleAPICast.h"
     
    301300#if PLATFORM(MAC) || USE(CFNETWORK) || USE(SOUP)
    302301    if (enabled)
    303         WebFrameNetworkingContext::ensurePrivateBrowsingSession(SessionTracker::legacyPrivateSessionID);
     302        WebFrameNetworkingContext::ensurePrivateBrowsingSession();
    304303    else
    305         SessionTracker::destroySession(SessionTracker::legacyPrivateSessionID);
     304        WebFrameNetworkingContext::destroyPrivateBrowsingSession();
    306305#endif
    307306    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r162241 r162245  
    3131#include "NetworkResourceLoadParameters.h"
    3232#include "PluginInfoStore.h"
    33 #include "SessionTracker.h"
    3433#include "StorageNamespaceImpl.h"
    3534#include "WebContextMessages.h"
     
    7473namespace WebKit {
    7574
    76 #if ENABLE(NETWORK_PROCESS)
    77 static uint64_t legacySessionID(const NetworkStorageSession &session)
    78 {
    79     return session.isPrivateBrowsingSession() ? SessionTracker::legacyPrivateSessionID : SessionTracker::defaultSessionID;
    80 }
    81 #endif
    82 
    8375void WebPlatformStrategies::initialize()
    8476{
     
    142134    if (WebProcess::shared().usesNetworkProcess()) {
    143135        String result;
    144         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
     136        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(session.isPrivateBrowsingSession(), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
    145137            return String();
    146138        return result;
     
    155147#if ENABLE(NETWORK_PROCESS)
    156148    if (WebProcess::shared().usesNetworkProcess()) {
    157         WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(legacySessionID(session), firstParty, url, cookieString), 0);
     149        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(session.isPrivateBrowsingSession(), firstParty, url, cookieString), 0);
    158150        return;
    159151    }
     
    168160    if (WebProcess::shared().usesNetworkProcess()) {
    169161        bool result;
    170         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
     162        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(session.isPrivateBrowsingSession(), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
    171163            return false;
    172164        return result;
     
    182174    if (WebProcess::shared().usesNetworkProcess()) {
    183175        String result;
    184         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
     176        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(session.isPrivateBrowsingSession(), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
    185177            return String();
    186178        return result;
     
    195187#if ENABLE(NETWORK_PROCESS)
    196188    if (WebProcess::shared().usesNetworkProcess()) {
    197         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
     189        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(session.isPrivateBrowsingSession(), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
    198190            return false;
    199191        return true;
     
    208200#if ENABLE(NETWORK_PROCESS)
    209201    if (WebProcess::shared().usesNetworkProcess()) {
    210         WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(legacySessionID(session), url, cookieName), 0);
     202        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(session.isPrivateBrowsingSession(), url, cookieName), 0);
    211203        return;
    212204    }
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h

    r162237 r162245  
    4040    }
    4141
    42     // FIXME: remove platform-specific code and use SessionTracker
    43     static void ensurePrivateBrowsingSession(uint64_t sessionID);
    44 
     42    static void setPrivateBrowsingStorageSessionIdentifierBase(const String&);
     43    static void ensurePrivateBrowsingSession();
     44    static void destroyPrivateBrowsingSession();
    4545    static void setCookieAcceptPolicyForAllContexts(HTTPCookieAcceptPolicy);
    4646
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r162237 r162245  
    2525
    2626#include "config.h"
    27 
    28 #include "SessionTracker.h"
    2927#include "WebCookieManager.h"
    3028#include "WebFrameNetworkingContext.h"
     
    3735#include <WebCore/Settings.h>
    3836#include <WebKitSystemInterface.h>
     37#include <wtf/NeverDestroyed.h>
    3938
    4039using namespace WebCore;
    4140
    4241namespace WebKit {
     42
     43static std::unique_ptr<NetworkStorageSession>& privateSession()
     44{
     45    static NeverDestroyed<std::unique_ptr<NetworkStorageSession>> session;
     46    return session;
     47}
     48
     49static String& identifierBase()
     50{
     51    static NeverDestroyed<String> base;
     52    return base;
     53}
    4354   
    44 void WebFrameNetworkingContext::ensurePrivateBrowsingSession(uint64_t sessionID)
     55void WebFrameNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase(const String& base)
    4556{
    46     if (SessionTracker::session(sessionID))
     57    ASSERT(isMainThread());
     58
     59    identifierBase() = base;
     60}
     61
     62void WebFrameNetworkingContext::ensurePrivateBrowsingSession()
     63{
     64    ASSERT(isMainThread());
     65
     66    if (privateSession())
    4767        return;
    4868
    4969    String base;
    50     if (SessionTracker::getIdentifierBase().isNull())
     70    if (identifierBase().isNull())
    5171        base = [[NSBundle mainBundle] bundleIdentifier];
    5272    else
    53         base = SessionTracker::getIdentifierBase();
     73        base = identifierBase();
    5474
    55     SessionTracker::session(sessionID) = NetworkStorageSession::createPrivateBrowsingSession(base + '.' + String::number(sessionID));
     75    privateSession() = NetworkStorageSession::createPrivateBrowsingSession(base);
     76}
     77
     78void WebFrameNetworkingContext::destroyPrivateBrowsingSession()
     79{
     80    ASSERT(isMainThread());
     81
     82    privateSession() = nullptr;
    5683}
    5784
     
    6390        WKSetHTTPCookieAcceptPolicy(cookieStorage.get(), policy);
    6491
    65     for (const auto& session : SessionTracker::getSessionMap().values()) {
    66         if (session)
    67             WKSetHTTPCookieAcceptPolicy(session->cookieStorage().get(), policy);
    68     }
     92    if (privateSession())
     93        WKSetHTTPCookieAcceptPolicy(privateSession()->cookieStorage().get(), policy);
    6994}
    7095   
     
    101126
    102127    if (frame() && frame()->settings().privateBrowsingEnabled())
    103         return *SessionTracker::session(SessionTracker::legacyPrivateSessionID);
     128        return *privateSession();
    104129
    105130    return NetworkStorageSession::defaultStorageSession();
    106131}
     132   
    107133WebFrameLoaderClient* WebFrameNetworkingContext::webFrameLoaderClient() const
    108134{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp

    r162237 r162245  
    2828#include "WebFrameNetworkingContext.h"
    2929
    30 #include "SessionTracker.h"
    3130#include "WebFrame.h"
    3231#include "WebPage.h"
     
    3837namespace WebKit {
    3938
    40 void WebFrameNetworkingContext::ensurePrivateBrowsingSession(uint64_t sessionID)
     39static std::unique_ptr<NetworkStorageSession>& privateSession()
     40{
     41    static NeverDestroyed<std::unique_ptr<NetworkStorageSession>> session;
     42    return session;
     43}
     44
     45void WebFrameNetworkingContext::ensurePrivateBrowsingSession()
    4146{
    4247    ASSERT(isMainThread());
    4348
    44     if (SessionTracker::session(sessionID))
     49    if (privateSession())
    4550        return;
    4651
    47     SessionTracker::session(sessionID) = NetworkStorageSession::createPrivateBrowsingSession(String::number(sessionID));
     52    privateSession() = NetworkStorageSession::createPrivateBrowsingSession();
     53}
     54
     55void WebFrameNetworkingContext::destroyPrivateBrowsingSession()
     56{
     57    ASSERT(isMainThread());
     58
     59    privateSession() = nullptr;
    4860}
    4961
     
    5971{
    6072    if (frame() && frame()->settings().privateBrowsingEnabled())
    61         return *SessionTracker::session(SessionTracker::legacyPrivateSessionID);
     73        return *privateSession();
    6274
    6375    return NetworkStorageSession::defaultStorageSession();
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h

    r162237 r162245  
    4343    }
    4444
    45     static void ensurePrivateBrowsingSession(uint64_t sessionID);
     45    static void ensurePrivateBrowsingSession();
     46    static void destroyPrivateBrowsingSession();
    4647
    4748    WebFrameLoaderClient* webFrameLoaderClient() const;
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r162237 r162245  
    3434#include "Logging.h"
    3535#include "PluginProcessConnectionManager.h"
    36 #include "SessionTracker.h"
    3736#include "StatisticsData.h"
    3837#include "UserData.h"
     
    337336
    338337#if PLATFORM(MAC) || USE(CFNETWORK)
    339     SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
     338    WebFrameNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase(parameters.uiProcessBundleIdentifier);
    340339#endif
    341340
     
    454453}
    455454
    456 void WebProcess::ensurePrivateBrowsingSession(uint64_t sessionID)
     455void WebProcess::ensurePrivateBrowsingSession()
    457456{
    458457#if PLATFORM(MAC) || USE(CFNETWORK) || USE(SOUP)
    459     WebFrameNetworkingContext::ensurePrivateBrowsingSession(sessionID);
    460 #endif
    461 }
    462 
    463 void WebProcess::destroyPrivateBrowsingSession(uint64_t sessionID)
     458    WebFrameNetworkingContext::ensurePrivateBrowsingSession();
     459#endif
     460}
     461
     462void WebProcess::destroyPrivateBrowsingSession()
    464463{
    465464#if PLATFORM(MAC) || USE(CFNETWORK) || USE(SOUP)
    466     SessionTracker::destroySession(sessionID);
     465    WebFrameNetworkingContext::destroyPrivateBrowsingSession();
    467466#endif
    468467}
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r162237 r162245  
    166166    void setCacheModel(uint32_t);
    167167
    168     void ensurePrivateBrowsingSession(uint64_t sessionID);
    169     void destroyPrivateBrowsingSession(uint64_t sessionID);
    170 
     168    void ensurePrivateBrowsingSession();
     169    void destroyPrivateBrowsingSession();
     170   
    171171    void pageDidEnterWindow(uint64_t pageID);
    172172    void pageWillLeaveWindow(uint64_t pageID);
  • trunk/Source/WebKit2/WebProcess/WebProcess.messages.in

    r162237 r162245  
    5252#endif
    5353
    54     // Legacy private browsing session is per process. Individual pages or page groups may use the private session or the default one as appropriate.
    55     EnsurePrivateBrowsingSession(uint64_t sessionID)
    56     DestroyPrivateBrowsingSession(uint64_t sessionID)
     54    // Private browsing session is per process. Individual pages or page groups may use the private session or the default one as appropriate.
     55    EnsurePrivateBrowsingSession()
     56    DestroyPrivateBrowsingSession()
    5757
    5858    # Plug-ins.
Note: See TracChangeset for help on using the changeset viewer.