Caches::m_storage should be set to null in case of error at initialization time
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2018 00:04:06 +0000 (00:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2018 00:04:06 +0000 (00:04 +0000)
commit1bfe2a78efa41767852754e73b038b28b7d9084b
tree6d34062807345aad7a0b27369f3558a96b37ac9e
parent0eebf530459e2b540119fc00efa993b91987c330
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 <youenn@apple.com> 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp