Title: [241544] trunk/Source/WebKit
Revision
241544
Author
[email protected]
Date
2019-02-14 07:51:47 -0800 (Thu, 14 Feb 2019)

Log Message

Do not add a caches to its engine if the salt cannot be initialized
https://bugs.webkit.org/show_bug.cgi?id=194604

Reviewed by Antti Koivisto.

This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
We should return early if initialize fails.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::readCachesFromDisk):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (241543 => 241544)


--- trunk/Source/WebKit/ChangeLog	2019-02-14 12:57:51 UTC (rev 241543)
+++ trunk/Source/WebKit/ChangeLog	2019-02-14 15:51:47 UTC (rev 241544)
@@ -1,3 +1,16 @@
+2019-02-14  Youenn Fablet  <[email protected]>
+
+        Do not add a caches to its engine if the salt cannot be initialized
+        https://bugs.webkit.org/show_bug.cgi?id=194604
+
+        Reviewed by Antti Koivisto.
+
+        This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
+        We should return early if initialize fails.
+
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::readCachesFromDisk):
+
 2019-02-13  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Use a scrolled window for script alerts text

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (241543 => 241544)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2019-02-14 12:57:51 UTC (rev 241543)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2019-02-14 15:51:47 UTC (rev 241544)
@@ -310,6 +310,11 @@
 void Engine::readCachesFromDisk(const WebCore::ClientOrigin& origin, CachesCallback&& callback)
 {
     initialize([this, origin, callback = WTFMove(callback)](Optional<Error>&& error) mutable {
+        if (error) {
+            callback(makeUnexpected(error.value()));
+            return;
+        }
+
         auto& caches = m_caches.ensure(origin, [&origin, this] {
             auto path = cachesRootPath(origin);
             return Caches::create(*this, WebCore::ClientOrigin { origin }, WTFMove(path), m_quota);
@@ -320,11 +325,6 @@
             return;
         }
 
-        if (error) {
-            callback(makeUnexpected(error.value()));
-            return;
-        }
-
         caches->initialize([callback = WTFMove(callback), caches = caches.copyRef()](Optional<Error>&& error) mutable {
             if (error) {
                 callback(makeUnexpected(error.value()));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to