Enable Service Workers on iOS
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Dec 2017 21:57:16 +0000 (21:57 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Dec 2017 21:57:16 +0000 (21:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180836

Reviewed by Alex Christensen.

* Shared/WebPreferencesDefaultValues.h:
* UIProcess/WebProcessPool.cpp:
Enable Service Workers on iOS.

(WebKit::WebProcessPool::ensureNetworkProcess):
Fall back to defaultCacheStorageDirectory() instead of the empty string
for the cache storage directory, when we do not have a store.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225924 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKit/UIProcess/WebProcessPool.cpp

index b0975d1..ea85fcb 100644 (file)
@@ -1,5 +1,20 @@
 2017-12-14  Chris Dumez  <cdumez@apple.com>
 
+        Enable Service Workers on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=180836
+
+        Reviewed by Alex Christensen.
+
+        * Shared/WebPreferencesDefaultValues.h:
+        * UIProcess/WebProcessPool.cpp:
+        Enable Service Workers on iOS.
+
+        (WebKit::WebProcessPool::ensureNetworkProcess):
+        Fall back to defaultCacheStorageDirectory() instead of the empty string
+        for the cache storage directory, when we do not have a store.
+
+2017-12-14  Chris Dumez  <cdumez@apple.com>
+
         Service worker script fetching currently always uses the network cache
         https://bugs.webkit.org/show_bug.cgi?id=180816
 
index 103cd56..ca71925 100644 (file)
 #define DEFAULT_EXPERIMENTAL_FEATURES_ENABLED false
 #endif
 
-#if ENABLE(EXPERIMENTAL_FEATURES) || PLATFORM(MAC)
+#if ENABLE(EXPERIMENTAL_FEATURES) || PLATFORM(COCOA)
 #define DEFAULT_SERVICE_WORKERS_ENABLED true
 #else
 #define DEFAULT_SERVICE_WORKERS_ENABLED false
index 74f2553..cbd4548 100644 (file)
@@ -444,7 +444,7 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with
     for (auto& scheme : m_urlSchemesRegisteredForCustomProtocols)
         parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
 
-    parameters.cacheStorageDirectory = m_websiteDataStore ? m_websiteDataStore->websiteDataStore().cacheStorageDirectory() : String { };
+    parameters.cacheStorageDirectory = m_websiteDataStore ? m_websiteDataStore->websiteDataStore().cacheStorageDirectory() : API::WebsiteDataStore::defaultCacheStorageDirectory();
     if (!parameters.cacheStorageDirectory.isEmpty())
         SandboxExtension::createHandleForReadWriteDirectory(parameters.cacheStorageDirectory, parameters.cacheStorageDirectoryExtensionHandle);
     parameters.cacheStoragePerOriginQuota = m_websiteDataStore ? m_websiteDataStore->websiteDataStore().cacheStoragePerOriginQuota() : WebsiteDataStore::defaultCacheStoragePerOriginQuota;