Title: [225944] trunk/Source/WebKit
- Revision
- 225944
- Author
- cdu...@apple.com
- Date
- 2017-12-14 16:50:04 -0800 (Thu, 14 Dec 2017)
Log Message
Clearing WebSite data on iOS does not clear the Fetch Cache
https://bugs.webkit.org/show_bug.cgi?id=180846
<rdar://problem/36060129>
Reviewed by Youenn Fablet.
When clearing WebSite data, construct the engine for the given sessionID
if missing, instead of not clearing anything when the engine is missing.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (225943 => 225944)
--- trunk/Source/WebKit/ChangeLog 2017-12-15 00:12:06 UTC (rev 225943)
+++ trunk/Source/WebKit/ChangeLog 2017-12-15 00:50:04 UTC (rev 225944)
@@ -1,5 +1,20 @@
2017-12-14 Chris Dumez <cdu...@apple.com>
+ Clearing WebSite data on iOS does not clear the Fetch Cache
+ https://bugs.webkit.org/show_bug.cgi?id=180846
+ <rdar://problem/36060129>
+
+ Reviewed by Youenn Fablet.
+
+ When clearing WebSite data, construct the engine for the given sessionID
+ if missing, instead of not clearing anything when the engine is missing.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::deleteWebsiteData):
+ (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
+
+2017-12-14 Chris Dumez <cdu...@apple.com>
+
self.importScripts() should obey updateViaCache inside service workers
https://bugs.webkit.org/show_bug.cgi?id=180826
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (225943 => 225944)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2017-12-15 00:12:06 UTC (rev 225943)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2017-12-15 00:50:04 UTC (rev 225944)
@@ -460,7 +460,7 @@
});
if (websiteDataTypes.contains(WebsiteDataType::DOMCache))
- CacheStorage::Engine::clearAllEngines([clearTasksHandler = clearTasksHandler.copyRef()] { });
+ CacheStorage::Engine::from(sessionID).clearAllCaches(clearTasksHandler);
if (websiteDataTypes.contains(WebsiteDataType::DiskCache) && !sessionID.isEphemeral())
clearDiskCache(modifiedSince, [clearTasksHandler = WTFMove(clearTasksHandler)] { });
@@ -503,10 +503,10 @@
});
if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) {
- auto origins = WTF::map(originDatas, [] (auto& originData) {
- return originData.securityOrigin()->toString();
- });
- CacheStorage::Engine::clearEnginesForOrigins(origins, [clearTasksHandler = clearTasksHandler.copyRef()] { });
+ for (auto& originData : originDatas) {
+ auto origin = originData.securityOrigin()->toString();
+ CacheStorage::Engine::from(sessionID).clearCachesForOrigin(origin, clearTasksHandler);
+ }
}
if (websiteDataTypes.contains(WebsiteDataType::DiskCache) && !sessionID.isEphemeral())
Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (225943 => 225944)
--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp 2017-12-15 00:12:06 UTC (rev 225943)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp 2017-12-15 00:50:04 UTC (rev 225944)
@@ -86,22 +86,6 @@
from(sessionID).fetchEntries(shouldComputeSize, WTFMove(completionHandler));
}
-void Engine::clearAllEngines(WTF::Function<void()>&& completionHandler)
-{
- auto clearTaskHandler = CallbackAggregator::create(WTFMove(completionHandler));
- for (auto& engine : globalEngineMap().values())
- engine->clearAllCaches(clearTaskHandler.get());
-}
-
-void Engine::clearEnginesForOrigins(const Vector<String>& origins, WTF::Function<void()>&& completionHandler)
-{
- auto clearTaskHandler = CallbackAggregator::create(WTFMove(completionHandler));
- for (auto& engine : globalEngineMap().values()) {
- for (auto& origin : origins)
- engine->clearCachesForOrigin(origin, clearTaskHandler.get());
- }
-}
-
Engine& Engine::defaultEngine()
{
auto sessionID = PAL::SessionID::defaultSessionID();
Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h (225943 => 225944)
--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h 2017-12-15 00:12:06 UTC (rev 225943)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h 2017-12-15 00:50:04 UTC (rev 225944)
@@ -57,8 +57,6 @@
static Engine& from(PAL::SessionID);
static void destroyEngine(PAL::SessionID);
- static void clearAllEngines(WTF::Function<void()>&&);
- static void clearEnginesForOrigins(const Vector<String>& origins, WTF::Function<void()>&&);
static void fetchEntries(PAL::SessionID, bool shouldComputeSize, WTF::CompletionHandler<void(Vector<WebsiteData::Entry>)>&&);
static Ref<Engine> create(String&& rootPath) { return adoptRef(*new Engine(WTFMove(rootPath))); }
@@ -89,6 +87,9 @@
void clearMemoryRepresentation(const String& origin, WebCore::DOMCacheEngine::CompletionCallback&&);
String representation();
+ void clearAllCaches(WTF::CallbackAggregator&);
+ void clearCachesForOrigin(const String& origin, WTF::CallbackAggregator&);
+
private:
static Engine& defaultEngine();
explicit Engine(String&& rootPath);
@@ -98,8 +99,6 @@
void fetchEntries(bool /* shouldComputeSize */, WTF::CompletionHandler<void(Vector<WebsiteData::Entry>)>&&);
void initialize(WTF::Function<void(std::optional<WebCore::DOMCacheEngine::Error>&&)>&&);
- void clearAllCaches(WTF::CallbackAggregator&);
- void clearCachesForOrigin(const String& origin, WTF::CallbackAggregator&);
using CachesOrError = Expected<std::reference_wrapper<Caches>, WebCore::DOMCacheEngine::Error>;
using CachesCallback = WTF::Function<void(CachesOrError&&)>;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes