Skip to content
Permalink
Browse files
WorkerCacheStorageConnection::doRemove can assert in case two frames …
…try to delete the same cache at the same time

https://bugs.webkit.org/show_bug.cgi?id=183041

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

* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
case of an already deleted cache, i.e. returned identifer is 0.

Canonical link: https://commits.webkit.org/198793@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Feb 22, 2018
1 parent f0b39c5 commit ee39eff3a3a238f8534b6ac4f200faad6c9964d7
Showing with 12 additions and 1 deletion.
  1. +11 −0 Source/WebCore/ChangeLog
  2. +1 −1 Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp
@@ -1,3 +1,14 @@
2018-02-22 Youenn Fablet <youenn@apple.com>

WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
https://bugs.webkit.org/show_bug.cgi?id=183041

Reviewed by Chris Dumez.

* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
case of an already deleted cache, i.e. returned identifer is 0.

2018-02-22 Alejandro G. Castro <alex@igalia.com>

Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
@@ -124,7 +124,7 @@ void WorkerCacheStorageConnection::doRemove(uint64_t requestIdentifier, uint64_t
{
callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, cacheIdentifier] () mutable {
mainThreadConnection->remove(cacheIdentifier, [workerThread = WTFMove(workerThread), requestIdentifier, cacheIdentifier] (const CacheIdentifierOrError& result) mutable {
ASSERT_UNUSED(cacheIdentifier, !result.has_value() || result.value().identifier == cacheIdentifier);
ASSERT_UNUSED(cacheIdentifier, !result.has_value() || !result.value().identifier || result.value().identifier == cacheIdentifier);
workerThread->runLoop().postTaskForMode([requestIdentifier, result] (auto& scope) mutable {
downcast<WorkerGlobalScope>(scope).cacheStorageConnection().removeCompleted(requestIdentifier, result);
}, WorkerRunLoop::defaultMode());

0 comments on commit ee39eff

Please sign in to comment.