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

Issue 2692203007: Add PrefStore::GetValues (Closed)

Created:
3 years, 10 months ago by tibell
Modified:
3 years, 10 months ago
CC:
chromium-reviews, pam+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add PrefStore::GetValues Currently there's no way to proxy a PrefStore, which we need to in the new prefs service, because there's no way to get its initial state. The existing observer interface can only be used to get changed values and GetValue requires that you know all the keys in advance. GetValues involve a deep copy, but the intended consumer needs to take ownership to send the value over the wire anyway. Design doc: https://docs.google.com/document/d/1Fj013SXClTzk4Yfq2eoL9OkKfN0h-GLXPAokCXFkcTY/edit?usp=sharing BUG=654988 Review-Url: https://codereview.chromium.org/2692203007 Cr-Commit-Position: refs/heads/master@{#451691} Committed: https://chromium.googlesource.com/chromium/src/+/311d4a192239299e42e66b1319b19ee58a5a4b06 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester Review-Url: https://codereview.chromium.org/2692203007 Cr-Commit-Position: refs/heads/master@{#452336} Committed: https://chromium.googlesource.com/chromium/src/+/e23659b47bf9f47507986faba38b70aa10ca8497

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address review comments #

Total comments: 2

Patch Set 3 : Add unit tests for non-trivial implementations #

Patch Set 4 : Document GetValues better #

Patch Set 5 : Fix path expansion in unit tests #

Patch Set 6 : Deal correctly with expanded keys #

Total comments: 6

Patch Set 7 : Correctly ignore underlay values with different keys and add test for this #

Total comments: 2

Patch Set 8 : Change ASSERT to EXPECT in test #

Patch Set 9 : Merge #

Patch Set 10 : Add GetValues to CronetInMemoryPrefStore #

Patch Set 11 : Add GetValues to FilesystemJsonPrefStore #

Unified diffs Side-by-side diffs Delta from patch set Stats (+176 lines, -1 line) Patch
M chrome/browser/supervised_user/supervised_user_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/supervised_user/supervised_user_pref_store.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M components/cronet/android/cronet_in_memory_pref_store.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M components/cronet/android/cronet_in_memory_pref_store.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -1 line 0 comments Download
M components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M components/policy/core/browser/configuration_policy_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/policy/core/browser/configuration_policy_pref_store.cc View 2 chunks +8 lines, -0 lines 0 comments Download
M components/prefs/default_pref_store.h View 2 chunks +2 lines, -0 lines 0 comments Download
M components/prefs/default_pref_store.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/in_memory_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/in_memory_pref_store.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/json_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/json_pref_store.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/overlay_user_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/overlay_user_pref_store.cc View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download
M components/prefs/overlay_user_pref_store_unittest.cc View 1 2 3 4 5 6 7 3 chunks +41 lines, -0 lines 0 comments Download
M components/prefs/pref_store.h View 1 2 3 3 chunks +5 lines, -0 lines 0 comments Download
M components/prefs/pref_value_map.h View 2 chunks +4 lines, -0 lines 0 comments Download
M components/prefs/pref_value_map.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M components/prefs/testing_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/testing_pref_store.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/value_map_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/value_map_pref_store.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/user_prefs/tracked/segregated_pref_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/user_prefs/tracked/segregated_pref_store.cc View 1 1 chunk +14 lines, -0 lines 0 comments Download
M components/user_prefs/tracked/segregated_pref_store_unittest.cc View 1 2 3 4 5 3 chunks +30 lines, -0 lines 0 comments Download

Messages

Total messages: 77 (47 generated)
tibell
This will be used for prefs. I had an alternative implementation using a type-erased iterator, ...
3 years, 10 months ago (2017-02-16 01:55:59 UTC) #6
tibell
On 2017/02/16 01:55:59, tibell wrote: > This will be used for prefs. I had an ...
3 years, 10 months ago (2017-02-16 02:00:28 UTC) #7
Sam McNally
https://codereview.chromium.org/2692203007/diff/1/components/prefs/overlay_user_pref_store.cc File components/prefs/overlay_user_pref_store.cc (right): https://codereview.chromium.org/2692203007/diff/1/components/prefs/overlay_user_pref_store.cc#newcode55 components/prefs/overlay_user_pref_store.cc:55: const std::string overlay_key = GetOverlayKey(underlay_iter.key()); const std::string& https://codereview.chromium.org/2692203007/diff/1/components/prefs/pref_store.h File ...
3 years, 10 months ago (2017-02-16 02:21:11 UTC) #8
tibell
PTAL https://codereview.chromium.org/2692203007/diff/1/components/prefs/overlay_user_pref_store.cc File components/prefs/overlay_user_pref_store.cc (right): https://codereview.chromium.org/2692203007/diff/1/components/prefs/overlay_user_pref_store.cc#newcode55 components/prefs/overlay_user_pref_store.cc:55: const std::string overlay_key = GetOverlayKey(underlay_iter.key()); On 2017/02/16 02:21:11, ...
3 years, 10 months ago (2017-02-20 00:04:58 UTC) #12
Sam McNally
lgtm https://codereview.chromium.org/2692203007/diff/20001/components/prefs/pref_store.h File components/prefs/pref_store.h (right): https://codereview.chromium.org/2692203007/diff/20001/components/prefs/pref_store.h#newcode57 components/prefs/pref_store.h:57: // Get all the values. Document whether this ...
3 years, 10 months ago (2017-02-20 00:31:11 UTC) #13
tibell
emaxx@chromium.org: Please review changes in components/policy/core/browser/configuration_policy_pref_store.h bauerb@chromium.org: Please review remaining changes This change is used ...
3 years, 10 months ago (2017-02-20 02:59:51 UTC) #20
tibell
Document GetValues better
3 years, 10 months ago (2017-02-20 03:04:20 UTC) #21
tibell
https://codereview.chromium.org/2692203007/diff/20001/components/prefs/pref_store.h File components/prefs/pref_store.h (right): https://codereview.chromium.org/2692203007/diff/20001/components/prefs/pref_store.h#newcode57 components/prefs/pref_store.h:57: // Get all the values. On 2017/02/20 00:31:11, Sam ...
3 years, 10 months ago (2017-02-20 03:05:09 UTC) #24
tibell
Fix path expansion in unit tests
3 years, 10 months ago (2017-02-20 04:42:59 UTC) #27
emaxx
LGTM components/policy/core/browser/configuration_policy_pref_store.*
3 years, 10 months ago (2017-02-20 14:03:57 UTC) #32
Bernhard Bauer
LGTM Is there a design doc for this? I'm getting a vague idea from https://codereview.chromium.org/2635153002/, ...
3 years, 10 months ago (2017-02-20 14:14:45 UTC) #33
tibell
On 2017/02/20 14:14:45, Bernhard Bauer wrote: > LGTM > > Is there a design doc ...
3 years, 10 months ago (2017-02-20 23:26:16 UTC) #35
tibell
sammc@chromium.org: I fixed an issue with expanded keys and updated the tests to reflect. Could ...
3 years, 10 months ago (2017-02-21 01:52:13 UTC) #39
Sam McNally
https://codereview.chromium.org/2692203007/diff/100001/components/prefs/overlay_user_pref_store.cc File components/prefs/overlay_user_pref_store.cc (right): https://codereview.chromium.org/2692203007/diff/100001/components/prefs/overlay_user_pref_store.cc#newcode55 components/prefs/overlay_user_pref_store.cc:55: const std::string& underlay_key = overlay_mapping.first; second https://codereview.chromium.org/2692203007/diff/100001/components/prefs/overlay_user_pref_store.cc#newcode60 components/prefs/overlay_user_pref_store.cc:60: if ...
3 years, 10 months ago (2017-02-21 01:58:26 UTC) #40
tibell
Correctly ignore underlay values with different keys and add test for this
3 years, 10 months ago (2017-02-21 02:10:22 UTC) #41
tibell
PTAL https://codereview.chromium.org/2692203007/diff/100001/components/prefs/overlay_user_pref_store.cc File components/prefs/overlay_user_pref_store.cc (right): https://codereview.chromium.org/2692203007/diff/100001/components/prefs/overlay_user_pref_store.cc#newcode55 components/prefs/overlay_user_pref_store.cc:55: const std::string& underlay_key = overlay_mapping.first; On 2017/02/21 01:58:25, ...
3 years, 10 months ago (2017-02-21 02:11:07 UTC) #44
Sam McNally
lgtm https://codereview.chromium.org/2692203007/diff/120001/components/prefs/overlay_user_pref_store_unittest.cc File components/prefs/overlay_user_pref_store_unittest.cc (right): https://codereview.chromium.org/2692203007/diff/120001/components/prefs/overlay_user_pref_store_unittest.cc#newcode350 components/prefs/overlay_user_pref_store_unittest.cc:350: ASSERT_FALSE(values->Get(mapped_underlay_key, &value)); This one can be EXPECT_FALSE.
3 years, 10 months ago (2017-02-21 02:12:13 UTC) #45
tibell
https://codereview.chromium.org/2692203007/diff/120001/components/prefs/overlay_user_pref_store_unittest.cc File components/prefs/overlay_user_pref_store_unittest.cc (right): https://codereview.chromium.org/2692203007/diff/120001/components/prefs/overlay_user_pref_store_unittest.cc#newcode350 components/prefs/overlay_user_pref_store_unittest.cc:350: ASSERT_FALSE(values->Get(mapped_underlay_key, &value)); On 2017/02/21 02:12:13, Sam McNally wrote: > ...
3 years, 10 months ago (2017-02-21 02:18:22 UTC) #48
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/2692203007/140001
3 years, 10 months ago (2017-02-21 02:19:29 UTC) #51
commit-bot: I haz the power
Committed patchset #8 (id:140001) as https://chromium.googlesource.com/chromium/src/+/311d4a192239299e42e66b1319b19ee58a5a4b06
3 years, 10 months ago (2017-02-21 03:23:06 UTC) #54
aelias_OOO_until_Jul13
A revert of this CL (patchset #8 id:140001) has been created in https://codereview.chromium.org/2704133006/ by aelias@chromium.org. ...
3 years, 10 months ago (2017-02-21 23:48:40 UTC) #55
tibell
Merge
3 years, 10 months ago (2017-02-22 05:39:08 UTC) #57
tibell
Add GetValues to FilesystemJsonPrefStore
3 years, 10 months ago (2017-02-22 05:55:28 UTC) #61
tibell
I've added implementations of GetValues for the two pref stores that weren't on the CQ ...
3 years, 10 months ago (2017-02-22 05:56:41 UTC) #63
Sam McNally
lgtm
3 years, 10 months ago (2017-02-22 06:13:54 UTC) #65
tibell
mgersh@chromium.org: please review changes in components/cronet/android erg@chromium.org: please review changes in components/filesystem
3 years, 10 months ago (2017-02-22 06:16:10 UTC) #67
mgersh
components/cronet/ lgtm
3 years, 10 months ago (2017-02-22 15:34:12 UTC) #70
Elliot Glaysher
lgtm
3 years, 10 months ago (2017-02-22 18:29:32 UTC) #71
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/2692203007/190001
3 years, 10 months ago (2017-02-22 23:35:59 UTC) #74
commit-bot: I haz the power
3 years, 10 months ago (2017-02-23 01:45:08 UTC) #77
Message was sent while issue was closed.
Committed patchset #11 (id:190001) as
https://chromium.googlesource.com/chromium/src/+/e23659b47bf9f47507986faba38b...

Powered by Google App Engine
This is Rietveld 408576698