Skip to content
Permalink
Browse files
LayoutTest imported/w3c/web-platform-tests/service-workers/service-wo…
…rker/fetch-event-within-sw.https.html is a flaky failure

https://bugs.webkit.org/show_bug.cgi?id=179248
<rdar://problem/35377756>

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

In case we go up to the initializeSize step and Caches was cleared
between the time we stated to initialize and the time we got there,
we need to make as if Caches was not initialized,
thus keeping m_isInitialized to false and m_storage to nullptr.

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

Canonical link: https://commits.webkit.org/198971@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Mar 2, 2018
1 parent d242394 commit b5c39a167332ab8fdc96fb0597580e180f38daf6
Showing with 21 additions and 0 deletions.
  1. +16 −0 Source/WebKit/ChangeLog
  2. +5 −0 Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp
@@ -1,3 +1,19 @@
2018-03-02 Youenn Fablet <youenn@apple.com>

LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179248
<rdar://problem/35377756>

Reviewed by Chris Dumez.

In case we go up to the initializeSize step and Caches was cleared
between the time we stated to initialize and the time we got there,
we need to make as if Caches was not initialized,
thus keeping m_isInitialized to false and m_storage to nullptr.

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

2018-03-02 Youenn Fablet <youenn@apple.com>

Clients should register to StorageProcess with their service worker registration identifier
@@ -189,6 +189,11 @@ void Caches::initializeSize()
uint64_t size = 0;
m_storage->traverse({ }, 0, [protectedThis = makeRef(*this), this, protectedStorage = makeRef(*m_storage), size](const auto* storage, const auto& information) mutable {
if (!storage) {
if (m_pendingInitializationCallbacks.isEmpty()) {
// Caches was cleared so let's not get initialized.
m_storage = nullptr;
return;
}
m_size = size;
m_isInitialized = true;
auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks);

0 comments on commit b5c39a1

Please sign in to comment.