Changeset 239683 in webkit


Ignore:
Timestamp:
Jan 7, 2019, 10:36:22 AM (6 years ago)
Author:
achristensen@apple.com
Message:

Move identifierBase from SessionTracker to NetworkProcess/WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193201

Reviewed by Tim Horton.

No change in behavior. This just reduces process-global state.

  • NetworkProcess/NetworkProcess.h:

(WebKit::NetworkProcess::uiProcessBundleIdentifier const):

  • NetworkProcess/cocoa/NetworkProcessCocoa.mm:

(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):

  • NetworkProcess/mac/RemoteNetworkingContext.mm:

(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

  • Shared/SessionTracker.cpp:

(WebKit::identifierBase): Deleted.
(WebKit::SessionTracker::getIdentifierBase): Deleted.
(WebKit::SessionTracker::setIdentifierBase): Deleted.

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

(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
(WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier const):

  • WebProcess/WebProcess.h:

(WebKit::WebProcess::uiProcessBundleIdentifier const):

  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::platformInitializeWebProcess):

Location:
trunk/Source/WebKit
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r239680 r239683  
     12019-01-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move identifierBase from SessionTracker to NetworkProcess/WebProcess
     4        https://bugs.webkit.org/show_bug.cgi?id=193201
     5
     6        Reviewed by Tim Horton.
     7
     8        No change in behavior.  This just reduces process-global state.
     9
     10        * NetworkProcess/NetworkProcess.h:
     11        (WebKit::NetworkProcess::uiProcessBundleIdentifier const):
     12        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
     13        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
     14        * NetworkProcess/mac/RemoteNetworkingContext.mm:
     15        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
     16        * Shared/SessionTracker.cpp:
     17        (WebKit::identifierBase): Deleted.
     18        (WebKit::SessionTracker::getIdentifierBase): Deleted.
     19        (WebKit::SessionTracker::setIdentifierBase): Deleted.
     20        * Shared/SessionTracker.h:
     21        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
     22        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
     23        (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier const):
     24        * WebProcess/WebProcess.h:
     25        (WebKit::WebProcess::uiProcessBundleIdentifier const):
     26        * WebProcess/cocoa/WebProcessCocoa.mm:
     27        (WebKit::WebProcess::platformInitializeWebProcess):
     28
    1292019-01-07  Alex Christensen  <achristensen@webkit.org>
    230
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.h

    r239680 r239683  
    210210#endif
    211211
     212    const String& uiProcessBundleIdentifier() const { return m_uiProcessBundleIdentifier; }
     213
    212214private:
    213215    NetworkProcess();
     
    352354    bool m_diskCacheIsDisabledForTesting;
    353355    bool m_canHandleHTTPSServerTrustEvaluation;
     356    String m_uiProcessBundleIdentifier;
    354357
    355358    RefPtr<NetworkCache::Cache> m_cache;
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm

    r239680 r239683  
    8787    _CFNetworkSetATSContext(parameters.networkATSContext.get());
    8888
    89     SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
     89    m_uiProcessBundleIdentifier = parameters.uiProcessBundleIdentifier;
    9090
    9191#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm

    r239680 r239683  
    4949        return;
    5050
    51     String base;
    52     if (SessionTracker::getIdentifierBase().isNull())
     51    String base = networkProcess.uiProcessBundleIdentifier();
     52    if (base.isNull())
    5353        base = [[NSBundle mainBundle] bundleIdentifier];
    54     else
    55         base = SessionTracker::getIdentifierBase();
    5654
    5755    if (!sessionID.isEphemeral())
  • trunk/Source/WebKit/Shared/SessionTracker.cpp

    r239124 r239683  
    3535using namespace WebCore;
    3636
    37 static String& identifierBase()
    38 {
    39     ASSERT(RunLoop::isMain());
    40 
    41     static NeverDestroyed<String> base;
    42     return base;
    43 }
    44 
    45 const String& SessionTracker::getIdentifierBase()
    46 {
    47     return identifierBase();
    48 }
    49 
    50 void SessionTracker::setIdentifierBase(const String& identifier)
    51 {
    52     ASSERT(RunLoop::isMain());
    53 
    54     identifierBase() = identifier;
    55 }
    56 
    5737static HashMap<PAL::SessionID, RefPtr<NetworkSession>>& staticSessionMap()
    5838{
  • trunk/Source/WebKit/Shared/SessionTracker.h

    r227364 r239683  
    4343    WTF_MAKE_NONCOPYABLE(SessionTracker);
    4444public:
    45     static const String& getIdentifierBase();
    46     static void setIdentifierBase(const String&);
    47    
    4845    static void setSession(PAL::SessionID, Ref<NetworkSession>&&);
    4946    static NetworkSession* networkSession(PAL::SessionID);
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r235205 r239683  
    5151        return;
    5252
    53     String base;
    54     if (SessionTracker::getIdentifierBase().isNull())
     53    String base = WebProcess::singleton().uiProcessBundleIdentifier();
     54    if (base.isNull())
    5555        base = [[NSBundle mainBundle] bundleIdentifier];
    56     else
    57         base = SessionTracker::getIdentifierBase();
    5856
    5957    NetworkStorageSession::ensureSession(sessionID, base + '.' + String::number(sessionID.sessionID()));
     
    7977String WebFrameNetworkingContext::sourceApplicationIdentifier() const
    8078{
    81     return SessionTracker::getIdentifierBase();
     79    return WebProcess::singleton().uiProcessBundleIdentifier();
    8280}
    8381
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r239671 r239683  
    192192#endif
    193193
     194    const String& uiProcessBundleIdentifier() const { return m_uiProcessBundleIdentifier; }
     195
    194196    void updateActivePages();
    195197    void getActivePagesOriginsForTesting(CompletionHandler<void(Vector<String>&&)>&&);
     
    433435    TextCheckerState m_textCheckerState;
    434436
     437    String m_uiProcessBundleIdentifier;
    435438    RefPtr<NetworkProcessConnection> m_networkProcessConnection;
    436439    WebLoaderStrategy& m_webLoaderStrategy;
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r239572 r239683  
    135135    WebCore::setApplicationSDKVersion(parameters.uiProcessSDKVersion);
    136136
    137     SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
     137    m_uiProcessBundleIdentifier = parameters.uiProcessBundleIdentifier;
    138138
    139139#if ENABLE(SANDBOX_EXTENSIONS)
Note: See TracChangeset for help on using the changeset viewer.