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

Issue 324493002: Move preference MACs to the protected preference stores. (Closed)

Created:
6 years, 6 months ago by erikwright (departed)
Modified:
6 years, 6 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, Cait (Slow)
Visibility:
Public.

Description

Move preference MACs to the protected preference stores. (1) 1-time migration of MACs from local state to Preferences/Protected Preferences. (2) Migrate MACs between Preferences/Protected Preferences according to configuration changes. Proposed follow-up tasks are: (1) Introduce TrackedPreferencesMigrationDelegate (2) Introduce protections to prevent unintended stamping of the super MAC. (3) Expanded test coverage of PrefHashFilter (4) Expanded test coverage for legacy migration in TrackedPreferencesMigrationTest BUG=372547, 368480 R=asvitkine@chromium.org, gab@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278164

Patch Set 1 #

Patch Set 2 : Pull some stuff from Persistent to WriteablePrefStore. #

Total comments: 47

Patch Set 3 : Make unit tests pass. #

Patch Set 4 : Rebase. #

Patch Set 5 : Respond to CR comments. #

Total comments: 7

Patch Set 6 : Extract some pre-CLs. #

Patch Set 7 : New approach. #

Total comments: 1

Patch Set 8 : Correct errant keystroke. #

Patch Set 9 : Remove some now unnecessary changes. #

Total comments: 52

Patch Set 10 : Existing tests pass. #

Patch Set 11 : Review comments. #

Patch Set 12 : Self-review. #

Total comments: 34

Patch Set 13 : Rebase. #

Patch Set 14 : Rebase. #

Patch Set 15 : Fix test compile failure. #

Patch Set 16 : Add some test coverage. #

Patch Set 17 : Gab comments. #

Patch Set 18 : Add tracking for MAC migrations from local state. #

Total comments: 22

Patch Set 19 : Add a test for newly tracked prefs when first enabling protection. #

Total comments: 2

Patch Set 20 : Final review comments? #

Patch Set 21 : Final final...? #

Total comments: 1

Patch Set 22 : Rebase. #

Total comments: 1

Patch Set 23 : Histograms nit. #

Patch Set 24 : Comment typo. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1087 lines, -442 lines) Patch
M base/prefs/json_pref_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M base/prefs/persistent_pref_store.h View 1 6 7 8 9 10 11 12 1 chunk +0 lines, -10 lines 0 comments Download
M base/prefs/pref_filter.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
M base/prefs/value_map_pref_store.h View 1 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M base/prefs/value_map_pref_store.cc View 1 6 7 8 9 10 11 12 1 chunk +9 lines, -0 lines 0 comments Download
M base/prefs/writeable_pref_store.h View 1 6 7 8 9 10 11 12 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_hash_filter.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +14 lines, -6 lines 0 comments Download
M chrome/browser/prefs/pref_hash_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +22 lines, -23 lines 0 comments Download
M chrome/browser/prefs/pref_hash_filter_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 23 21 chunks +45 lines, -31 lines 0 comments Download
M chrome/browser/prefs/pref_hash_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +9 lines, -8 lines 0 comments Download
M chrome/browser/prefs/pref_hash_store_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -14 lines 0 comments Download
M chrome/browser/prefs/pref_hash_store_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +117 lines, -74 lines 0 comments Download
M chrome/browser/prefs/pref_hash_store_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 12 chunks +177 lines, -147 lines 0 comments Download
M chrome/browser/prefs/pref_hash_store_transaction.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +26 lines, -0 lines 0 comments Download
M chrome/browser/prefs/profile_pref_store_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/prefs/profile_pref_store_manager.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +36 lines, -50 lines 0 comments Download
M chrome/browser/prefs/profile_pref_store_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +118 lines, -0 lines 0 comments Download
A chrome/browser/prefs/tracked/dictionary_hash_store_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/prefs/tracked/dictionary_hash_store_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +99 lines, -0 lines 0 comments Download
M chrome/browser/prefs/tracked/hash_store_contents.h View 1 2 3 4 5 6 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/prefs/tracked/pref_service_hash_store_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc View 1 2 3 4 5 6 7 8 9 10 10 chunks +16 lines, -15 lines 0 comments Download
M chrome/browser/prefs/tracked/pref_service_hash_store_contents_unittest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/prefs/tracked/tracked_preferences_migration.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +13 lines, -2 lines 0 comments Download
M chrome/browser/prefs/tracked/tracked_preferences_migration.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 9 chunks +125 lines, -27 lines 0 comments Download
M chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 15 chunks +152 lines, -12 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/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -5 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
erikwright (departed)
PTAL. The one remaining change I want to make is to move GetMutableValue from PersistentPrefStore ...
6 years, 6 months ago (2014-06-06 16:22:17 UTC) #1
gab
First responding to the points in the CL description inline: (1) Make JsonPrefStore store its ...
6 years, 6 months ago (2014-06-06 21:55:00 UTC) #2
erikwright (departed)
https://codereview.chromium.org/324493002/diff/40001/chrome/browser/prefs/pref_hash_store_impl.cc File chrome/browser/prefs/pref_hash_store_impl.cc (right): https://codereview.chromium.org/324493002/diff/40001/chrome/browser/prefs/pref_hash_store_impl.cc#newcode173 chrome/browser/prefs/pref_hash_store_impl.cc:173: const base::Value* hash) { On 2014/06/06 21:54:59, gab wrote: ...
6 years, 6 months ago (2014-06-09 18:34:51 UTC) #3
gab
https://codereview.chromium.org/324493002/diff/40001/chrome/browser/prefs/pref_hash_store_impl.cc File chrome/browser/prefs/pref_hash_store_impl.cc (right): https://codereview.chromium.org/324493002/diff/40001/chrome/browser/prefs/pref_hash_store_impl.cc#newcode173 chrome/browser/prefs/pref_hash_store_impl.cc:173: const base::Value* hash) { On 2014/06/09 18:34:50, erikwright wrote: ...
6 years, 6 months ago (2014-06-09 20:24:33 UTC) #4
erikwright (departed)
On 2014/06/09 20:24:33, gab wrote: > https://codereview.chromium.org/324493002/diff/40001/chrome/browser/prefs/pref_hash_store_impl.cc > File chrome/browser/prefs/pref_hash_store_impl.cc (right): > > https://codereview.chromium.org/324493002/diff/40001/chrome/browser/prefs/pref_hash_store_impl.cc#newcode173 > ...
6 years, 6 months ago (2014-06-10 14:25:12 UTC) #5
erikwright (departed)
Some follow-up comments. I'll upload some more patchsets shortly. https://codereview.chromium.org/324493002/diff/40001/base/prefs/json_pref_store.cc File base/prefs/json_pref_store.cc (right): https://codereview.chromium.org/324493002/diff/40001/base/prefs/json_pref_store.cc#newcode345 base/prefs/json_pref_store.cc:345: ...
6 years, 6 months ago (2014-06-10 14:25:36 UTC) #6
gab
https://codereview.chromium.org/324493002/diff/40001/base/prefs/json_pref_store.cc File base/prefs/json_pref_store.cc (right): https://codereview.chromium.org/324493002/diff/40001/base/prefs/json_pref_store.cc#newcode345 base/prefs/json_pref_store.cc:345: &JsonPrefStore::FinalizeFileRead, this, initialization_successful)); On 2014/06/10 14:25:36, erikwright wrote: > ...
6 years, 6 months ago (2014-06-10 16:54:34 UTC) #7
erikwright (departed)
Responded to some of your comments. I plan to start splitting this into smaller CLs ...
6 years, 6 months ago (2014-06-10 20:27:48 UTC) #8
gab
Response to your comments and latest patch set below; I'll be waiting for your split ...
6 years, 6 months ago (2014-06-11 18:23:56 UTC) #9
erikwright (departed)
Extracted a lot of the setup for this CL into separate CLs. https://codereview.chromium.org/332473002/ https://codereview.chromium.org/329093003/ https://codereview.chromium.org/334433002/ ...
6 years, 6 months ago (2014-06-11 18:52:10 UTC) #10
gab
Also, in this CL you should comment out the pref_hash_store_->CommitPendingWrite() call @ https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/prefs/pref_hash_filter.cc&l=160 with a ...
6 years, 6 months ago (2014-06-11 21:23:25 UTC) #11
erikwright (departed)
I believe this CL addresses all of the structural issues previously raised by Gab. I ...
6 years, 6 months ago (2014-06-12 20:49:41 UTC) #12
gab
WooooooooooooooooooOOOOooooooooooooooooooooohoooooooooooooooo :-)!!! Me right now: http://www.infinitelooper.com/?v=SkNRC0Wj3eM&p=n I'm so very much happier with this model! Thanks ...
6 years, 6 months ago (2014-06-13 01:57:44 UTC) #13
erikwright (departed)
I've fixed existing tests. I will now begin responding to Gab's comments (none of which ...
6 years, 6 months ago (2014-06-13 20:14:25 UTC) #14
gab
test updates lg, waiting for more updates :-)! Thanks! Gab
6 years, 6 months ago (2014-06-13 20:51:11 UTC) #15
erikwright (departed)
PTAL. I have responded to all CR comments and also done my own self-review (including ...
6 years, 6 months ago (2014-06-16 20:51:27 UTC) #16
gab
lvvvvvvvvvvg! This CL is awesome now. I love the structure of our framework which allows ...
6 years, 6 months ago (2014-06-17 02:00:06 UTC) #17
robertshield
FYI, I checked some boxes for a bunch of Xsan bots just in case. On ...
6 years, 6 months ago (2014-06-17 02:08:42 UTC) #18
robertshield
https://codereview.chromium.org/324493002/diff/250001/base/prefs/pref_filter.h File base/prefs/pref_filter.h (left): https://codereview.chromium.org/324493002/diff/250001/base/prefs/pref_filter.h#oldcode50 base/prefs/pref_filter.h:50: const base::DictionaryValue* pref_store_contents) = 0; this requires a corresponding ...
6 years, 6 months ago (2014-06-17 03:47:24 UTC) #19
erikwright (departed)
gab: PTAL for test coverage. I could probably add more, but this is a start. ...
6 years, 6 months ago (2014-06-17 17:54:05 UTC) #20
gab
https://codereview.chromium.org/324493002/diff/190001/chrome/browser/prefs/tracked/tracked_preferences_migration.cc File chrome/browser/prefs/tracked/tracked_preferences_migration.cc (right): https://codereview.chromium.org/324493002/diff/190001/chrome/browser/prefs/tracked/tracked_preferences_migration.cc#newcode286 chrome/browser/prefs/tracked/tracked_preferences_migration.cc:286: legacy_pref_hash_store_->Reset(); On 2014/06/17 17:54:05, erikwright wrote: > On 2014/06/17 ...
6 years, 6 months ago (2014-06-17 18:24:30 UTC) #21
erikwright (departed)
Still need to add an UMA metric. https://codereview.chromium.org/324493002/diff/250001/chrome/browser/prefs/pref_hash_store.h File chrome/browser/prefs/pref_hash_store.h (right): https://codereview.chromium.org/324493002/diff/250001/chrome/browser/prefs/pref_hash_store.h#newcode15 chrome/browser/prefs/pref_hash_store.h:15: class PrefHashStore ...
6 years, 6 months ago (2014-06-17 19:07:24 UTC) #22
erikwright (departed)
Added an additional regression test for the case where a newly-tracked-and-protected value is added at ...
6 years, 6 months ago (2014-06-17 20:34:31 UTC) #23
gab
Almost there; happy to do a review tonight (and CQ if it lg) if you ...
6 years, 6 months ago (2014-06-17 22:08:22 UTC) #24
erikwright (departed)
gab: PTAL. https://codereview.chromium.org/324493002/diff/360001/chrome/browser/prefs/pref_hash_filter_unittest.cc File chrome/browser/prefs/pref_hash_filter_unittest.cc (right): https://codereview.chromium.org/324493002/diff/360001/chrome/browser/prefs/pref_hash_filter_unittest.cc#newcode325 chrome/browser/prefs/pref_hash_filter_unittest.cc:325: NOTIMPLEMENTED(); On 2014/06/17 22:08:21, gab wrote: > ...
6 years, 6 months ago (2014-06-18 15:10:46 UTC) #25
erikwright (departed)
asvitkine: PTAL for histograms.xml
6 years, 6 months ago (2014-06-18 15:11:17 UTC) #26
Alexei Svitkine (slow)
histograms lgtm % nit https://codereview.chromium.org/324493002/diff/440001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/324493002/diff/440001/tools/metrics/histograms/histograms.xml#newcode25298 tools/metrics/histograms/histograms.xml:25298: +<histogram name="Settings.MigratedHashesFromLocalState" enum="Boolean"> Nit: enum="BooleanMigrated"
6 years, 6 months ago (2014-06-18 15:23:01 UTC) #27
gab
LGTM++ w/ typo fix below =D!!! Can you explicitly state in this CL's description the ...
6 years, 6 months ago (2014-06-18 16:22:05 UTC) #28
erikwright (departed)
The CQ bit was checked by erikwright@chromium.org
6 years, 6 months ago (2014-06-18 16:52:59 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikwright@chromium.org/324493002/480001
6 years, 6 months ago (2014-06-18 16:54:09 UTC) #30
erikwright (departed)
6 years, 6 months ago (2014-06-18 20:45:27 UTC) #31
Message was sent while issue was closed.
Committed patchset #24 manually as r278164 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698