Changeset 163150 in webkit


Ignore:
Timestamp:
Jan 30, 2014 7:16:21 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r163125.
http://trac.webkit.org/changeset/163125
https://bugs.webkit.org/show_bug.cgi?id=127980

caused 9 layout tests to assert and crash (Requested by estes
on #webkit).

  • NetworkProcess/mac/RemoteNetworkingContext.mm:

(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):

  • Shared/SessionTracker.cpp:

(WebKit::SessionTracker::session):
(WebKit::SessionTracker::setSession):
(WebKit::SessionTracker::destroySession):

  • Shared/SessionTracker.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::setSession):

  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

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

  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:

(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):

  • WebProcess/WebPage/WebPage.cpp:
  • WebProcess/WebPage/WebPage.h:

(WebKit::WebPage::setSessionID):

Location:
trunk/Source/WebKit2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r163149 r163150  
     12014-01-30  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r163125.
     4        http://trac.webkit.org/changeset/163125
     5        https://bugs.webkit.org/show_bug.cgi?id=127980
     6
     7        caused 9 layout tests to assert and crash (Requested by estes
     8        on #webkit).
     9
     10        * NetworkProcess/mac/RemoteNetworkingContext.mm:
     11        (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
     12        * Shared/SessionTracker.cpp:
     13        (WebKit::SessionTracker::session):
     14        (WebKit::SessionTracker::setSession):
     15        (WebKit::SessionTracker::destroySession):
     16        * Shared/SessionTracker.h:
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::setSession):
     19        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     20        (WebKit::legacySessionID):
     21        (WebKit::WebPlatformStrategies::cookiesForDOM):
     22        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
     23        (WebKit::WebPlatformStrategies::cookiesEnabled):
     24        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
     25        (WebKit::WebPlatformStrategies::getRawCookies):
     26        (WebKit::WebPlatformStrategies::deleteCookie):
     27        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
     28        (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
     29        * WebProcess/WebPage/WebPage.cpp:
     30        * WebProcess/WebPage/WebPage.h:
     31        (WebKit::WebPage::setSessionID):
     32
    1332014-01-30  Anders Carlsson  <andersca@apple.com>
    234
  • trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm

    r163125 r163150  
    8080void RemoteNetworkingContext::ensurePrivateBrowsingSession(uint64_t sessionID)
    8181{
    82     ASSERT(SessionTracker::isEphemeralID(sessionID));
    83 
    8482    if (SessionTracker::session(sessionID))
    8583        return;
  • trunk/Source/WebKit2/Shared/SessionTracker.cpp

    r163125 r163150  
    4545}
    4646
    47 static HashMap<const NetworkStorageSession*, uint64_t>& storageSessionToID()
    48 {
    49     ASSERT(isMainThread());
    50 
    51     static NeverDestroyed<HashMap<const NetworkStorageSession*, uint64_t>> map;
    52     return map.get();
    53 }
    54 
    5547static String& identifierBase()
    5648{
     
    7567    if (sessionID == defaultSessionID)
    7668        return &NetworkStorageSession::defaultStorageSession();
    77     return staticSessionMap().get(sessionID);
    78 }
    79 
    80 uint64_t SessionTracker::sessionID(const NetworkStorageSession& session)
    81 {
    82     if (&session == &NetworkStorageSession::defaultStorageSession())
    83         return defaultSessionID;
    84     return storageSessionToID().get(&session);
     69    return staticSessionMap().add(sessionID, nullptr).iterator->value.get();
    8570}
    8671
     
    8873{
    8974    ASSERT(sessionID != defaultSessionID);
    90     storageSessionToID().set(session.get(), sessionID);
    91     staticSessionMap().set(sessionID, std::move(session));
     75    staticSessionMap().add(sessionID, nullptr).iterator->value = std::move(session);
    9276}
    9377
     
    9680    ASSERT(isMainThread());
    9781
    98     storageSessionToID().remove(session(sessionID));
    9982    staticSessionMap().remove(sessionID);
    10083}
  • trunk/Source/WebKit2/Shared/SessionTracker.h

    r163125 r163150  
    4444    static const String& getIdentifierBase();
    4545    static WebCore::NetworkStorageSession* session(uint64_t sessionID);
    46     static uint64_t sessionID(const WebCore::NetworkStorageSession&);
    4746    static void setSession(uint64_t sessionID, std::unique_ptr<WebCore::NetworkStorageSession>);
    4847    static void destroySession(uint64_t sessionID);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r163149 r163150  
    513513
    514514#if ENABLE(NETWORK_PROCESS)
    515     if (session.isEphemeral())
    516         m_process->context().sendToNetworkingProcess(Messages::NetworkProcess::EnsurePrivateBrowsingSession(session.getID()));
     515    m_process->context().sendToNetworkingProcess(Messages::NetworkProcess::EnsurePrivateBrowsingSession(session.getID()));
    517516#endif
    518517}
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r163125 r163150  
    7474namespace WebKit {
    7575
     76#if ENABLE(NETWORK_PROCESS)
     77static uint64_t legacySessionID(const NetworkStorageSession &session)
     78{
     79    return session.isPrivateBrowsingSession() ? SessionTracker::legacyPrivateSessionID : SessionTracker::defaultSessionID;
     80}
     81#endif
     82
    7683void WebPlatformStrategies::initialize()
    7784{
     
    135142    if (WebProcess::shared().usesNetworkProcess()) {
    136143        String result;
    137         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
     144        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
    138145            return String();
    139146        return result;
     
    148155#if ENABLE(NETWORK_PROCESS)
    149156    if (WebProcess::shared().usesNetworkProcess()) {
    150         WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(SessionTracker::sessionID(session), firstParty, url, cookieString), 0);
     157        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(legacySessionID(session), firstParty, url, cookieString), 0);
    151158        return;
    152159    }
     
    161168    if (WebProcess::shared().usesNetworkProcess()) {
    162169        bool result;
    163         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
     170        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
    164171            return false;
    165172        return result;
     
    175182    if (WebProcess::shared().usesNetworkProcess()) {
    176183        String result;
    177         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
     184        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
    178185            return String();
    179186        return result;
     
    188195#if ENABLE(NETWORK_PROCESS)
    189196    if (WebProcess::shared().usesNetworkProcess()) {
    190         if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
     197        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(legacySessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
    191198            return false;
    192199        return true;
     
    201208#if ENABLE(NETWORK_PROCESS)
    202209    if (WebProcess::shared().usesNetworkProcess()) {
    203         WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(SessionTracker::sessionID(session), url, cookieName), 0);
     210        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(legacySessionID(session), url, cookieName), 0);
    204211        return;
    205212    }
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r163125 r163150  
    4545void WebFrameNetworkingContext::ensurePrivateBrowsingSession(uint64_t sessionID)
    4646{
    47     ASSERT(SessionTracker::isEphemeralID(sessionID));
    48 
    4947    if (SessionTracker::session(sessionID))
    5048        return;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r163125 r163150  
    21362136}
    21372137
    2138 void WebPage::setSessionID(uint64_t sessionID)
    2139 {
    2140     m_sessionID = sessionID;
    2141     if (SessionTracker::isEphemeralID(sessionID))
    2142         WebProcess::shared().ensurePrivateBrowsingSession(sessionID);
    2143 }
    2144 
    21452138void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
    21462139{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r163125 r163150  
    182182    uint64_t pageID() const { return m_pageID; }
    183183    uint64_t sessionID() const;
    184     void setSessionID(uint64_t);
     184    void setSessionID(uint64_t sessionID) { m_sessionID = sessionID; }
    185185
    186186    void setSize(const WebCore::IntSize&);
Note: See TracChangeset for help on using the changeset viewer.