Title: [259973] releases/WebKitGTK/webkit-2.28/Source/WebKit
Revision
259973
Author
[email protected]
Date
2020-04-12 06:17:08 -0700 (Sun, 12 Apr 2020)

Log Message

Merge r259712 - Ensure base cache path exists before calculating disk cache capacity
https://bugs.webkit.org/show_bug.cgi?id=209338

Reviewed by Adrian Perez de Castro.

The base cache path might not exist yet in Cache::open() since it's Storage::open() the one calling
FileSystem::makeAllDirectories() with the final cache directory. In such case, computeCapacity() fails because
FileSystem::getVolumeFreeSpace() needs an existing file.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::open):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.28/Source/WebKit/ChangeLog (259972 => 259973)


--- releases/WebKitGTK/webkit-2.28/Source/WebKit/ChangeLog	2020-04-12 13:17:05 UTC (rev 259972)
+++ releases/WebKitGTK/webkit-2.28/Source/WebKit/ChangeLog	2020-04-12 13:17:08 UTC (rev 259973)
@@ -1,3 +1,17 @@
+2020-04-08  Carlos Garcia Campos  <[email protected]>
+
+        Ensure base cache path exists before calculating disk cache capacity
+        https://bugs.webkit.org/show_bug.cgi?id=209338
+
+        Reviewed by Adrian Perez de Castro.
+
+        The base cache path might not exist yet in Cache::open() since it's Storage::open() the one calling
+        FileSystem::makeAllDirectories() with the final cache directory. In such case, computeCapacity() fails because
+        FileSystem::getVolumeFreeSpace() needs an existing file.
+
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::NetworkCache::Cache::open):
+
 2020-04-12  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Use gdk_window_move_to_rect() to position popup menus

Modified: releases/WebKitGTK/webkit-2.28/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp (259972 => 259973)


--- releases/WebKitGTK/webkit-2.28/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp	2020-04-12 13:17:05 UTC (rev 259972)
+++ releases/WebKitGTK/webkit-2.28/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp	2020-04-12 13:17:08 UTC (rev 259973)
@@ -78,6 +78,9 @@
 
 RefPtr<Cache> Cache::open(NetworkProcess& networkProcess, const String& cachePath, OptionSet<CacheOption> options, PAL::SessionID sessionID)
 {
+    if (!FileSystem::makeAllDirectories(cachePath))
+        return nullptr;
+
     auto capacity = computeCapacity(networkProcess.cacheModel(), cachePath);
     auto storage = Storage::open(cachePath, options.contains(CacheOption::TestingMode) ? Storage::Mode::AvoidRandomness : Storage::Mode::Normal, capacity);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to