Title: [229045] trunk/Source/WebKit
- Revision
- 229045
- Author
- [email protected]
- Date
- 2018-02-26 16:04:06 -0800 (Mon, 26 Feb 2018)
Log Message
Caches::m_storage should be set to null in case of error at initialization time
https://bugs.webkit.org/show_bug.cgi?id=183068
Patch by Youenn Fablet <[email protected]> on 2018-02-26
Reviewed by Chris Dumez.
In case of error, we need to set m_storage back to nullptr so that
next tries to initialize it will restart from scratch.
If we do not set it to nullptr, we end up storing the initialize
callback in a queue and the callback will never be called.
This is difficult to test as we need the following conditions:
- we need to have an error case, like a disk writing error
- we need the web app to open a cache in two different pages/frames at about the same time.
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (229044 => 229045)
--- trunk/Source/WebKit/ChangeLog 2018-02-26 23:52:09 UTC (rev 229044)
+++ trunk/Source/WebKit/ChangeLog 2018-02-27 00:04:06 UTC (rev 229045)
@@ -1,3 +1,22 @@
+2018-02-26 Youenn Fablet <[email protected]>
+
+ Caches::m_storage should be set to null in case of error at initialization time
+ https://bugs.webkit.org/show_bug.cgi?id=183068
+
+ Reviewed by Chris Dumez.
+
+ In case of error, we need to set m_storage back to nullptr so that
+ next tries to initialize it will restart from scratch.
+ If we do not set it to nullptr, we end up storing the initialize
+ callback in a queue and the callback will never be called.
+
+ This is difficult to test as we need the following conditions:
+ - we need to have an error case, like a disk writing error
+ - we need the web app to open a cache in two different pages/frames at about the same time.
+
+ * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+ (WebKit::CacheStorage::Caches::initialize):
+
2018-02-26 Commit Queue <[email protected]>
Unreviewed, rolling out r226330.
Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (229044 => 229045)
--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp 2018-02-26 23:52:09 UTC (rev 229044)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp 2018-02-27 00:04:06 UTC (rev 229045)
@@ -154,6 +154,8 @@
auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks);
for (auto& callback : pendingCallbacks)
callback(Error::WriteDisk);
+
+ m_storage = nullptr;
return;
}
@@ -166,6 +168,8 @@
auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks);
for (auto& callback : pendingCallbacks)
callback(result.error());
+
+ m_storage = nullptr;
return;
}
m_caches = WTFMove(result.value());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes