Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Issue 174523002: Reland "Move MemoryCache implementation details out of Resource" (Closed)

Created:
6 years, 10 months ago by Nate Chapin
Modified:
6 years, 9 months ago
Reviewers:
abarth-chromium
CC:
blink-reviews, caseq+blink_chromium.org, loislo+blink_chromium.org, eustas+blink_chromium.org, alph+blink_chromium.org, yurys+blink_chromium.org, lushnikov+blink_chromium.org, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, gavinp+loader_chromium.org, devtools-reviews_chromium.org, aandrey+blink_chromium.org
Visibility:
Public.

Description

Reland "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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -148 lines) Patch
M LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html View 2 chunks +0 lines, -8 lines 0 comments Download
M Source/core/fetch/ImageResource.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/fetch/ImageResource.cpp View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/fetch/MemoryCache.h View 5 chunks +30 lines, -5 lines 0 comments Download
M Source/core/fetch/MemoryCache.cpp View 1 12 chunks +111 lines, -107 lines 0 comments Download
M Source/core/fetch/MemoryCacheTest.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/fetch/Resource.h View 1 2 3 chunks +0 lines, -9 lines 0 comments Download
M Source/core/fetch/Resource.cpp View 1 2 6 chunks +5 lines, -11 lines 0 comments Download
M Source/core/frame/ImageBitmapTest.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/core/inspector/InspectorResourceAgent.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Nate Chapin
Patchset 1 is what was originally landed.
6 years, 10 months ago (2014-02-21 21:53:16 UTC) #1
Nate Chapin
On 2014/02/21 21:53:16, Nate Chapin wrote: > Patchset 1 is what was originally landed. ping
6 years, 9 months ago (2014-02-27 17:58:35 UTC) #2
abarth-chromium
LGTM Sorry, I didn't realize you were looking for a new review. Thanks for uploading ...
6 years, 9 months ago (2014-02-28 06:31:09 UTC) #3
Nate Chapin
The CQ bit was checked by japhet@chromium.org
6 years, 9 months ago (2014-03-10 16:07:50 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/japhet@chromium.org/174523002/30001
6 years, 9 months ago (2014-03-10 16:18:59 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-10 16:55:16 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel, mac_blink_compile, mac_blink_rel, win_blink_compile
6 years, 9 months ago (2014-03-10 16:55:17 UTC) #7
Nate Chapin
The CQ bit was checked by japhet@chromium.org
6 years, 9 months ago (2014-03-10 17:23:27 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/japhet@chromium.org/174523002/190001
6 years, 9 months ago (2014-03-10 17:28:21 UTC) #9
commit-bot: I haz the power
6 years, 9 months ago (2014-03-10 18:49:23 UTC) #10
Message was sent while issue was closed.
Change committed as 168851

Powered by Google App Engine
This is Rietveld 408576698