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

Issue 2601873002: Add a mojo bridge for PersistentPrefStore. (Closed)

Created:
3 years, 12 months ago by Sam McNally
Modified:
3 years, 9 months ago
Reviewers:
tibell
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), chrome-apps-syd-reviews_chromium.org, jonross
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a mojo bridge for PersistentPrefStore. This adds a mojo interface for PresistentPrefStore and adapters between the C++ interface and the mojo interface. These two adapters will eventually move into the preferences service and preferences service client library, respectively, but in the interim, they are both created by chrome-specific prefs code behind a flag. BUG=654988

Patch Set 1 : Enabled for testing #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : rebase onto https://codereview.chromium.org/2719833002/ #

Patch Set 4 : on for testing #

Patch Set 5 : on for testing #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : rebase #

Patch Set 9 : #

Patch Set 10 : rebase #

Patch Set 11 : on for testing #

Patch Set 12 : #

Patch Set 13 : on for testing #

Patch Set 14 : rebase #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+927 lines, -30 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +38 lines, -4 lines 0 comments Download
M chrome/browser/prefs/DEPS View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/prefs/chrome_pref_service_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 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 2 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/prefs/profile_pref_store_manager.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/prefs/profile_pref_store_manager.cc View 1 2 3 4 5 6 7 8 9 4 chunks +43 lines, -7 lines 1 comment Download
M chrome/browser/prefs/profile_pref_store_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 7 chunks +42 lines, -9 lines 0 comments Download
M chrome/browser/profiles/profile_browsertest.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M components/user_prefs/tracked/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/browser_main_runner.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/sync_call_restrictions.h View 2 chunks +6 lines, -0 lines 0 comments Download
M services/preferences/public/cpp/BUILD.gn View 1 chunk +6 lines, -1 line 0 comments Download
A services/preferences/public/cpp/persistent_pref_store_mojo.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +88 lines, -0 lines 1 comment Download
A services/preferences/public/cpp/persistent_pref_store_mojo.cc View 1 2 3 4 5 6 1 chunk +152 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/preferences.typemap View 1 2 3 4 5 6 7 1 chunk +17 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/preferences_struct_traits.h View 1 2 3 4 5 6 7 1 chunk +27 lines, -0 lines 0 comments Download
A services/preferences/public/cpp/preferences_struct_traits.cc View 1 2 3 4 5 6 7 1 chunk +81 lines, -0 lines 0 comments Download
M services/preferences/public/cpp/typemaps.gni View 1 2 1 chunk +4 lines, -1 line 0 comments Download
A services/preferences/public/cpp/user_prefs_impl.h View 1 2 3 4 5 6 1 chunk +55 lines, -0 lines 1 comment Download
A services/preferences/public/cpp/user_prefs_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +314 lines, -0 lines 5 comments Download
M services/preferences/public/interfaces/preferences.mojom View 1 2 3 4 1 chunk +31 lines, -0 lines 3 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 180 (178 generated)
Sam McNally
3 years, 10 months ago (2017-02-24 02:19:21 UTC) #139
tibell
3 years, 9 months ago (2017-03-08 03:39:54 UTC) #180
https://codereview.chromium.org/2601873002/diff/550001/services/preferences/p...
File services/preferences/public/cpp/user_prefs_impl.cc (right):

https://codereview.chromium.org/2601873002/diff/550001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.cc:24: class
ForwardingTrackedPreferenceValidationDelegate
A short comment why this class exists.

https://codereview.chromium.org/2601873002/diff/780001/chrome/browser/prefs/p...
File chrome/browser/prefs/profile_pref_store_manager.cc (right):

https://codereview.chromium.org/2601873002/diff/780001/chrome/browser/prefs/p...
chrome/browser/prefs/profile_pref_store_manager.cc:112:
DCHECK(validation_delegate);
Split this whole block out into a CreateProfilePrefStoreUsingService and call
that.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
File services/preferences/public/cpp/persistent_pref_store_mojo.h (right):

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/persistent_pref_store_mojo.h:28: class
PersistentPrefStoreMojo : public PersistentPrefStore {
Can we name this PersistentPrefStoreClient to match PrefStoreClient in the
read-only part of the prefs service? The pattern being that Impl is the "server"
side of the stores and "client" the client side.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
File services/preferences/public/cpp/user_prefs_impl.cc (right):

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.cc:26: class
ValidationDelegatePtrHolder
Document what each class does. I'm guess this is:

// Allows a mojom::TrackedPreferenceValidationDelegatePtr to be refcounted.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.cc:93: PersistentPrefStore*
pref_store,
Should be a scoped_refptr I think.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.cc:117: return
std::unique_ptr<PrefHashStore>(
Would MakeUnique work since the function has a return type of the right pointer
type?

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.cc:188:
scoped_refptr<ValidationDelegatePtrHolder> validation_delegate_holder(
There's lots of setup going on here. Is this code copied from elsewhere?

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.cc:257: void
OnPrefValueChanged(const std::string& key) override {}
Add a comment why it's OK to ignore this.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
File services/preferences/public/cpp/user_prefs_impl.h (right):

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/cpp/user_prefs_impl.h:32: void CreateUserPrefs(
Both these functions, even if temporary, could use some more docs of their
non-trivial parameters. Here's my attempt:

// Create a new mojom::PersistentPrefStore impl that runs on |io_task_runner|
and listens to messages from the other end of the |request| handle. |request| is
bound on and can only be used on |connection_task_runner|.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
File services/preferences/public/interfaces/preferences.mojom (right):

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/interfaces/preferences.mojom:31: interface
PersistentPrefStore {
Document.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/interfaces/preferences.mojom:32: SetValue(string
key, mojo.common.mojom.Value? value, uint32 flags);
Here you at least want to say that a null |value| deletes.

https://codereview.chromium.org/2601873002/diff/780001/services/preferences/p...
services/preferences/public/interfaces/preferences.mojom:58:
mojo.common.mojom.DictionaryValue? preferences,
I believe null here implies initialization failure? Document that and the
relationship between the returned values.

Powered by Google App Engine
This is Rietveld 408576698