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

Issue 169323003: Implementation of leveldb-backed PrefStore (Closed)

Created:
6 years, 10 months ago by dgrogan
Modified:
6 years, 6 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, tfarina
Visibility:
Public.

Description

Implementation of leveldb-backed PrefStore. This is not hooked up yet, migration code from Json-backed stores is needed, among other things. BUG=362814 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271602 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272671 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273174

Patch Set 1 #

Total comments: 59

Patch Set 2 : Include most of a PersistentPrefStore implementation #

Total comments: 22

Patch Set 3 : added Helper that owns the DB object #

Total comments: 15

Patch Set 4 : now with FileThreadDeserializer #

Total comments: 4

Patch Set 5 : Use PostTaskAndReplyWithResult instead of scoped_refptr #

Patch Set 6 : OpenDB does repair; type test #

Patch Set 7 : write every 10s #

Total comments: 46

Patch Set 8 : respond to comments #

Total comments: 15

Patch Set 9 : respond to comments #

Total comments: 4

Patch Set 10 : move to error bit masks #

Patch Set 11 : fix pref service factory error #

Total comments: 14

Patch Set 12 : respond to comments; add histograms.xml entries #

Total comments: 5

Patch Set 13 : change cast to GetAsDictionary #

Patch Set 14 : ToT #

Patch Set 15 : Tot #

Patch Set 16 : moved to chrome/browser/prefs #

Patch Set 17 : removed BASE_PREFS_EXPORT #

Patch Set 18 : ToT; small changes necessary #

Patch Set 19 : remove unnecessary empty .log file #

Patch Set 20 : ToT after revert #

Patch Set 21 : Remove substantive code from DCHECK #

Patch Set 22 : ToT after revert #

Patch Set 23 : Close the database after each test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+891 lines, -1 line) Patch
M base/prefs/json_pref_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +5 lines, -0 lines 0 comments Download
M base/prefs/persistent_pref_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/prefs/chrome_pref_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -1 line 0 comments Download
A chrome/browser/prefs/leveldb_pref_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +116 lines, -0 lines 0 comments Download
A chrome/browser/prefs/leveldb_pref_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +419 lines, -0 lines 0 comments Download
A chrome/browser/prefs/leveldb_pref_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +304 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/prefs/corrupted_leveldb/000005.ldb View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Binary file 0 comments Download
A chrome/test/data/prefs/corrupted_leveldb/CURRENT View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/prefs/corrupted_leveldb/MANIFEST-000007 View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Binary file 0 comments Download
M tools/metrics/histograms/histograms.xml View 2 chunks +38 lines, -0 lines 0 comments Download

Messages

Total messages: 61 (0 generated)
dgrogan
Hi Mattias, Could you review this? In the interesting of making this initial review small ...
6 years, 10 months ago (2014-02-21 00:23:22 UTC) #1
Mattias Nissler (ping if slow)
OK, here is a first round of comments. After reviewing, I realized that it might ...
6 years, 10 months ago (2014-02-24 09:00:40 UTC) #2
dgrogan
Thanks for the feedback. There's almost a complete PersistentPrefStore implementation here now. I need to ...
6 years, 10 months ago (2014-02-25 03:32:07 UTC) #3
Mattias Nissler (ping if slow)
https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc#newcode85 base/prefs/leveldb_pref_store.cc:85: &LevelDBPrefStore::PersistOnFileThread, this, key, value_string)); On 2014/02/25 03:32:08, dgrogan wrote: ...
6 years, 10 months ago (2014-02-25 10:51:44 UTC) #4
dgrogan
https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc#newcode85 base/prefs/leveldb_pref_store.cc:85: &LevelDBPrefStore::PersistOnFileThread, this, key, value_string)); > So you'll need a ...
6 years, 10 months ago (2014-02-26 07:10:46 UTC) #5
Mattias Nissler (ping if slow)
https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc#newcode85 base/prefs/leveldb_pref_store.cc:85: &LevelDBPrefStore::PersistOnFileThread, this, key, value_string)); On 2014/02/26 07:10:47, dgrogan wrote: ...
6 years, 10 months ago (2014-02-26 08:34:59 UTC) #6
dgrogan
On 2014/02/26 08:34:59, Mattias Nissler wrote: > https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc > File base/prefs/leveldb_pref_store.cc (right): > > https://codereview.chromium.org/169323003/diff/1/base/prefs/leveldb_pref_store.cc#newcode85 ...
6 years, 9 months ago (2014-02-27 03:16:34 UTC) #7
dgrogan
https://codereview.chromium.org/169323003/diff/80001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/80001/base/prefs/leveldb_pref_store.cc#newcode167 base/prefs/leveldb_pref_store.cc:167: helper_.reset(new Helper(make_scoped_ptr(db))); This seems sloppy, reading from disk on ...
6 years, 9 months ago (2014-02-27 03:19:47 UTC) #8
Mattias Nissler (ping if slow)
On 2014/02/27 03:16:34, dgrogan wrote: > On 2014/02/26 08:34:59, Mattias Nissler wrote: > > > ...
6 years, 9 months ago (2014-02-27 08:39:59 UTC) #9
Mattias Nissler (ping if slow)
OK, your new approach to threading looks reasonable - see also my other comments in ...
6 years, 9 months ago (2014-02-27 08:49:23 UTC) #10
dgrogan
Hi Mattias, I haven't addressed all your comments yet* but wanted to get your feedback ...
6 years, 9 months ago (2014-03-05 03:06:57 UTC) #11
Mattias Nissler (ping if slow)
Just a high-level comment for now, let me know if you want me to do ...
6 years, 9 months ago (2014-03-05 18:28:15 UTC) #12
dgrogan
High-level comment is perfect for now, thanks. Will rework with PostTaskAndReply.
6 years, 9 months ago (2014-03-05 18:31:40 UTC) #13
dgrogan
I reworked it to use PostTaskAndReplyWithResult instead of scoped_refptr. Comments welcome but if I don't ...
6 years, 9 months ago (2014-03-06 03:03:40 UTC) #14
dgrogan
This is ready for another look. It has been reworked to write only every 10 ...
6 years, 9 months ago (2014-03-20 00:25:36 UTC) #15
Mattias Nissler (ping if slow)
This looks reasonably good now, mostly nits that remain. https://codereview.chromium.org/169323003/diff/150001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/150001/base/prefs/leveldb_pref_store.cc#newcode22 base/prefs/leveldb_pref_store.cc:22: ...
6 years, 9 months ago (2014-03-20 09:32:25 UTC) #16
dgrogan
Hi Mattias, this is (finally) ready for another look. https://codereview.chromium.org/169323003/diff/150001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/150001/base/prefs/leveldb_pref_store.cc#newcode22 base/prefs/leveldb_pref_store.cc:22: ...
6 years, 8 months ago (2014-04-12 00:32:44 UTC) #17
Mattias Nissler (ping if slow)
https://codereview.chromium.org/169323003/diff/170001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/170001/base/prefs/leveldb_pref_store.cc#newcode106 base/prefs/leveldb_pref_store.cc:106: if (destroy_succeeded) { nit: curlies not needed or you ...
6 years, 8 months ago (2014-04-14 10:11:41 UTC) #18
dgrogan
https://codereview.chromium.org/169323003/diff/170001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/170001/base/prefs/leveldb_pref_store.cc#newcode106 base/prefs/leveldb_pref_store.cc:106: if (destroy_succeeded) { On 2014/04/14 10:11:41, Mattias Nissler wrote: ...
6 years, 8 months ago (2014-04-17 01:10:26 UTC) #19
Mattias Nissler (ping if slow)
https://codereview.chromium.org/169323003/diff/170001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/170001/base/prefs/leveldb_pref_store.cc#newcode412 base/prefs/leveldb_pref_store.cc:412: case PREF_READ_ERROR_LEVELDB_SOME_DATA_LOST_AFTER_REPAIR: On 2014/04/17 01:10:27, dgrogan wrote: > On ...
6 years, 8 months ago (2014-04-17 08:50:49 UTC) #20
dgrogan
Mattias, PTAL? Let me know what you think of the error masks. I didn't fill ...
6 years, 8 months ago (2014-04-25 01:24:14 UTC) #21
dgrogan
https://codereview.chromium.org/169323003/diff/190001/base/prefs/leveldb_pref_store.h File base/prefs/leveldb_pref_store.h (right): https://codereview.chromium.org/169323003/diff/190001/base/prefs/leveldb_pref_store.h#newcode103 base/prefs/leveldb_pref_store.h:103: scoped_ptr<FileThreadSerializer> serializer_; On 2014/04/17 08:50:50, Mattias Nissler wrote: > ...
6 years, 8 months ago (2014-04-25 01:24:31 UTC) #22
Mattias Nissler (ping if slow)
This looks pretty good already now, just two more suggestions for simplification. https://codereview.chromium.org/169323003/diff/230001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc ...
6 years, 8 months ago (2014-04-25 12:28:23 UTC) #23
dgrogan
Ready for another look. Thanks. https://codereview.chromium.org/169323003/diff/230001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/230001/base/prefs/leveldb_pref_store.cc#newcode25 base/prefs/leveldb_pref_store.cc:25: OPENED = 1, On ...
6 years, 7 months ago (2014-04-30 09:36:48 UTC) #24
Mattias Nissler (ping if slow)
I like the latest patch set, just one last thing before the magic 4 laters. ...
6 years, 7 months ago (2014-04-30 09:58:21 UTC) #25
dgrogan
https://codereview.chromium.org/169323003/diff/250001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/250001/base/prefs/leveldb_pref_store.cc#newcode116 base/prefs/leveldb_pref_store.cc:116: reading_results->error |= OPENED; On 2014/04/30 09:58:21, Mattias Nissler wrote: ...
6 years, 7 months ago (2014-05-01 09:00:15 UTC) #26
Mattias Nissler (ping if slow)
LGTM https://codereview.chromium.org/169323003/diff/250001/base/prefs/leveldb_pref_store.cc File base/prefs/leveldb_pref_store.cc (right): https://codereview.chromium.org/169323003/diff/250001/base/prefs/leveldb_pref_store.cc#newcode116 base/prefs/leveldb_pref_store.cc:116: reading_results->error |= OPENED; On 2014/05/01 09:00:15, dgrogan wrote: ...
6 years, 7 months ago (2014-05-02 08:43:48 UTC) #27
dgrogan
Ilya, could you review this for histograms.xml?
6 years, 7 months ago (2014-05-02 23:50:10 UTC) #28
Ilya Sherman
histograms lgtm
6 years, 7 months ago (2014-05-03 00:02:26 UTC) #29
dgrogan
Albert, could you review this as a base/ OWNER?
6 years, 7 months ago (2014-05-03 00:42:12 UTC) #30
brettw
I don't think we should add a leveldb dep on base. I've never been a ...
6 years, 7 months ago (2014-05-03 00:52:41 UTC) #31
dgrogan
Joi, what is your opinion on moving base/prefs to components? Should it go in components/user_prefs?
6 years, 7 months ago (2014-05-03 03:15:33 UTC) #32
tfarina
On 2014/05/03 00:52:41, brettw wrote: > I don't think we should add a leveldb dep ...
6 years, 7 months ago (2014-05-03 04:51:39 UTC) #33
Mattias Nissler (ping if slow)
On 2014/05/03 03:15:33, dgrogan wrote: > Joi, what is your opinion on moving base/prefs to ...
6 years, 7 months ago (2014-05-05 11:26:07 UTC) #34
Jói
Hi guys, Sorry for the late response. I'm still a Chromium committer and am keeping ...
6 years, 7 months ago (2014-05-05 22:07:55 UTC) #35
Jói
Looking at the code review a bit, I wonder if //components/user_prefs can be a model ...
6 years, 7 months ago (2014-05-05 22:10:30 UTC) #36
Mattias Nissler (ping if slow)
On 2014/05/05 22:10:30, Jói wrote: > Looking at the code review a bit, I wonder ...
6 years, 7 months ago (2014-05-06 08:19:45 UTC) #37
brettw
On 2014/05/05 22:07:55, Jói wrote: > > I think you should be careful about making ...
6 years, 7 months ago (2014-05-06 19:30:10 UTC) #38
Jói
> This is basically what components is. Smallish re-usable bits of code with > clear ...
6 years, 7 months ago (2014-05-06 20:46:31 UTC) #39
brettw
On Tue, May 6, 2014 at 1:46 PM, Jói Sigurðsson <joi@chromium.org> wrote: >> This is ...
6 years, 7 months ago (2014-05-06 21:01:03 UTC) #40
dgrogan
I moved leveldb_pref_store* to //chrome/browser/prefs as suggested by Mattias, avoiding the components issue for now. ...
6 years, 7 months ago (2014-05-08 00:57:28 UTC) #41
blundell
On 2014/05/06 21:01:03, brettw wrote: > On Tue, May 6, 2014 at 1:46 PM, Jói ...
6 years, 7 months ago (2014-05-09 11:31:54 UTC) #42
blundell
On 2014/05/08 00:57:28, dgrogan wrote: > I moved leveldb_pref_store* to //chrome/browser/prefs as suggested by Mattias, ...
6 years, 7 months ago (2014-05-09 11:32:58 UTC) #43
Mattias Nissler (ping if slow)
On 2014/05/09 11:32:58, blundell wrote: > On 2014/05/08 00:57:28, dgrogan wrote: > > I moved ...
6 years, 7 months ago (2014-05-09 12:00:23 UTC) #44
dgrogan
The CQ bit was checked by dgrogan@chromium.org
6 years, 7 months ago (2014-05-20 03:26:32 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgrogan@chromium.org/169323003/380001
6 years, 7 months ago (2014-05-20 03:27:05 UTC) #46
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-20 05:19:20 UTC) #47
commit-bot: I haz the power
Change committed as 271602
6 years, 7 months ago (2014-05-20 06:57:16 UTC) #48
dgrogan
The CQ bit was checked by dgrogan@chromium.org
6 years, 7 months ago (2014-05-23 01:20:20 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgrogan@chromium.org/169323003/420001
6 years, 7 months ago (2014-05-23 01:22:08 UTC) #50
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-23 07:23:37 UTC) #51
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-23 09:40:16 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/mac_chromium_rel/builds/31952)
6 years, 7 months ago (2014-05-23 09:40:17 UTC) #53
dgrogan
The CQ bit was checked by dgrogan@chromium.org
6 years, 7 months ago (2014-05-23 21:53:26 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgrogan@chromium.org/169323003/420001
6 years, 7 months ago (2014-05-23 21:54:04 UTC) #55
commit-bot: I haz the power
Change committed as 272671
6 years, 7 months ago (2014-05-24 01:25:59 UTC) #56
sadrul
On 2014/05/24 01:25:59, I haz the power (commit-bot) wrote: > Change committed as 272671 Reverted ...
6 years, 7 months ago (2014-05-24 05:10:43 UTC) #57
dgrogan
The CQ bit was checked by dgrogan@chromium.org
6 years, 6 months ago (2014-05-28 01:18:13 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgrogan@chromium.org/169323003/460001
6 years, 6 months ago (2014-05-28 01:19:12 UTC) #59
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_rel on tryserver.chromium ...
6 years, 6 months ago (2014-05-28 05:18:21 UTC) #60
commit-bot: I haz the power
6 years, 6 months ago (2014-05-28 08:28:05 UTC) #61
Message was sent while issue was closed.
Change committed as 273174

Powered by Google App Engine
This is Rietveld 408576698