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

Issue 165223003: Add a Restore() method to ValueStore and make StorageAPI use it (Closed)

Created:
6 years, 10 months ago by Devlin
Modified:
6 years, 10 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add a Restore() method to ValueStore and make StorageAPI use it Take the first steps in preventing the Storage from getting and staying corrupted. This lets us Restore() a ValueStore when it's corrputed, and tries to do so in the StorageAPI calls. This also refactors so that there's a Local and Sync SettingsBackend - this has the added advantage of meaning we don't decorate the Local stores with Sync behavior. BUG=261623 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252617

Patch Set 1 : #

Total comments: 61

Patch Set 2 : Bens #

Total comments: 5

Patch Set 3 : Removed checks in unittests #

Patch Set 4 : IsCorruption() -> IsCorrupted() #

Patch Set 5 : #

Total comments: 25

Patch Set 6 : Ben's II #

Patch Set 7 : Latest master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+891 lines, -530 lines) Patch
M chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.cc View 1 2 3 4 5 1 chunk +19 lines, -1 line 0 comments Download
A chrome/browser/extensions/api/storage/local_storage_backend.h View 1 chunk +47 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/storage/local_storage_backend.cc View 1 1 chunk +37 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store.cc View 1 2 3 4 5 2 chunks +17 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_backend.h View 1 1 chunk +32 lines, -78 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_backend.cc View 1 2 chunks +13 lines, -257 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_frontend.cc View 2 chunks +2 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_quota_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/storage/settings_storage_factory.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.cc View 1 3 chunks +49 lines, -14 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_sync_unittest.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_test_util.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_test_util.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/storage_api.h View 1 1 chunk +27 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/storage/storage_api.cc View 1 6 chunks +47 lines, -24 lines 0 comments Download
A chrome/browser/extensions/api/storage/storage_api_unittest.cc View 1 2 3 4 5 1 chunk +115 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/sync_or_local_value_store_cache.h View 1 3 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/storage/sync_or_local_value_store_cache.cc View 1 5 chunks +51 lines, -30 lines 0 comments Download
A + chrome/browser/extensions/api/storage/sync_storage_backend.h View 5 chunks +19 lines, -28 lines 0 comments Download
A + chrome/browser/extensions/api/storage/sync_storage_backend.cc View 1 14 chunks +77 lines, -75 lines 0 comments Download
M chrome/browser/extensions/api/storage/syncable_settings_storage.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/syncable_settings_storage.cc View 1 2 3 4 5 1 chunk +22 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/weak_unlimited_settings_storage.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/storage/weak_unlimited_settings_storage.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.cc View 1 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/value_store/leveldb_value_store.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/value_store/leveldb_value_store.cc View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
M chrome/browser/value_store/leveldb_value_store_unittest.cc View 1 2 3 4 5 6 2 chunks +163 lines, -0 lines 0 comments Download
M chrome/browser/value_store/testing_value_store.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/value_store/testing_value_store.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/value_store/value_store.h View 1 2 3 4 5 2 chunks +25 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
Devlin
6 years, 10 months ago (2014-02-13 23:51:13 UTC) #1
Devlin
On 2014/02/13 23:51:13, D Cronin wrote: Sorry for the review size. :/ On the upside, ...
6 years, 10 months ago (2014-02-13 23:52:17 UTC) #2
not at google - send to devlin
https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h File chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h (right): https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h#newcode20 chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h:20: const std::string& extension_id) OVERRIDE; nit: blank line after this ...
6 years, 10 months ago (2014-02-14 19:35:56 UTC) #3
Devlin
Sorry for the delay - a few of those took a bit more than I ...
6 years, 10 months ago (2014-02-18 23:55:22 UTC) #4
not at google - send to devlin
(Before I forget: +joao for real)
6 years, 10 months ago (2014-02-18 23:58:13 UTC) #5
Matt Perry
I only looked at the value_store changes. Mostly LGTM, with 1 thing that needs fixing. ...
6 years, 10 months ago (2014-02-19 01:34:22 UTC) #6
Joao da Silva
policy_value_store changes lgtm https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc File chrome/browser/extensions/api/storage/policy_value_store.cc (right): https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode165 chrome/browser/extensions/api/storage/policy_value_store.cc:165: return delegate_->Restore(); On 2014/02/18 23:55:22, D ...
6 years, 10 months ago (2014-02-19 08:32:03 UTC) #7
Devlin
https://codereview.chromium.org/165223003/diff/170001/chrome/browser/value_store/leveldb_value_store_unittest.cc File chrome/browser/value_store/leveldb_value_store_unittest.cc (right): https://codereview.chromium.org/165223003/diff/170001/chrome/browser/value_store/leveldb_value_store_unittest.cc#newcode41 chrome/browser/value_store/leveldb_value_store_unittest.cc:41: CHECK(database_dir_.CreateUniqueTempDir()); On 2014/02/19 01:34:22, Matt Perry wrote: > Don't ...
6 years, 10 months ago (2014-02-19 17:43:18 UTC) #8
not at google - send to devlin
On 2014/02/19 17:43:18, D Cronin wrote: > https://codereview.chromium.org/165223003/diff/170001/chrome/browser/value_store/leveldb_value_store_unittest.cc > File chrome/browser/value_store/leveldb_value_store_unittest.cc (right): > > https://codereview.chromium.org/165223003/diff/170001/chrome/browser/value_store/leveldb_value_store_unittest.cc#newcode41 ...
6 years, 10 months ago (2014-02-19 17:45:14 UTC) #9
Devlin
https://codereview.chromium.org/165223003/diff/170001/chrome/browser/value_store/value_store.h File chrome/browser/value_store/value_store.h (right): https://codereview.chromium.org/165223003/diff/170001/chrome/browser/value_store/value_store.h#newcode80 chrome/browser/value_store/value_store.h:80: bool IsCorruption() const { On 2014/02/19 17:43:19, D Cronin ...
6 years, 10 months ago (2014-02-19 17:48:51 UTC) #10
not at google - send to devlin
https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc File chrome/browser/extensions/api/storage/policy_value_store.cc (right): https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode165 chrome/browser/extensions/api/storage/policy_value_store.cc:165: return delegate_->Restore(); On 2014/02/19 08:32:03, Joao da Silva wrote: ...
6 years, 10 months ago (2014-02-19 17:55:58 UTC) #11
Joao da Silva
https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc File chrome/browser/extensions/api/storage/policy_value_store.cc (right): https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode165 chrome/browser/extensions/api/storage/policy_value_store.cc:165: return delegate_->Restore(); > > This is fine. The PolicyValueStore ...
6 years, 10 months ago (2014-02-19 18:05:43 UTC) #12
not at google - send to devlin
https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc File chrome/browser/extensions/api/storage/policy_value_store.cc (right): https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode165 chrome/browser/extensions/api/storage/policy_value_store.cc:165: return delegate_->Restore(); On 2014/02/19 18:05:43, Joao da Silva wrote: ...
6 years, 10 months ago (2014-02-19 18:13:53 UTC) #13
Devlin
On 2014/02/19 18:05:43, Joao da Silva wrote: > https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/policy_value_store.cc > File chrome/browser/extensions/api/storage/policy_value_store.cc (right): > > ...
6 years, 10 months ago (2014-02-19 18:36:15 UTC) #14
not at google - send to devlin
sorry to keep banging on about the policy stuff. I'll get to the rest of ...
6 years, 10 months ago (2014-02-19 18:40:36 UTC) #15
not at google - send to devlin
https://codereview.chromium.org/165223003/diff/320001/chrome/browser/extensions/api/storage/policy_value_store.cc File chrome/browser/extensions/api/storage/policy_value_store.cc (right): https://codereview.chromium.org/165223003/diff/320001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode171 chrome/browser/extensions/api/storage/policy_value_store.cc:171: bool PolicyValueStore::Restore() { return delegate_->Restore(); } On 2014/02/19 18:40:37, ...
6 years, 10 months ago (2014-02-19 18:48:26 UTC) #16
Devlin
https://codereview.chromium.org/165223003/diff/320001/chrome/browser/extensions/api/storage/policy_value_store.cc File chrome/browser/extensions/api/storage/policy_value_store.cc (right): https://codereview.chromium.org/165223003/diff/320001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode64 chrome/browser/extensions/api/storage/policy_value_store.cc:64: read_result = delegate_->Get(); On 2014/02/19 18:40:37, kalman wrote: > ...
6 years, 10 months ago (2014-02-19 19:13:55 UTC) #17
not at google - send to devlin
On 2014/02/19 19:13:55, D Cronin wrote: > https://codereview.chromium.org/165223003/diff/320001/chrome/browser/extensions/api/storage/policy_value_store.cc > File chrome/browser/extensions/api/storage/policy_value_store.cc (right): > > https://codereview.chromium.org/165223003/diff/320001/chrome/browser/extensions/api/storage/policy_value_store.cc#newcode64 ...
6 years, 10 months ago (2014-02-19 19:21:27 UTC) #18
not at google - send to devlin
lgtm with a bunch more comments but mostly minor. also: you were going to add ...
6 years, 10 months ago (2014-02-19 21:25:28 UTC) #19
Devlin
https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/syncable_settings_storage.cc File chrome/browser/extensions/api/storage/syncable_settings_storage.cc (right): https://codereview.chromium.org/165223003/diff/30001/chrome/browser/extensions/api/storage/syncable_settings_storage.cc#newcode127 chrome/browser/extensions/api/storage/syncable_settings_storage.cc:127: StopSyncing(); On 2014/02/19 21:25:29, kalman wrote: > On 2014/02/18 ...
6 years, 10 months ago (2014-02-19 23:12:27 UTC) #20
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 10 months ago (2014-02-21 15:56:17 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/165223003/750001
6 years, 10 months ago (2014-02-21 15:56:35 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 17:12:18 UTC) #23
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=267846
6 years, 10 months ago (2014-02-21 17:12:19 UTC) #24
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 10 months ago (2014-02-21 17:16:10 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/165223003/750001
6 years, 10 months ago (2014-02-21 17:16:29 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 18:23:28 UTC) #27
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
6 years, 10 months ago (2014-02-21 18:23:29 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 18:23:36 UTC) #29
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
6 years, 10 months ago (2014-02-21 18:23:37 UTC) #30
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 10 months ago (2014-02-21 18:27:16 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/165223003/750001
6 years, 10 months ago (2014-02-21 18:27:25 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/165223003/750001
6 years, 10 months ago (2014-02-21 19:10:57 UTC) #33
commit-bot: I haz the power
Change committed as 252617
6 years, 10 months ago (2014-02-21 19:39:59 UTC) #34
Devlin
6 years, 10 months ago (2014-02-21 21:38:45 UTC) #35
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/175853002/ by rdevlin.cronin@chromium.org.

The reason for reverting is: Broke win unit_tests with
StorageApiUnittest.RestoreStorage.

Powered by Google App Engine
This is Rietveld 408576698