[webkit-reviews] review granted: [Bug 180118] NetworkCache::Storage should protect itself when removing operations from its maps : [Attachment 327802] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 28 16:48:14 PST 2017


Antti Koivisto <koivisto at iki.fi> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 180118: NetworkCache::Storage should protect itself when removing
operations from its maps
https://bugs.webkit.org/show_bug.cgi?id=180118

Attachment 327802: Patch

https://bugs.webkit.org/attachment.cgi?id=327802&action=review




--- Comment #2 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 327802
  --> https://bugs.webkit.org/attachment.cgi?id=327802
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327802&action=review

Storage::remove(const Key& key) probably needs one too before
removeFromPendingWriteOperations() call.

> Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:672
> +	   auto protectedThis = makeRef(*this);
> +
>	   ASSERT(m_activeReadOperations.contains(&readOperation));
>	   m_activeReadOperations.remove(&readOperation);

Alternatively these could do

auto toDelete = m_activeReadOperations.take(&readOperation);

> Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:925
>	   RunLoop::main().dispatch([this, &traverseOperation] {
>	       traverseOperation.handler(nullptr, { });
> +
> +	       auto protectedThis = makeRef(*this);
> +
>	       m_activeTraverseOperations.remove(&traverseOperation);

This is not strictly needed here but I guess it is good documentation.


More information about the webkit-reviews mailing list