DescriptionReland "Move MemoryCache implementation details out of Resource"
Currently, the linked-list next/previous pointers for the LRU lists in MemoryCache actually live on Resource. Move them to a new MemoryCacheEntry object that is part of MemoryCache. There are probably more possibilities for changes of this kind.
This change exposed some issues in tests that excercise the MemoryCache directly. Specifically, they add() multiple Resources with the same url, which clobber each other in the MemoryCache::m_resources HashMap. Add an assert to MemoryCache::add() that we are not overwriting existing entries, and give Resources urls in tests where there are conflicts.
Compared to original attempt: Remove some cases that should only ever be hit if the LRULists are already mangled. Add some ASSERTs, and RELEASE_ASSERT !inCache() in Resource's destructor, since if inCache() is true, we're going to use-after-free in MemoryCache later.
BUG=none
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168851
Patch Set 1 #Patch Set 2 : #
Total comments: 1
Patch Set 3 : Rebase #
Messages
Total messages: 10 (0 generated)
|