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

Issue 1414033002: [CacheStorage] Give cache directories unique names (Closed)

Created:
5 years, 2 months ago by jkarlin
Modified:
5 years, 1 month ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jkarlin+watch_chromium.org, nhiroki
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[CacheStorage] Give cache directories unique names The CacheStorage class creates a directory for each cache based off of a hash of the cache's name. This is problematic in situations where a cache is deleted and then recreated (but not yet wiped from disk as javascript might be referencing it). This CL gives every new cache a unique directory and stores the directory mapping in the cache storage index protobuf. Legacy caches are moved to new directories on CacheStorage initialization. BUG=542668 Committed: https://crrev.com/4519a22b4c1683f1e79543a4238bc5cdb1880b5e Cr-Commit-Position: refs/heads/master@{#356055}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Fixes #

Patch Set 4 : Add tests #

Patch Set 5 : Nits #

Total comments: 10

Patch Set 6 : Rebase #

Patch Set 7 : Migrate caches with legacy directory names to random names #

Patch Set 8 : Nits #

Patch Set 9 : Add test for windows deletion issue #

Patch Set 10 : Move functions back into class #

Patch Set 11 : Fix memory leak #

Patch Set 12 : Nit #

Total comments: 8

Patch Set 13 : Address comments from PS12 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+286 lines, -69 lines) Patch
M content/browser/cache_storage/cache_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +120 lines, -65 lines 0 comments Download
M content/browser/cache_storage/cache_storage.proto View 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_cache.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +157 lines, -3 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 28 (13 generated)
jkarlin
jsbell: PTAL, thanks!
5 years, 1 month ago (2015-10-22 15:13:50 UTC) #4
jsbell
lgtm with a few minor suggestions. What's the long term plan for removing the legacy ...
5 years, 1 month ago (2015-10-22 16:38:52 UTC) #5
jkarlin
Thanks for your comments. PTAL at the changes. https://codereview.chromium.org/1414033002/diff/80001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/1414033002/diff/80001/content/browser/cache_storage/cache_storage.cc#newcode188 content/browser/cache_storage/cache_storage.cc:188: DCHECK(cache_name_to_cache_dir_.find(cache_name) ...
5 years, 1 month ago (2015-10-23 17:23:09 UTC) #6
jkarlin
Forgot to mention, the newest code migrates the hexed directories to UUID directories.
5 years, 1 month ago (2015-10-23 17:24:27 UTC) #7
jsbell
Awesome, lgtm Can you update the CL description to indicate that old caches are migrated? ...
5 years, 1 month ago (2015-10-23 21:09:59 UTC) #9
jkarlin
Thanks! https://codereview.chromium.org/1414033002/diff/210001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/1414033002/diff/210001/content/browser/cache_storage/cache_storage.cc#newcode51 content/browser/cache_storage/cache_storage.cc:51: class MigratedLegacyCacheDirectoryNameTest; On 2015/10/23 21:09:59, jsbell wrote: > ...
5 years, 1 month ago (2015-10-23 22:57:41 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1414033002/250001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1414033002/250001
5 years, 1 month ago (2015-10-23 23:11:41 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/112415)
5 years, 1 month ago (2015-10-23 23:22:12 UTC) #17
jkarlin
sky@chromium.org: Please review changes in content/test/BUILD.gn, thanks!
5 years, 1 month ago (2015-10-23 23:46:28 UTC) #19
jkarlin
jochen: Please review changes in content/test/BUILD.gn, thanks!
5 years, 1 month ago (2015-10-26 14:18:46 UTC) #21
sky
LGTM
5 years, 1 month ago (2015-10-26 15:06:50 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1414033002/250001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1414033002/250001
5 years, 1 month ago (2015-10-26 15:09:41 UTC) #25
jochen (gone - plz use gerrit)
lgtm
5 years, 1 month ago (2015-10-26 15:26:20 UTC) #26
commit-bot: I haz the power
Committed patchset #13 (id:250001)
5 years, 1 month ago (2015-10-26 16:03:34 UTC) #27
commit-bot: I haz the power
5 years, 1 month ago (2015-10-26 16:04:15 UTC) #28
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/4519a22b4c1683f1e79543a4238bc5cdb1880b5e
Cr-Commit-Position: refs/heads/master@{#356055}

Powered by Google App Engine
This is Rietveld 408576698