Title: [228936] trunk/Source/WebKit
Revision
228936
Author
commit-qu...@webkit.org
Date
2018-02-22 14:53:41 -0800 (Thu, 22 Feb 2018)

Log Message

Caches::initialize should call all pending initialization callbacks in case of error
https://bugs.webkit.org/show_bug.cgi?id=183062

Patch by Youenn Fablet <you...@apple.com> on 2018-02-22
Reviewed by Chris Dumez.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
(WebKit::CacheStorage::Caches::initializeSize):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228935 => 228936)


--- trunk/Source/WebKit/ChangeLog	2018-02-22 22:50:19 UTC (rev 228935)
+++ trunk/Source/WebKit/ChangeLog	2018-02-22 22:53:41 UTC (rev 228936)
@@ -1,5 +1,16 @@
 2018-02-22  Youenn Fablet  <you...@apple.com>
 
+        Caches::initialize should call all pending initialization callbacks in case of error
+        https://bugs.webkit.org/show_bug.cgi?id=183062
+
+        Reviewed by Chris Dumez.
+
+        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+        (WebKit::CacheStorage::Caches::initialize):
+        (WebKit::CacheStorage::Caches::initializeSize):
+
+2018-02-22  Youenn Fablet  <you...@apple.com>
+
         CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
         https://bugs.webkit.org/show_bug.cgi?id=183055
 

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (228935 => 228936)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2018-02-22 22:50:19 UTC (rev 228935)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2018-02-22 22:53:41 UTC (rev 228936)
@@ -150,6 +150,10 @@
     storeOrigin([this, callback = WTFMove(callback)] (std::optional<Error>&& error) mutable {
         if (error) {
             callback(Error::WriteDisk);
+
+            auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks);
+            for (auto& callback : pendingCallbacks)
+                callback(Error::WriteDisk);
             return;
         }
 
@@ -175,6 +179,10 @@
 {
     if (!m_storage) {
         callback(Error::Internal);
+
+        auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks);
+        for (auto& callback : pendingCallbacks)
+            callback(Error::Internal);
         return;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to