Skip to content

Commit

Permalink
Merge r241544 - Do not add a caches to its engine if the salt cannot …
Browse files Browse the repository at this point in the history
…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):
  • Loading branch information
youennf authored and carlosgcampos committed Feb 18, 2019
1 parent 0bab4ce commit 63c9129
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,16 @@
2019-02-14 Youenn Fablet <youenn@apple.com>

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-14 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.90 release
Expand Down
10 changes: 5 additions & 5 deletions Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
Expand Up @@ -310,6 +310,11 @@ void Engine::initialize(CompletionCallback&& callback)
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);
Expand All @@ -320,11 +325,6 @@ void Engine::readCachesFromDisk(const WebCore::ClientOrigin& origin, CachesCallb
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()));
Expand Down

0 comments on commit 63c9129

Please sign in to comment.