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

Issue 12192005: Add new simple disk cache backend. (Closed)

Created:
7 years, 10 months ago by gavinp
Modified:
7 years, 9 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, gavinp+disk_chromium.org
Visibility:
Public.

Description

Add new simple disk cache backend. Introducing the simple backend that stores one disk_cache entry per file. At this point, entries can be created, doomed, and basic caching appears to work. It is asynchronous, performing all IO operations on a worker pool. It's careful enough about lifetime that it should be possible to delete quickly, without error or races. It's missing many features of a real disk cache. Most notably, it can't detect corruption, it does not have any kind of IO thread bitmap/hashes to allow fast responses, and it does not have eviction at all. This issue is downstream of https://codereview.chromium.org/12207120/ (remove bad const from disk cache interfaces), which must land before it. It is upstream of https://codereview.chromium.org/12226095/ (Make synchronous methods reentrant), and must land before that issue. R=rvargas@chromium.org,pasko@chromium.org BUG=173388, 173390 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=182845 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184493

Patch Set 1 #

Patch Set 2 : clean up includes, add using #

Patch Set 3 : don't actually use it #

Patch Set 4 : lint and constructor privatization #

Patch Set 5 : more using #

Patch Set 6 : conditional compilation #

Patch Set 7 : rebase to trunk (::FilePath --> base::FilePath) #

Total comments: 95

Patch Set 8 : rename only upload #

Patch Set 9 : remediation to review #

Total comments: 20

Patch Set 10 : pasko remediation #

Patch Set 11 : move pending operation classes around #

Patch Set 12 : moar logging #

Patch Set 13 : moar logging #

Patch Set 14 : indent #

Patch Set 15 : moar indent #

Patch Set 16 : clean up some NOTIMPLEMENTED call sites #

Patch Set 17 : fix dcheck #

Total comments: 10

Patch Set 18 : rebase before remediation #

Total comments: 2

Patch Set 19 : remediate to felipeg review #

Total comments: 47

Patch Set 20 : remediation #

Total comments: 3

Patch Set 21 : fix dcheck #

Total comments: 6

Patch Set 22 : clear to land #

Patch Set 23 : build fix, log fix #

Patch Set 24 : add header #

Patch Set 25 : rebase #

Patch Set 26 : build fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1100 lines, -0 lines) Patch
M net/disk_cache/backend_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +7 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_backend_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +87 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_backend_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +154 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_disk_format.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +28 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_entry_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +112 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_entry_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +266 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_synchronous_entry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +111 lines, -0 lines 0 comments Download
A net/disk_cache/simple/simple_synchronous_entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +322 lines, -0 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
gavinp
Ricardo, I've cleaned up the patches we've been passing around, and here's the beginning of ...
7 years, 10 months ago (2013-02-02 21:28:19 UTC) #1
gavinp
Egor: Please take a look as well. +cc felipeg, but he's out next week, so ...
7 years, 10 months ago (2013-02-02 21:30:56 UTC) #2
pasko-google - do not use
looking only at the header there is a nit: > Introducing the very_simple backend that ...
7 years, 10 months ago (2013-02-04 21:42:44 UTC) #3
pasko-google - do not use
I got the first look at the cache creation logic. This set of comments resulted ...
7 years, 10 months ago (2013-02-05 21:20:33 UTC) #4
rvargas (doing something else)
https://codereview.chromium.org/12192005/diff/9004/net/DEPS File net/DEPS (right): https://codereview.chromium.org/12192005/diff/9004/net/DEPS#newcode8 net/DEPS:8: "+third_party/smhasher", I'm fine with switching to murmur, but I ...
7 years, 10 months ago (2013-02-06 03:28:40 UTC) #5
gavinp
Please take a look. I have addressed most comments. https://codereview.chromium.org/12192005/diff/9004/net/DEPS File net/DEPS (right): https://codereview.chromium.org/12192005/diff/9004/net/DEPS#newcode8 net/DEPS:8: ...
7 years, 10 months ago (2013-02-08 23:17:51 UTC) #6
gavinp
https://codereview.chromium.org/12192005/diff/9004/net/net.gyp File net/net.gyp (right): https://codereview.chromium.org/12192005/diff/9004/net/net.gyp#newcode1046 net/net.gyp:1046: 'sources!': [ On 2013/02/06 03:28:40, rvargas wrote: > why ...
7 years, 10 months ago (2013-02-08 23:27:21 UTC) #7
pasko-google - do not use
Generally I like the approach. The synchronous entry acquire/release looks overly complicated at first glance, ...
7 years, 10 months ago (2013-02-11 13:59:25 UTC) #8
gavinp
Egor, Thanks for the review. This new upload has more discipline about logging, and also ...
7 years, 10 months ago (2013-02-11 17:55:50 UTC) #9
gavinp
+willchan for additional review (he's expressed an interest, and rvargas is out for a bit ...
7 years, 10 months ago (2013-02-11 18:07:16 UTC) #10
pasko-google - do not use
https://codereview.chromium.org/12192005/diff/20012/net/disk_cache/simple/simple_backend_impl.cc File net/disk_cache/simple/simple_backend_impl.cc (right): https://codereview.chromium.org/12192005/diff/20012/net/disk_cache/simple/simple_backend_impl.cc#newcode48 net/disk_cache/simple/simple_backend_impl.cc:48: EnsureCachePathExistsOnWorkerThread, On 2013/02/11 17:55:50, gavinp wrote: > On 2013/02/11 ...
7 years, 10 months ago (2013-02-11 18:13:44 UTC) #11
gavinp
https://codereview.chromium.org/12192005/diff/20012/net/disk_cache/simple/simple_backend_impl.cc File net/disk_cache/simple/simple_backend_impl.cc (right): https://codereview.chromium.org/12192005/diff/20012/net/disk_cache/simple/simple_backend_impl.cc#newcode48 net/disk_cache/simple/simple_backend_impl.cc:48: EnsureCachePathExistsOnWorkerThread, On 2013/02/11 18:13:44, pasko wrote: > On 2013/02/11 ...
7 years, 10 months ago (2013-02-11 18:32:26 UTC) #12
felipeg
Overall looks good! Only minor details. https://chromiumcodereview.appspot.com/12192005/diff/33004/net/disk_cache/backend_impl.cc File net/disk_cache/backend_impl.cc (right): https://chromiumcodereview.appspot.com/12192005/diff/33004/net/disk_cache/backend_impl.cc#newcode274 net/disk_cache/backend_impl.cc:274: #if defined(USE_SIMPLE_BACKEND) SIMPLE_BACKEND ...
7 years, 10 months ago (2013-02-12 13:25:20 UTC) #13
felipeg
https://chromiumcodereview.appspot.com/12192005/diff/21009/net/disk_cache/simple/simple_entry_impl.cc File net/disk_cache/simple/simple_entry_impl.cc (right): https://chromiumcodereview.appspot.com/12192005/diff/21009/net/disk_cache/simple/simple_entry_impl.cc#newcode177 net/disk_cache/simple/simple_entry_impl.cc:177: if (!synchronous_entry_) { as discussed, instead of checking the ...
7 years, 10 months ago (2013-02-12 14:50:22 UTC) #14
gavinp
Thanks for the review Felipe. I've remediated to your comments. Ricardo: *ping* https://chromiumcodereview.appspot.com/12192005/diff/33004/net/disk_cache/backend_impl.cc File net/disk_cache/backend_impl.cc ...
7 years, 10 months ago (2013-02-12 15:45:57 UTC) #15
felipeg
lgtm
7 years, 10 months ago (2013-02-12 16:20:40 UTC) #16
rvargas (doing something else)
https://codereview.chromium.org/12192005/diff/9004/net/disk_cache/very_simple/very_simple_backend_impl.cc File net/disk_cache/very_simple/very_simple_backend_impl.cc (right): https://codereview.chromium.org/12192005/diff/9004/net/disk_cache/very_simple/very_simple_backend_impl.cc#newcode76 net/disk_cache/very_simple/very_simple_backend_impl.cc:76: DCHECK(thread_checker_.CalledOnValidThread()); On 2013/02/08 23:17:51, gavinp wrote: > On 2013/02/06 ...
7 years, 10 months ago (2013-02-13 01:48:46 UTC) #17
pasko-google - do not use
looking at Ricardo's comments, I've got one extra fly by for you https://codereview.chromium.org/12192005/diff/26024/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc ...
7 years, 10 months ago (2013-02-13 11:36:24 UTC) #18
gavinp
PTAL now! Thanks. https://codereview.chromium.org/12192005/diff/9004/net/disk_cache/very_simple/very_simple_backend_impl.cc File net/disk_cache/very_simple/very_simple_backend_impl.cc (right): https://codereview.chromium.org/12192005/diff/9004/net/disk_cache/very_simple/very_simple_backend_impl.cc#newcode76 net/disk_cache/very_simple/very_simple_backend_impl.cc:76: DCHECK(thread_checker_.CalledOnValidThread()); On 2013/02/13 01:48:46, rvargas wrote: ...
7 years, 10 months ago (2013-02-14 15:29:55 UTC) #19
felipeg
https://codereview.chromium.org/12192005/diff/45002/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/12192005/diff/45002/net/disk_cache/simple/simple_synchronous_entry.cc#newcode260 net/disk_cache/simple/simple_synchronous_entry.cc:260: scoped_ptr<char[]> key(new char[header.key_length]); I don't agree with Ricardo. Having ...
7 years, 10 months ago (2013-02-14 15:51:59 UTC) #20
rvargas (doing something else)
Rev 21 lgtm https://codereview.chromium.org/12192005/diff/26024/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/12192005/diff/26024/net/disk_cache/simple/simple_synchronous_entry.cc#newcode53 net/disk_cache/simple/simple_synchronous_entry.cc:53: int64 FileOffsetFromDataOffset(size_t key_size, int offset) { ...
7 years, 10 months ago (2013-02-14 21:09:30 UTC) #21
gavinp
Thanks! I've uploaded a "clear to land" version for CQ. The rest of the downstream ...
7 years, 10 months ago (2013-02-15 16:04:00 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gavinp@chromium.org/12192005/51001
7 years, 10 months ago (2013-02-15 16:05:14 UTC) #23
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 10 months ago (2013-02-15 16:16:24 UTC) #24
pasko-google - do not use
https://codereview.chromium.org/12192005/diff/48003/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/12192005/diff/48003/net/disk_cache/simple/simple_synchronous_entry.cc#newcode205 net/disk_cache/simple/simple_synchronous_entry.cc:205: DLOG(INFO) << "CreatePlatformFile error " << error << " ...
7 years, 10 months ago (2013-02-15 16:42:00 UTC) #25
gavinp
Doh. Thanks! https://codereview.chromium.org/12192005/diff/48003/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/12192005/diff/48003/net/disk_cache/simple/simple_synchronous_entry.cc#newcode205 net/disk_cache/simple/simple_synchronous_entry.cc:205: DLOG(INFO) << "CreatePlatformFile error " << error ...
7 years, 10 months ago (2013-02-15 17:19:54 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gavinp@chromium.org/12192005/58002
7 years, 10 months ago (2013-02-15 17:20:42 UTC) #27
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 10 months ago (2013-02-15 17:54:19 UTC) #28
gavinp
On 2013/02/15 17:54:19, I haz the power (commit-bot) wrote: > Sorry for I got bad ...
7 years, 10 months ago (2013-02-15 18:17:16 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gavinp@chromium.org/12192005/65001
7 years, 10 months ago (2013-02-15 18:19:46 UTC) #30
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 10 months ago (2013-02-15 18:50:30 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gavinp@chromium.org/12192005/65001
7 years, 10 months ago (2013-02-15 19:28:48 UTC) #32
commit-bot: I haz the power
Change committed as 182845
7 years, 10 months ago (2013-02-15 22:08:30 UTC) #33
enne (OOO)
On 2013/02/15 22:08:30, I haz the power (commit-bot) wrote: > Change committed as 182845 This ...
7 years, 10 months ago (2013-02-15 22:47:30 UTC) #34
Lei Zhang
Probably just needed a GG_ULONGLONG() ...
7 years, 10 months ago (2013-02-15 22:58:12 UTC) #35
felipeg
https://codereview.chromium.org/12192005/diff/45002/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/12192005/diff/45002/net/disk_cache/simple/simple_synchronous_entry.cc#newcode260 net/disk_cache/simple/simple_synchronous_entry.cc:260: scoped_ptr<char[]> key(new char[header.key_length]); On 2013/02/14 21:09:30, rvargas wrote: > ...
7 years, 10 months ago (2013-02-22 13:19:20 UTC) #36
gavinp
7 years, 9 months ago (2013-02-25 22:01:49 UTC) #37
Message was sent while issue was closed.
Committed patchset #26 manually as r184493 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698