Changeset 239632 in webkit


Ignore:
Timestamp:
Jan 4, 2019, 1:13:25 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
https://bugs.webkit.org/show_bug.cgi?id=193114

Reviewed by Brady Eidson.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):

  • NetworkProcess/NetworkProcessCreationParameters.cpp:

(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):

  • NetworkProcess/NetworkProcessCreationParameters.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

Location:
trunk/Source/WebKit
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r239631 r239632  
     12019-01-04  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
     4        https://bugs.webkit.org/show_bug.cgi?id=193114
     5
     6        Reviewed by Brady Eidson.
     7
     8        * NetworkProcess/NetworkProcess.cpp:
     9        (WebKit::NetworkProcess::initializeNetworkProcess):
     10        * NetworkProcess/NetworkProcessCreationParameters.cpp:
     11        (WebKit::NetworkProcessCreationParameters::encode const):
     12        (WebKit::NetworkProcessCreationParameters::decode):
     13        * NetworkProcess/NetworkProcessCreationParameters.h:
     14        * UIProcess/WebProcessPool.cpp:
     15        (WebKit::WebProcessPool::ensureNetworkProcess):
     16
    1172019-01-04  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r239592 r239632  
    303303
    304304#if ENABLE(INDEXED_DATABASE)
    305     addIndexedDatabaseSession(PAL::SessionID::defaultSessionID(), parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
     305    addIndexedDatabaseSession(sessionID, parameters.defaultDataStoreParameters.indexedDatabaseDirectory, parameters.defaultDataStoreParameters.indexedDatabaseDirectoryExtensionHandle);
    306306#endif
    307307
  • trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp

    r239624 r239632  
    5757    encoder << containerCachesDirectoryExtensionHandle;
    5858    encoder << parentBundleDirectoryExtensionHandle;
    59 #if ENABLE(INDEXED_DATABASE)
    60     encoder << indexedDatabaseTempBlobDirectoryExtensionHandle;
    61 #endif
    6259#endif
    6360    encoder << shouldSuppressMemoryPressureHandler;
     
    9693#endif
    9794
    98 #if ENABLE(INDEXED_DATABASE)
    99     encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
    100 #endif
    101 
    10295#if ENABLE(SERVICE_WORKER)
    10396    encoder << serviceWorkerRegistrationDirectory << serviceWorkerRegistrationDirectoryExtensionHandle << urlSchemesServiceWorkersCanHandle << shouldDisableServiceWorkerProcessTerminationDelay;
     
    149142        return false;
    150143    result.parentBundleDirectoryExtensionHandle = WTFMove(*parentBundleDirectoryExtensionHandle);
    151 
    152 #if ENABLE(INDEXED_DATABASE)
    153     Optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle;
    154     decoder >> indexedDatabaseTempBlobDirectoryExtensionHandle;
    155     if (!indexedDatabaseTempBlobDirectoryExtensionHandle)
    156         return false;
    157     result.indexedDatabaseTempBlobDirectoryExtensionHandle = WTFMove(*indexedDatabaseTempBlobDirectoryExtensionHandle);
    158 #endif
    159144#endif
    160145    if (!decoder.decode(result.shouldSuppressMemoryPressureHandler))
     
    222207#endif
    223208
    224 #if ENABLE(INDEXED_DATABASE)
    225     if (!decoder.decode(result.indexedDatabaseDirectory))
    226         return false;
    227    
    228     Optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle;
    229     decoder >> indexedDatabaseDirectoryExtensionHandle;
    230     if (!indexedDatabaseDirectoryExtensionHandle)
    231         return false;
    232     result.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
    233 #endif
    234 
    235209#if ENABLE(SERVICE_WORKER)
    236210    if (!decoder.decode(result.serviceWorkerRegistrationDirectory))
  • trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h

    r239624 r239632  
    6868    SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
    6969    SandboxExtension::Handle parentBundleDirectoryExtensionHandle;
    70 #if ENABLE(INDEXED_DATABASE)
    71     SandboxExtension::Handle indexedDatabaseTempBlobDirectoryExtensionHandle;
    72 #endif
    7370#endif
    7471    bool shouldSuppressMemoryPressureHandler { false };
     
    111108#endif
    112109
    113 #if ENABLE(INDEXED_DATABASE)
    114     String indexedDatabaseDirectory;
    115     SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
    116 #endif
    117 
    118110#if ENABLE(SERVICE_WORKER)
    119111    String serviceWorkerRegistrationDirectory;
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm

    r239572 r239632  
    8080    SandboxExtension::consumePermanently(parameters.parentBundleDirectoryExtensionHandle);
    8181#if ENABLE(INDEXED_DATABASE)
    82     SandboxExtension::consumePermanently(parameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
     82    SandboxExtension::consumePermanently(parameters.defaultDataStoreParameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
    8383#endif
    8484#endif
  • trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp

    r239427 r239632  
    4545#if ENABLE(INDEXED_DATABASE)
    4646    encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
     47#if PLATFORM(IOS_FAMILY)
     48    encoder << indexedDatabaseTempBlobDirectoryExtensionHandle;
     49#endif
    4750#endif
    4851
     
    9295        return WTF::nullopt;
    9396    parameters.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
     97
     98#if PLATFORM(IOS_FAMILY)
     99    Optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle;
     100    decoder >> indexedDatabaseTempBlobDirectoryExtensionHandle;
     101    if (!indexedDatabaseTempBlobDirectoryExtensionHandle)
     102        return WTF::nullopt;
     103    parameters.indexedDatabaseTempBlobDirectoryExtensionHandle = WTFMove(*indexedDatabaseTempBlobDirectoryExtensionHandle);
     104#endif
    94105#endif
    95106
     
    117128#if ENABLE(INDEXED_DATABASE)
    118129        , { }, { }
     130#if PLATFORM(IOS_FAMILY)
     131        , { }
     132#endif
    119133#endif
    120134#if ENABLE(SERVICE_WORKER)
  • trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h

    r239427 r239632  
    6060    String indexedDatabaseDirectory;
    6161    SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
     62#if PLATFORM(IOS_FAMILY)
     63    SandboxExtension::Handle indexedDatabaseTempBlobDirectoryExtensionHandle;
     64#endif
    6265#endif
    6366
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r239623 r239632  
    511511
    512512#if ENABLE(INDEXED_DATABASE)
    513     SandboxExtension::createHandleForTemporaryFile(emptyString(), SandboxExtension::Type::ReadWrite, parameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
     513    SandboxExtension::createHandleForTemporaryFile(emptyString(), SandboxExtension::Type::ReadWrite, parameters.defaultDataStoreParameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
    514514#endif
    515515#endif
     
    529529    // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>)
    530530    // *********
    531     parameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory();
    532     if (parameters.indexedDatabaseDirectory.isEmpty())
    533         parameters.indexedDatabaseDirectory = API::WebsiteDataStore::defaultDataStore()->websiteDataStore().parameters().indexedDatabaseDirectory;
     531    parameters.defaultDataStoreParameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory();
     532    if (parameters.defaultDataStoreParameters.indexedDatabaseDirectory.isEmpty())
     533        parameters.defaultDataStoreParameters.indexedDatabaseDirectory = API::WebsiteDataStore::defaultDataStore()->websiteDataStore().parameters().indexedDatabaseDirectory;
    534534   
    535     SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
     535    SandboxExtension::createHandleForReadWriteDirectory(parameters.defaultDataStoreParameters.indexedDatabaseDirectory, parameters.defaultDataStoreParameters.indexedDatabaseDirectoryExtensionHandle);
    536536#endif
    537537
Note: See TracChangeset for help on using the changeset viewer.