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

Issue 2635153002: Pref service: expose all read-only PrefStores through Mojo (Closed)

Created:
3 years, 11 months ago by tibell
Modified:
3 years, 9 months ago
CC:
Aaron Boodman, abarth-chromium, blundell+watchlist_chromium.org, chromium-reviews, darin (slow to review), droger+watchlist_chromium.org, jonross, qsr+mojo_chromium.org, sdefresne+watchlist_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Pref service: expose all read-only PrefStores through Mojo This will eventually replace the existing preferences service implementation. High-level overview: PrefStoreImpl: Wraps a PrefStore to expose its Observer interface as a Mojo interface. PrefStoreClient: Implements the PrefStore interface and acts as a cache, providing synchronous access to prefs stored in a PrefStoreImpl. PrefStoreManagerImpl: Facilitates connections between PrefStoreClients and PrefStoreImpls. PrefStoreAdapter: Helper to tie the lifetime of the PrefStoreImpl to the underlying PrefStore (which is indirectly held by the PrefService). BUG=654988 Review-Url: https://codereview.chromium.org/2635153002 Cr-Commit-Position: refs/heads/master@{#455919} Committed: https://chromium.googlesource.com/chromium/src/+/11141bd8441dc816fa284bca287005251170aff8

Patch Set 1 #

Patch Set 2 : Rename mojo interface and impls #

Patch Set 3 : Chrome can now start #

Patch Set 4 : Fix compile and improve docs #

Patch Set 5 : Improve tests #

Patch Set 6 : Fix nullptr crash #

Patch Set 7 : Deal with deletions #

Patch Set 8 : Split out the PrefStore::GetValues change #

Patch Set 9 : Create and register service #

Total comments: 39

Patch Set 10 : Don't use a native enum in mojom #

Patch Set 11 : Simplify mojom interface #

Patch Set 12 : Make OnPrefChanged value nullable #

Patch Set 13 : Make registration optional to support unit tests #

Patch Set 14 : Address review comments #

Total comments: 3

Patch Set 15 : Use array instead of map, since keys weren't hashable in WTF #

Patch Set 16 : Switch back to unordered_map #

Patch Set 17 : Remove debug print #

Total comments: 4

Patch Set 18 : Move on top of crrev.com/2715153004 #

Patch Set 19 : Address review comments #

Patch Set 20 : Merge #

Total comments: 33

Patch Set 21 : Address review comments #

Total comments: 8

Patch Set 22 : Merge #

Patch Set 23 : Split out non-services/ changes into separate CL #

Patch Set 24 : Address review comments #

Patch Set 25 : Call ConnectionBarrier::Create correctly #

Patch Set 26 : Add test for PrefStoreClient starting out initialized #

Total comments: 2

Patch Set 27 : Address sammc's review comments #

Patch Set 28 : Merge #

Patch Set 29 : Merge #

Total comments: 6

Patch Set 30 : Address bauerb's review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+996 lines, -25 lines) Patch
M components/prefs/pref_value_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +36 lines, -24 lines 0 comments Download
M services/preferences/public/cpp/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_adapter.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 26 27 28 29 1 chunk +44 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +40 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +66 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +77 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +60 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +71 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +85 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/pref_store_manager_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 1 chunk +142 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/preferences.typemap View 1 2 3 4 5 6 7 8 9 1 chunk +15 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/preferences_struct_traits.h View 1 2 3 4 5 6 7 8 9 1 chunk +26 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/preferences_struct_traits.cc View 1 2 3 4 5 6 7 8 9 1 chunk +64 lines, -0 lines 0 comments Download
M services/preferences/public/cpp/tests/BUILD.gn View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/tests/pref_store_client_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 24 25 26 1 chunk +192 lines, -0 lines 0 comments Download
M services/preferences/public/cpp/typemaps.gni 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 26 27 28 1 chunk +4 lines, -1 line 0 comments Download
M services/preferences/public/interfaces/preferences.mojom View 1 2 3 4 5 6 7 8 9 10 11 15 1 chunk +64 lines, -0 lines 0 comments Download

Messages

Total messages: 164 (119 generated)
tibell
Rename mojo interface and impls
3 years, 11 months ago (2017-01-19 02:32:29 UTC) #5
tibell
Chrome can now start
3 years, 10 months ago (2017-02-14 02:21:13 UTC) #14
tibell
Fix compile and improve docs
3 years, 10 months ago (2017-02-14 03:00:53 UTC) #19
tibell
This is a first working version, to serve as a starting point for discussion.
3 years, 10 months ago (2017-02-14 04:23:44 UTC) #27
tibell
Fix nullptr crash
3 years, 10 months ago (2017-02-15 00:06:34 UTC) #30
tibell
Deal with deletions
3 years, 10 months ago (2017-02-15 03:53:08 UTC) #35
tibell
Split out the PrefStore::GetValues change
3 years, 10 months ago (2017-02-15 23:36:27 UTC) #40
tibell
Create and register service
3 years, 10 months ago (2017-02-24 00:29:48 UTC) #42
tibell
Don't use a native enum in mojom
3 years, 10 months ago (2017-02-24 03:56:57 UTC) #47
Sam McNally
https://codereview.chromium.org/2635153002/diff/160001/components/prefs/pref_value_store.h File components/prefs/pref_value_store.h (right): https://codereview.chromium.org/2635153002/diff/160001/components/prefs/pref_value_store.h#newcode130 components/prefs/pref_value_store.h:130: enum PrefStoreType { Types before constructors. https://codereview.chromium.org/2635153002/diff/160001/components/prefs/pref_value_store.h#newcode265 components/prefs/pref_value_store.h:265: return ...
3 years, 10 months ago (2017-02-24 04:14:54 UTC) #52
tibell
Simplify mojom interface
3 years, 10 months ago (2017-02-24 04:22:24 UTC) #53
tibell
Address review comments
3 years, 9 months ago (2017-02-27 00:02:09 UTC) #66
tibell
PTAL https://codereview.chromium.org/2635153002/diff/160001/components/prefs/pref_value_store.h File components/prefs/pref_value_store.h (right): https://codereview.chromium.org/2635153002/diff/160001/components/prefs/pref_value_store.h#newcode130 components/prefs/pref_value_store.h:130: enum PrefStoreType { On 2017/02/24 04:14:53, Sam McNally ...
3 years, 9 months ago (2017-02-27 00:02:54 UTC) #69
tibell
Use array instead of map, since keys weren't hashable in WTF
3 years, 9 months ago (2017-02-27 03:01:12 UTC) #72
Sam McNally
https://codereview.chromium.org/2635153002/diff/160001/services/preferences/public/cpp/pref_store_impl.cc File services/preferences/public/cpp/pref_store_impl.cc (right): https://codereview.chromium.org/2635153002/diff/160001/services/preferences/public/cpp/pref_store_impl.cc#newcode55 services/preferences/public/cpp/pref_store_impl.cc:55: if (initialized_) { On 2017/02/27 00:02:54, tibell wrote: > ...
3 years, 9 months ago (2017-02-27 03:22:20 UTC) #75
tibell
Switch back to unordered_map
3 years, 9 months ago (2017-02-27 06:14:23 UTC) #78
tibell
Remove debug print
3 years, 9 months ago (2017-02-27 06:19:33 UTC) #81
Sam McNally
https://codereview.chromium.org/2635153002/diff/320001/components/sync_preferences/DEPS File components/sync_preferences/DEPS (right): https://codereview.chromium.org/2635153002/diff/320001/components/sync_preferences/DEPS#newcode7 components/sync_preferences/DEPS:7: "+services/preferences", /public https://codereview.chromium.org/2635153002/diff/320001/components/sync_preferences/DEPS#newcode8 components/sync_preferences/DEPS:8: "+services/service_manager", /public
3 years, 9 months ago (2017-02-28 02:59:55 UTC) #86
tibell
Move on top of crbug.com/2715153004
3 years, 9 months ago (2017-02-28 04:18:26 UTC) #87
tibell
https://codereview.chromium.org/2635153002/diff/320001/components/sync_preferences/DEPS File components/sync_preferences/DEPS (right): https://codereview.chromium.org/2635153002/diff/320001/components/sync_preferences/DEPS#newcode7 components/sync_preferences/DEPS:7: "+services/preferences", On 2017/02/28 02:59:55, Sam McNally wrote: > /public ...
3 years, 9 months ago (2017-02-28 04:22:09 UTC) #91
tibell
Merge
3 years, 9 months ago (2017-03-03 00:19:50 UTC) #98
Sam McNally
https://codereview.chromium.org/2635153002/diff/380001/mojo/public/tools/bindings/chromium_bindings_configuration.gni File mojo/public/tools/bindings/chromium_bindings_configuration.gni (right): https://codereview.chromium.org/2635153002/diff/380001/mojo/public/tools/bindings/chromium_bindings_configuration.gni#newcode31 mojo/public/tools/bindings/chromium_bindings_configuration.gni:31: "//services/preferences/public/cpp/typemaps.gni", This should be before services/resource_coordinator/public/cpp/typemaps.gni. https://codereview.chromium.org/2635153002/diff/380001/services/preferences/public/cpp/pref_store_adapter.cc File services/preferences/public/cpp/pref_store_adapter.cc ...
3 years, 9 months ago (2017-03-03 03:47:58 UTC) #103
tibell
Address review comments
3 years, 9 months ago (2017-03-07 00:49:10 UTC) #104
tibell
PTAL. After you've had another look I will split out the non-services/preferences/ changes in a ...
3 years, 9 months ago (2017-03-07 00:52:52 UTC) #107
tibell
Merge
3 years, 9 months ago (2017-03-07 01:38:14 UTC) #110
Sam McNally
https://codereview.chromium.org/2635153002/diff/380001/services/preferences/public/cpp/tests/pref_store_client_unittest.cc File services/preferences/public/cpp/tests/pref_store_client_unittest.cc (right): https://codereview.chromium.org/2635153002/diff/380001/services/preferences/public/cpp/tests/pref_store_client_unittest.cc#newcode73 services/preferences/public/cpp/tests/pref_store_client_unittest.cc:73: connection_ptr->initial_prefs = base::MakeUnique<base::DictionaryValue>(); On 2017/03/07 00:52:52, tibell wrote: > ...
3 years, 9 months ago (2017-03-07 01:47:13 UTC) #113
tibell
Split out non-services/ changes into separate CL
3 years, 9 months ago (2017-03-07 01:50:31 UTC) #114
tibell
This is the ground work for the new preference service at uses the existing PrefService ...
3 years, 9 months ago (2017-03-07 01:55:57 UTC) #118
tibell
On 2017/03/07 01:55:57, tibell wrote: > This is the ground work for the new preference ...
3 years, 9 months ago (2017-03-07 01:57:28 UTC) #120
tibell
Address review comments
3 years, 9 months ago (2017-03-07 02:29:58 UTC) #121
tibell
PTAL rockot@chromium.org: Please review mojo/public/tools/bindings/chromium_bindings_configuration.gni https://codereview.chromium.org/2635153002/diff/400001/chrome/browser/prefs/preferences2_manifest.json File chrome/browser/prefs/preferences2_manifest.json (right): https://codereview.chromium.org/2635153002/diff/400001/chrome/browser/prefs/preferences2_manifest.json#newcode11 chrome/browser/prefs/preferences2_manifest.json:11: "requires": { On 2017/03/07 ...
3 years, 9 months ago (2017-03-07 02:44:15 UTC) #125
tibell
Call ConnectionBarrier::Create correctly
3 years, 9 months ago (2017-03-07 02:49:41 UTC) #128
tibell
Add test for PrefStoreClient starting out initialized
3 years, 9 months ago (2017-03-07 03:00:15 UTC) #131
Sam McNally
lgtm https://codereview.chromium.org/2635153002/diff/500001/services/preferences/public/cpp/tests/pref_store_client_unittest.cc File services/preferences/public/cpp/tests/pref_store_client_unittest.cc (right): https://codereview.chromium.org/2635153002/diff/500001/services/preferences/public/cpp/tests/pref_store_client_unittest.cc#newcode183 services/preferences/public/cpp/tests/pref_store_client_unittest.cc:183: EXPECT_TRUE(value->GetAsInteger(&actual_value)); Either ASSERT_TRUE here or initialize |actual_value|.
3 years, 9 months ago (2017-03-07 03:38:08 UTC) #134
Ken Rockot(use gerrit already)
lgtm
3 years, 9 months ago (2017-03-07 03:52:07 UTC) #135
tibell
https://codereview.chromium.org/2635153002/diff/500001/services/preferences/public/cpp/tests/pref_store_client_unittest.cc File services/preferences/public/cpp/tests/pref_store_client_unittest.cc (right): https://codereview.chromium.org/2635153002/diff/500001/services/preferences/public/cpp/tests/pref_store_client_unittest.cc#newcode183 services/preferences/public/cpp/tests/pref_store_client_unittest.cc:183: EXPECT_TRUE(value->GetAsInteger(&actual_value)); On 2017/03/07 03:38:08, Sam McNally wrote: > Either ...
3 years, 9 months ago (2017-03-07 04:20:28 UTC) #136
Martin Barbella
security lgtm
3 years, 9 months ago (2017-03-07 21:30:45 UTC) #141
tibell
bauerb@chromium.org: Just a quick heads-up that the CL you already approved (https://crrev.com/2740493002/) depends on this ...
3 years, 9 months ago (2017-03-08 00:08:03 UTC) #144
tibell
Merge
3 years, 9 months ago (2017-03-08 00:23:29 UTC) #145
tibell
Merge
3 years, 9 months ago (2017-03-08 03:45:17 UTC) #150
Bernhard Bauer
lgtm https://codereview.chromium.org/2635153002/diff/560001/components/prefs/pref_value_store.h File components/prefs/pref_value_store.h (right): https://codereview.chromium.org/2635153002/diff/560001/components/prefs/pref_value_store.h#newcode43 components/prefs/pref_value_store.h:43: enum PrefStoreType { Historically we haven't exposed the ...
3 years, 9 months ago (2017-03-09 09:25:22 UTC) #156
tibell
Address bauerb's review comments
3 years, 9 months ago (2017-03-09 23:07:04 UTC) #157
tibell
https://codereview.chromium.org/2635153002/diff/560001/components/prefs/pref_value_store.h File components/prefs/pref_value_store.h (right): https://codereview.chromium.org/2635153002/diff/560001/components/prefs/pref_value_store.h#newcode43 components/prefs/pref_value_store.h:43: enum PrefStoreType { On 2017/03/09 09:25:22, Bernhard Bauer wrote: ...
3 years, 9 months ago (2017-03-09 23:07:12 UTC) #158
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/2635153002/580001
3 years, 9 months ago (2017-03-09 23:10:00 UTC) #161
commit-bot: I haz the power
3 years, 9 months ago (2017-03-10 00:17:16 UTC) #164
Message was sent while issue was closed.
Committed patchset #30 (id:580001) as
https://chromium.googlesource.com/chromium/src/+/11141bd8441dc816fa284bca2870...

Powered by Google App Engine
This is Rietveld 408576698