Consider merging https://chromium.googlesource.com/chromium/blink/+/b4646c0bed3266b27c6bbdd3c0f47c456bde420f No need for a separate contains() check - HashMap remove/take can handle missing elements just fine. I suspect their SVG code might have diverged enough from our code though.
Just checked WebKit trunk today and both SVGImageCache::removeClientFromCache() and SVGResourcesCache::removeResourcesFromRenderer() no longer have a check for the removed object in the hashmap. It will just go ahead and execute a 'remove()' call. Perhaps the bug can be closed?
Closing based on review comments.