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

Issue 2416713002: Write out CacheStorageCache size to index file. (Closed)

Created:
4 years, 2 months ago by cmumford
Modified:
3 years, 10 months ago
Reviewers:
bcwhite, clamy, jkarlin
CC:
chromium-reviews, jam, darin-cc_chromium.org, jkarlin+watch_chromium.org, nhiroki
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Write out CacheStorageCache size to index file. Persisting the size allows CacheStorage and CacheStorageManager to avoid using simple cache to unnecessarily calculate the cache size if it is already known. BUG=617963 Committed: https://crrev.com/ffb8a161dcd0ff73a7fff6111a2d6f383c39dec8 Cr-Commit-Position: refs/heads/master@{#440425}

Patch Set 1 #

Patch Set 2 : Added out-of-date index tests. #

Total comments: 23

Patch Set 3 : Consolidated observer methods, renames, cleanup, etc. #

Total comments: 28

Patch Set 4 : Moved CacheStorageIndex + many misc fixes. #

Total comments: 46

Patch Set 5 : Scheduling index writes + lots of other fixes. #

Total comments: 8

Patch Set 6 : Only updating cache sizes for non-doomed caches #

Total comments: 40

Patch Set 7 : New tests, misc changes. #

Total comments: 8

Patch Set 8 : Renamed functions & improved comments. #

Patch Set 9 : Added parens to DCHECK #

Patch Set 10 : Posting index write to the IO thread. #

Total comments: 2

Patch Set 11 : Use callback to wait for index write, fixed mem leak. #

Patch Set 12 : Rebased on tip-of-tree to resolve conflict. #

Patch Set 13 : Fixed leaks in GetAllOriginsUsageWithOldIndex #

Total comments: 3

Patch Set 14 : BrowserThread::PostDelayedTask(IO, ...) --> base::ThreadTaskRunnerHandle::Get()->Post* #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1060 lines, -242 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/cache_storage/README.md View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage.h View 1 2 3 4 5 6 7 8 9 10 11 11 chunks +33 lines, -12 lines 0 comments Download
M content/browser/cache_storage/cache_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 26 chunks +211 lines, -146 lines 0 comments Download
M content/browser/cache_storage/cache_storage.proto View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache.h View 1 2 3 4 5 5 chunks +15 lines, -3 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache.cc View 1 2 3 4 5 6 7 8 9 chunks +41 lines, -13 lines 1 comment Download
A content/browser/cache_storage/cache_storage_cache_observer.h View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_dispatcher_host.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_dispatcher_host.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
A content/browser/cache_storage/cache_storage_index.h View 1 2 3 4 5 6 7 1 chunk +93 lines, -0 lines 0 comments Download
A content/browser/cache_storage/cache_storage_index.cc View 1 2 3 4 5 6 7 1 chunk +114 lines, -0 lines 0 comments Download
A content/browser/cache_storage/cache_storage_index_unittest.cc View 1 2 3 4 5 6 7 1 chunk +164 lines, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_manager.cc View 1 2 3 4 6 chunks +30 lines, -6 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 12 17 chunks +316 lines, -56 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 56 (27 generated)
cmumford
jkarlin: I need to pull a test or two from crrev.com/2277453004. You're welcome to start ...
4 years, 2 months ago (2016-10-13 00:16:32 UTC) #2
cmumford
jkarlin: I'm going to implement a timer for CacheStorage::ScheduleWriteIndex(), but I believe it's ready for ...
4 years, 2 months ago (2016-10-19 17:23:55 UTC) #3
jkarlin
Great to see this. Here are some initial thoughts. https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc#newcode949 content/browser/cache_storage/cache_storage.cc:949: ...
4 years, 2 months ago (2016-10-21 18:04:19 UTC) #4
jkarlin
https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc#newcode73 content/browser/cache_storage/cache_storage.cc:73: class CacheStorage::CacheStorageIndex { Let's put this in its own ...
4 years, 2 months ago (2016-10-21 19:24:40 UTC) #5
cmumford
Sorry for the long delay (on other bugs). PTAL. https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc#newcode73 content/browser/cache_storage/cache_storage.cc:73: ...
4 years, 1 month ago (2016-11-10 17:28:17 UTC) #6
jkarlin
https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/20001/content/browser/cache_storage/cache_storage.cc#newcode73 content/browser/cache_storage/cache_storage.cc:73: class CacheStorage::CacheStorageIndex { On 2016/11/10 17:28:16, cmumford wrote: > ...
4 years, 1 month ago (2016-11-11 18:24:57 UTC) #7
cmumford
What are your thoughts on CacheStorage::ScheduleWriteIndex()? I was thinking of scheduling a write with a ...
4 years ago (2016-11-22 17:45:04 UTC) #8
jkarlin
Close! https://codereview.chromium.org/2416713002/diff/40001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/40001/content/browser/cache_storage/cache_storage.cc#newcode1196 content/browser/cache_storage/cache_storage.cc:1196: barrier_closure.Run(); On 2016/11/22 17:45:03, cmumford wrote: > On ...
4 years ago (2016-11-23 16:02:18 UTC) #9
cmumford
https://codereview.chromium.org/2416713002/diff/60001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/60001/content/browser/cache_storage/cache_storage.cc#newcode11 content/browser/cache_storage/cache_storage.cc:11: #include <unordered_map> On 2016/11/23 16:02:17, jkarlin wrote: > Unused ...
4 years ago (2016-11-29 18:10:21 UTC) #10
jkarlin
https://codereview.chromium.org/2416713002/diff/60001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/60001/content/browser/cache_storage/cache_storage.cc#newcode477 content/browser/cache_storage/cache_storage.cc:477: if (index_modified) { On 2016/11/29 18:10:20, cmumford wrote: > ...
4 years ago (2016-12-01 17:43:31 UTC) #11
cmumford
https://codereview.chromium.org/2416713002/diff/80001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/80001/content/browser/cache_storage/cache_storage.cc#newcode662 content/browser/cache_storage/cache_storage.cc:662: // TODO(cmumford): Write the index in between other cache ...
4 years ago (2016-12-05 17:19:02 UTC) #12
jkarlin
Partial review.. will get to more on Monday. https://codereview.chromium.org/2416713002/diff/100001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/100001/content/browser/cache_storage/cache_storage.cc#newcode438 content/browser/cache_storage/cache_storage.cc:438: // ...
4 years ago (2016-12-09 19:49:19 UTC) #13
jkarlin
Here is the rest, sorry for the delay. I was on triage duty. https://codereview.chromium.org/2416713002/diff/100001/content/browser/cache_storage/cache_storage_cache.cc File ...
4 years ago (2016-12-14 14:19:56 UTC) #14
cmumford
https://codereview.chromium.org/2416713002/diff/100001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/100001/content/browser/cache_storage/cache_storage.cc#newcode438 content/browser/cache_storage/cache_storage.cc:438: // Additionally invalidate any index entries where the cache ...
4 years ago (2016-12-15 22:29:15 UTC) #15
jkarlin
lgtm with a few comments https://codereview.chromium.org/2416713002/diff/120001/content/browser/cache_storage/cache_storage.h File content/browser/cache_storage/cache_storage.h (right): https://codereview.chromium.org/2416713002/diff/120001/content/browser/cache_storage/cache_storage.h#newcode219 content/browser/cache_storage/cache_storage.h:219: void WriteIndex(const base::Callback<void(bool)>& callback); ...
4 years ago (2016-12-19 17:48:15 UTC) #16
cmumford
https://codereview.chromium.org/2416713002/diff/120001/content/browser/cache_storage/cache_storage.h File content/browser/cache_storage/cache_storage.h (right): https://codereview.chromium.org/2416713002/diff/120001/content/browser/cache_storage/cache_storage.h#newcode219 content/browser/cache_storage/cache_storage.h:219: void WriteIndex(const base::Callback<void(bool)>& callback); On 2016/12/19 17:48:15, jkarlin wrote: ...
4 years ago (2016-12-19 19:25:57 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416713002/140001
4 years ago (2016-12-19 19:26:31 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/329110)
4 years ago (2016-12-19 19:35:13 UTC) #22
cmumford
clamy@chromium.org: Please review changes in content/browser/BUILD.gn
4 years ago (2016-12-19 20:40:24 UTC) #24
clamy
BUIL.gn changes lgtm.
4 years ago (2016-12-20 14:35:58 UTC) #29
cmumford
jkarlin@ I made one fix where ScheduleWriteIndex was running WriteIndex on the task runner instead ...
4 years ago (2016-12-21 00:27:11 UTC) #34
cmumford
jkarlin@ This CL is now fixed. I made three changes you may want to give ...
3 years, 12 months ago (2016-12-21 23:20:26 UTC) #43
jkarlin
https://codereview.chromium.org/2416713002/diff/180001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/180001/content/browser/cache_storage/cache_storage.cc#newcode654 content/browser/cache_storage/cache_storage.cc:654: BrowserThread::PostDelayedTask( nit: How about base::ThreadTaskRunnerHandle::Get()->PostDelayedTask? https://codereview.chromium.org/2416713002/diff/240001/content/browser/cache_storage/cache_storage_manager_unittest.cc File content/browser/cache_storage/cache_storage_manager_unittest.cc (right): ...
3 years, 12 months ago (2016-12-22 13:17:59 UTC) #44
cmumford
https://codereview.chromium.org/2416713002/diff/180001/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2416713002/diff/180001/content/browser/cache_storage/cache_storage.cc#newcode654 content/browser/cache_storage/cache_storage.cc:654: BrowserThread::PostDelayedTask( On 2016/12/22 13:17:59, jkarlin wrote: > nit: How ...
3 years, 12 months ago (2016-12-22 14:22:11 UTC) #45
jkarlin
slgtm! https://codereview.chromium.org/2416713002/diff/240001/content/browser/cache_storage/cache_storage_manager_unittest.cc File content/browser/cache_storage/cache_storage_manager_unittest.cc (right): https://codereview.chromium.org/2416713002/diff/240001/content/browser/cache_storage/cache_storage_manager_unittest.cc#newcode1020 content/browser/cache_storage/cache_storage_manager_unittest.cc:1020: original_handle = nullptr; On 2016/12/22 14:22:11, cmumford wrote: ...
3 years, 12 months ago (2016-12-22 14:27:20 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416713002/260001
3 years, 12 months ago (2016-12-22 14:30:43 UTC) #49
commit-bot: I haz the power
Committed patchset #14 (id:260001)
3 years, 12 months ago (2016-12-22 15:27:25 UTC) #52
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/ffb8a161dcd0ff73a7fff6111a2d6f383c39dec8 Cr-Commit-Position: refs/heads/master@{#440425}
3 years, 12 months ago (2016-12-22 15:29:41 UTC) #54
bcwhite
3 years, 11 months ago (2017-01-19 22:21:39 UTC) #56
Message was sent while issue was closed.
https://codereview.chromium.org/2416713002/diff/260001/content/browser/cache_...
File content/browser/cache_storage/cache_storage_cache.cc (right):

https://codereview.chromium.org/2416713002/diff/260001/content/browser/cache_...
content/browser/cache_storage/cache_storage_cache.cc:1395:
DCHECK_EQ(cache_size_, cache_size);
Would you remove this, please?  It causes crash-looping on debug builds after an
unclean shutdown.

Powered by Google App Engine
This is Rietveld 408576698