Title: [239632] trunk/Source/WebKit
Revision
239632
Author
achristen...@apple.com
Date
2019-01-04 13:13:25 -0800 (Fri, 04 Jan 2019)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (239631 => 239632)


--- trunk/Source/WebKit/ChangeLog	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/ChangeLog	2019-01-04 21:13:25 UTC (rev 239632)
@@ -1,5 +1,21 @@
 2019-01-04  Alex Christensen  <achristen...@webkit.org>
 
+        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):
+
+2019-01-04  Alex Christensen  <achristen...@webkit.org>
+
         Deprecate WKContextCreate
         https://bugs.webkit.org/show_bug.cgi?id=193118
 

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (239631 => 239632)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-01-04 21:13:25 UTC (rev 239632)
@@ -302,7 +302,7 @@
     SessionTracker::setSession(sessionID, NetworkSession::create(WTFMove(parameters.defaultDataStoreParameters.networkSessionParameters)));
 
 #if ENABLE(INDEXED_DATABASE)
-    addIndexedDatabaseSession(PAL::SessionID::defaultSessionID(), parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+    addIndexedDatabaseSession(sessionID, parameters.defaultDataStoreParameters.indexedDatabaseDirectory, parameters.defaultDataStoreParameters.indexedDatabaseDirectoryExtensionHandle);
 #endif
 
 #if ENABLE(SERVICE_WORKER)

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (239631 => 239632)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp	2019-01-04 21:13:25 UTC (rev 239632)
@@ -56,10 +56,7 @@
     encoder << cookieStorageDirectoryExtensionHandle;
     encoder << containerCachesDirectoryExtensionHandle;
     encoder << parentBundleDirectoryExtensionHandle;
-#if ENABLE(INDEXED_DATABASE)
-    encoder << indexedDatabaseTempBlobDirectoryExtensionHandle;
 #endif
-#endif
     encoder << shouldSuppressMemoryPressureHandler;
     encoder << shouldUseTestingNetworkSession;
     encoder << urlSchemesRegisteredForCustomProtocols;
@@ -95,10 +92,6 @@
     encoder << wirelessContextIdentifier;
 #endif
 
-#if ENABLE(INDEXED_DATABASE)
-    encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
-#endif
-
 #if ENABLE(SERVICE_WORKER)
     encoder << serviceWorkerRegistrationDirectory << serviceWorkerRegistrationDirectoryExtensionHandle << urlSchemesServiceWorkersCanHandle << shouldDisableServiceWorkerProcessTerminationDelay;
 #endif
@@ -148,15 +141,7 @@
     if (!parentBundleDirectoryExtensionHandle)
         return false;
     result.parentBundleDirectoryExtensionHandle = WTFMove(*parentBundleDirectoryExtensionHandle);
-
-#if ENABLE(INDEXED_DATABASE)
-    Optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle;
-    decoder >> indexedDatabaseTempBlobDirectoryExtensionHandle;
-    if (!indexedDatabaseTempBlobDirectoryExtensionHandle)
-        return false;
-    result.indexedDatabaseTempBlobDirectoryExtensionHandle = WTFMove(*indexedDatabaseTempBlobDirectoryExtensionHandle);
 #endif
-#endif
     if (!decoder.decode(result.shouldSuppressMemoryPressureHandler))
         return false;
     if (!decoder.decode(result.shouldUseTestingNetworkSession))
@@ -221,17 +206,6 @@
         return false;
 #endif
 
-#if ENABLE(INDEXED_DATABASE)
-    if (!decoder.decode(result.indexedDatabaseDirectory))
-        return false;
-    
-    Optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle;
-    decoder >> indexedDatabaseDirectoryExtensionHandle;
-    if (!indexedDatabaseDirectoryExtensionHandle)
-        return false;
-    result.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
-#endif
-
 #if ENABLE(SERVICE_WORKER)
     if (!decoder.decode(result.serviceWorkerRegistrationDirectory))
         return false;

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (239631 => 239632)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h	2019-01-04 21:13:25 UTC (rev 239632)
@@ -67,10 +67,7 @@
     SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
     SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
     SandboxExtension::Handle parentBundleDirectoryExtensionHandle;
-#if ENABLE(INDEXED_DATABASE)
-    SandboxExtension::Handle indexedDatabaseTempBlobDirectoryExtensionHandle;
 #endif
-#endif
     bool shouldSuppressMemoryPressureHandler { false };
     bool shouldUseTestingNetworkSession { false };
 
@@ -110,11 +107,6 @@
     unsigned wirelessContextIdentifier { 0 };
 #endif
 
-#if ENABLE(INDEXED_DATABASE)
-    String indexedDatabaseDirectory;
-    SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
-#endif
-
 #if ENABLE(SERVICE_WORKER)
     String serviceWorkerRegistrationDirectory;
     SandboxExtension::Handle serviceWorkerRegistrationDirectoryExtensionHandle;

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (239631 => 239632)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm	2019-01-04 21:13:25 UTC (rev 239632)
@@ -79,7 +79,7 @@
     SandboxExtension::consumePermanently(parameters.containerCachesDirectoryExtensionHandle);
     SandboxExtension::consumePermanently(parameters.parentBundleDirectoryExtensionHandle);
 #if ENABLE(INDEXED_DATABASE)
-    SandboxExtension::consumePermanently(parameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
+    SandboxExtension::consumePermanently(parameters.defaultDataStoreParameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
 #endif
 #endif
     m_diskCacheDirectory = parameters.diskCacheDirectory;

Modified: trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (239631 => 239632)


--- trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp	2019-01-04 21:13:25 UTC (rev 239632)
@@ -44,7 +44,10 @@
 
 #if ENABLE(INDEXED_DATABASE)
     encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
+#if PLATFORM(IOS_FAMILY)
+    encoder << indexedDatabaseTempBlobDirectoryExtensionHandle;
 #endif
+#endif
 
 #if ENABLE(SERVICE_WORKER)
     encoder << serviceWorkerRegistrationDirectory << serviceWorkerRegistrationDirectoryExtensionHandle;
@@ -91,7 +94,15 @@
     if (!indexedDatabaseDirectoryExtensionHandle)
         return WTF::nullopt;
     parameters.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
+
+#if PLATFORM(IOS_FAMILY)
+    Optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle;
+    decoder >> indexedDatabaseTempBlobDirectoryExtensionHandle;
+    if (!indexedDatabaseTempBlobDirectoryExtensionHandle)
+        return WTF::nullopt;
+    parameters.indexedDatabaseTempBlobDirectoryExtensionHandle = WTFMove(*indexedDatabaseTempBlobDirectoryExtensionHandle);
 #endif
+#endif
 
 #if ENABLE(SERVICE_WORKER)
     Optional<String> serviceWorkerRegistrationDirectory;
@@ -116,7 +127,10 @@
     return { { }, { }, { }, NetworkSessionCreationParameters::privateSessionParameters(sessionID)
 #if ENABLE(INDEXED_DATABASE)
         , { }, { }
+#if PLATFORM(IOS_FAMILY)
+        , { }
 #endif
+#endif
 #if ENABLE(SERVICE_WORKER)
         , { }, { }
 #endif

Modified: trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h (239631 => 239632)


--- trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h	2019-01-04 21:13:25 UTC (rev 239632)
@@ -59,7 +59,10 @@
 #if ENABLE(INDEXED_DATABASE)
     String indexedDatabaseDirectory;
     SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
+#if PLATFORM(IOS_FAMILY)
+    SandboxExtension::Handle indexedDatabaseTempBlobDirectoryExtensionHandle;
 #endif
+#endif
 
 #if ENABLE(SERVICE_WORKER)
     String serviceWorkerRegistrationDirectory;

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (239631 => 239632)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-01-04 21:12:15 UTC (rev 239631)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-01-04 21:13:25 UTC (rev 239632)
@@ -510,7 +510,7 @@
         SandboxExtension::createHandle(parentBundleDirectory, SandboxExtension::Type::ReadOnly, parameters.parentBundleDirectoryExtensionHandle);
 
 #if ENABLE(INDEXED_DATABASE)
-    SandboxExtension::createHandleForTemporaryFile(emptyString(), SandboxExtension::Type::ReadWrite, parameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
+    SandboxExtension::createHandleForTemporaryFile(emptyString(), SandboxExtension::Type::ReadWrite, parameters.defaultDataStoreParameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
 #endif
 #endif
 
@@ -528,11 +528,11 @@
     // *********
     // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>)
     // *********
-    parameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory();
-    if (parameters.indexedDatabaseDirectory.isEmpty())
-        parameters.indexedDatabaseDirectory = API::WebsiteDataStore::defaultDataStore()->websiteDataStore().parameters().indexedDatabaseDirectory;
+    parameters.defaultDataStoreParameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory();
+    if (parameters.defaultDataStoreParameters.indexedDatabaseDirectory.isEmpty())
+        parameters.defaultDataStoreParameters.indexedDatabaseDirectory = API::WebsiteDataStore::defaultDataStore()->websiteDataStore().parameters().indexedDatabaseDirectory;
     
-    SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+    SandboxExtension::createHandleForReadWriteDirectory(parameters.defaultDataStoreParameters.indexedDatabaseDirectory, parameters.defaultDataStoreParameters.indexedDatabaseDirectoryExtensionHandle);
 #endif
 
 #if ENABLE(SERVICE_WORKER)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to