[webkit-reviews] review granted: [Bug 236029] Remove OriginStorageManager if it's not in use : [Attachment 450679] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 2 13:53:00 PST 2022


Darin Adler <darin at apple.com> has granted Sihui Liu <sihui_liu at apple.com>'s
request for review:
Bug 236029: Remove OriginStorageManager if it's not in use
https://bugs.webkit.org/show_bug.cgi?id=236029

Attachment 450679: Patch

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




--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 450679
  --> https://bugs.webkit.org/attachment.cgi?id=450679
Patch

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

> Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:181
> +	   HashSet<WebCore::ClientOrigin> originsToRemove;
> +	   for (auto& [origin, manager] : m_localOriginStorageManagers) {
> +	       manager->connectionClosed(connection);
> +	       if (!manager->isActive())
> +		   originsToRemove.add(origin);
> +	   }
> +
> +	   for (auto origin : originsToRemove)
> +	       m_localOriginStorageManagers.remove(origin);

HashSet has a removeIf function that can do this sort of thing much more
efficiently. We should use it here.


More information about the webkit-reviews mailing list