Changeset 235127 in webkit


Ignore:
Timestamp:
Aug 21, 2018, 11:12:35 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Add _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
https://bugs.webkit.org/show_bug.cgi?id=188748

Patch by Alex Christensen <achristensen@webkit.org> on 2018-08-21
Reviewed by Ryosuke Niwa.

  • NetworkProcess/NetworkSessionCreationParameters.h:

(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):

  • NetworkProcess/cocoa/NetworkSessionCocoa.h:
  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

  • Shared/WebsiteDataStoreParameters.cpp:

(WebKit::WebsiteDataStoreParameters::privateSessionParameters):

  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _initWithConfiguration:]):

  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:

(-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
(-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStore.h:
Location:
trunk/Source/WebKit
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r235125 r235127  
     12018-08-21  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
     4        https://bugs.webkit.org/show_bug.cgi?id=188748
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * NetworkProcess/NetworkSessionCreationParameters.h:
     9        (WebKit::NetworkSessionCreationParameters::encode const):
     10        (WebKit::NetworkSessionCreationParameters::decode):
     11        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
     12        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     13        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
     14        * Shared/WebsiteDataStoreParameters.cpp:
     15        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
     16        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
     17        (-[WKWebsiteDataStore _initWithConfiguration:]):
     18        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
     19        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
     20        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
     21        (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
     22        (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
     23        (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
     24        (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
     25        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     26        (WebKit::WebsiteDataStore::parameters):
     27        * UIProcess/WebsiteData/WebsiteDataStore.h:
     28
    1292018-08-21  Per Arne Vollan  <pvollan@apple.com>
    230
  • trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h

    r231264 r235127  
    5050#if PLATFORM(COCOA)
    5151    RetainPtr<CFDictionaryRef> proxyConfiguration;
     52    String sourceApplicationBundleIdentifier;
     53    String sourceApplicationSecondaryIdentifier;
    5254#endif
    5355};
     
    6062#if PLATFORM(COCOA)
    6163    IPC::encode(encoder, proxyConfiguration.get());
     64    encoder << sourceApplicationBundleIdentifier;
     65    encoder << sourceApplicationSecondaryIdentifier;
    6266#endif
    6367}
     
    8387    if (!IPC::decode(decoder, proxyConfiguration))
    8488        return std::nullopt;
     89   
     90    std::optional<String> sourceApplicationBundleIdentifier;
     91    decoder >> sourceApplicationBundleIdentifier;
     92    if (!sourceApplicationBundleIdentifier)
     93        return std::nullopt;
     94   
     95    std::optional<String> sourceApplicationSecondaryIdentifier;
     96    decoder >> sourceApplicationSecondaryIdentifier;
     97    if (!sourceApplicationSecondaryIdentifier)
     98        return std::nullopt;
    8599#endif
    86100   
     
    91105#if PLATFORM(COCOA)
    92106        , WTFMove(proxyConfiguration)
     107        , WTFMove(*sourceApplicationBundleIdentifier)
     108        , WTFMove(*sourceApplicationSecondaryIdentifier)
    93109#endif
    94110    }};
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h

    r232201 r235127  
    8383    String m_boundInterfaceIdentifier;
    8484    RetainPtr<CFDictionaryRef> m_proxyConfiguration;
     85
     86    String m_sourceApplicationBundleIdentifier;
     87    String m_sourceApplicationSecondaryIdentifier;
    8588};
    8689
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r235101 r235127  
    681681
    682682    auto& sourceApplicationBundleIdentifier = globalSourceApplicationBundleIdentifier();
    683     if (!sourceApplicationBundleIdentifier.isEmpty()) {
     683    if (!m_sourceApplicationBundleIdentifier.isEmpty()) {
     684        configuration._sourceApplicationBundleIdentifier = m_sourceApplicationBundleIdentifier;
     685        configuration._sourceApplicationAuditTokenData = nil;
     686    } else if (!sourceApplicationBundleIdentifier.isEmpty()) {
    684687        configuration._sourceApplicationBundleIdentifier = sourceApplicationBundleIdentifier;
    685688        configuration._sourceApplicationAuditTokenData = nil;
     
    687690
    688691    auto& sourceApplicationSecondaryIdentifier = globalSourceApplicationSecondaryIdentifier();
    689     if (!sourceApplicationSecondaryIdentifier.isEmpty())
     692    if (!m_sourceApplicationSecondaryIdentifier.isEmpty())
     693        configuration._sourceApplicationSecondaryIdentifier = m_sourceApplicationSecondaryIdentifier;
     694    else if (!sourceApplicationSecondaryIdentifier.isEmpty())
    690695        configuration._sourceApplicationSecondaryIdentifier = sourceApplicationSecondaryIdentifier;
    691696
  • trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp

    r232863 r235127  
    7373    return { { }, { }, { }, { sessionID, { }, AllowsCellularAccess::Yes
    7474#if PLATFORM(COCOA)
    75         , nullptr
     75        , nullptr , { } , { }
    7676#endif
    7777    }};
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm

    r235022 r235127  
    208208    if (configuration._serviceWorkerRegistrationDirectory)
    209209        config.serviceWorkerRegistrationDirectory = configuration._serviceWorkerRegistrationDirectory.path;
     210    if (configuration.sourceApplicationBundleIdentifier)
     211        config.sourceApplicationBundleIdentifier = configuration.sourceApplicationBundleIdentifier;
     212    if (configuration.sourceApplicationSecondaryIdentifier)
     213        config.sourceApplicationSecondaryIdentifier = configuration.sourceApplicationSecondaryIdentifier;
    210214
    211215    API::Object::constructInWrapper<API::WebsiteDataStore>(self, config, PAL::SessionID::generatePersistentSessionID());
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h

    r234965 r235127  
    5555@property (nonatomic, copy) NSArray<NSString *> *alwaysRevalidatedURLSchemes WK_API_AVAILABLE(macosx(10.12), ios(10.0));
    5656@property (nonatomic) BOOL diskCacheSpeculativeValidationEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
    57 @property (nonatomic, nullable, copy) NSString *sourceApplicationBundleIdentifier WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
    58 @property (nonatomic, nullable, copy) NSString *sourceApplicationSecondaryIdentifier WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
     57@property (nonatomic, nullable, copy) NSString *sourceApplicationBundleIdentifier WK_API_DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.sourceApplicationBundleIdentifier", macosx(10.12.3, WK_MAC_TBA), ios(10.3, WK_IOS_TBA));
     58@property (nonatomic, nullable, copy) NSString *sourceApplicationSecondaryIdentifier WK_API_DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.sourceApplicationSecondaryIdentifier", macosx(10.12.3, WK_MAC_TBA), ios(10.3, WK_IOS_TBA));
    5959@property (nonatomic) BOOL shouldCaptureAudioInUIProcess WK_API_AVAILABLE(macosx(10.13), ios(11.0));
    6060#if TARGET_OS_IPHONE
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h

    r230121 r235127  
    4242@property (nonatomic, copy, setter=_setCacheStorageDirectory:) NSURL *_cacheStorageDirectory WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
    4343@property (nonatomic, copy, setter=_setServiceWorkerRegistrationDirectory:) NSURL *_serviceWorkerRegistrationDirectory WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
     44@property (nonatomic, nullable, copy) NSString *sourceApplicationBundleIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
     45@property (nonatomic, nullable, copy) NSString *sourceApplicationSecondaryIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
    4446
    4547@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm

    r228442 r235127  
    4545    RetainPtr<NSURL> _cacheStorageDirectoryURL;
    4646    RetainPtr<NSURL> _serviceWorkerRegistrationDirectoryURL;
     47    RetainPtr<NSString> _sourceApplicationBundleIdentifier;
     48    RetainPtr<NSString> _sourceApplicationSecondaryIdentifier;
    4749}
    4850
     
    127129}
    128130
     131- (void)setSourceApplicationBundleIdentifier:(NSString *)identifier
     132{
     133    _sourceApplicationBundleIdentifier = identifier;
     134}
     135
     136- (NSString *)sourceApplicationBundleIdentifier
     137{
     138    return _sourceApplicationBundleIdentifier.get();
     139}
     140
     141- (NSString *)sourceApplicationSecondaryIdentifier
     142{
     143    return _sourceApplicationSecondaryIdentifier.get();
     144}
     145
     146- (void)setSourceApplicationSecondaryIdentifier:(NSString *)identifier
     147{
     148    _sourceApplicationSecondaryIdentifier = identifier;
     149}
     150
    129151@end
    130152
  • trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r232863 r235127  
    5959
    6060    WebsiteDataStoreParameters parameters;
    61     parameters.networkSessionParameters = { m_sessionID, m_boundInterfaceIdentifier, m_allowsCellularAccess, m_proxyConfiguration };
     61    parameters.networkSessionParameters = {
     62        m_sessionID,
     63        m_boundInterfaceIdentifier,
     64        m_allowsCellularAccess,
     65        m_proxyConfiguration,
     66        m_configuration.sourceApplicationBundleIdentifier,
     67        m_configuration.sourceApplicationSecondaryIdentifier,
     68    };
    6269
    6370    auto cookieFile = resolvedCookieStorageFile();
    6471
    65 #if PLATFORM(COCOA)
    6672    if (m_uiProcessCookieStorageIdentifier.isEmpty()) {
    6773        auto utf8File = cookieFile.utf8();
     
    7278
    7379    parameters.uiProcessCookieStorageIdentifier = m_uiProcessCookieStorageIdentifier;
    74 #endif
     80    parameters.networkSessionParameters.sourceApplicationBundleIdentifier = m_configuration.sourceApplicationBundleIdentifier;
     81    parameters.networkSessionParameters.sourceApplicationSecondaryIdentifier = m_configuration.sourceApplicationSecondaryIdentifier;
    7582
    7683    parameters.pendingCookies = copyToVector(m_pendingCookies);
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h

    r234440 r235127  
    9494        String javaScriptConfigurationDirectory;
    9595        String cookieStorageFile;
     96        String sourceApplicationBundleIdentifier;
     97        String sourceApplicationSecondaryIdentifier;
    9698
    9799        explicit Configuration();
Note: See TracChangeset for help on using the changeset viewer.