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

Issue 1163593005: Update chrome.settingsPrivate to support CrOS-only settings. (Closed)

Created:
5 years, 6 months ago by Oren Blasberg
Modified:
5 years, 6 months ago
Reviewers:
stevenjb
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Update chrome.settingsPrivate to support CrOS-only settings. These needed special handling since they are managed by the CrOSSettings rather than by one of the PrefService objects. I also added a few such settings as used by the users page, to the prefs whitelist, and removed some dead code from the apitest. BUG=496308 Committed: https://crrev.com/f13e590ff96fc4a53f42f5549c0ed3d0872ab68d Cr-Commit-Position: refs/heads/master@{#333180}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : Ready for review. #

Patch Set 9 : Remove some unnecessary code from apitest. #

Patch Set 10 : Make PrefsUtil a class #

Total comments: 8

Patch Set 11 : Add AppendToList/RemoveFromListCrosSetting methods to PrefsUtil. #

Patch Set 12 : Address comments. #

Patch Set 13 : Sync/merge #

Patch Set 14 : Fix issues preventing compilation on non-CrOS builds. #

Total comments: 4

Messages

Total messages: 27 (8 generated)
Oren Blasberg
5 years, 6 months ago (2015-06-03 20:39:15 UTC) #2
Oren Blasberg
I cleaned up the api test a bit too, as the TestDelegate wasn't really serving ...
5 years, 6 months ago (2015-06-04 17:16:00 UTC) #3
Oren Blasberg
As discussed via email, I'm going to make further changes so that PrefsUtil may be ...
5 years, 6 months ago (2015-06-04 20:17:50 UTC) #4
Oren Blasberg
On 2015/06/04 20:17:50, Oren Blasberg wrote: > As discussed via email, I'm going to make ...
5 years, 6 months ago (2015-06-04 22:02:37 UTC) #5
Oren Blasberg
On 2015/06/04 22:02:37, Oren Blasberg wrote: > On 2015/06/04 20:17:50, Oren Blasberg wrote: > > ...
5 years, 6 months ago (2015-06-04 22:03:28 UTC) #6
stevenjb
This is looking great, thanks. https://codereview.chromium.org/1163593005/diff/180001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1163593005/diff/180001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode98 chrome/browser/extensions/api/settings_private/prefs_util.cc:98: CrosSettings* cros_settings = CrosSettings::Get(); ...
5 years, 6 months ago (2015-06-05 02:23:50 UTC) #7
Oren Blasberg
Thanks! PTAL. https://codereview.chromium.org/1163593005/diff/180001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1163593005/diff/180001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode98 chrome/browser/extensions/api/settings_private/prefs_util.cc:98: CrosSettings* cros_settings = CrosSettings::Get(); On 2015/06/05 02:23:50, ...
5 years, 6 months ago (2015-06-05 20:12:22 UTC) #8
stevenjb
lgtm
5 years, 6 months ago (2015-06-05 20:31:11 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1163593005/220001
5 years, 6 months ago (2015-06-05 20:37:35 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/79274)
5 years, 6 months ago (2015-06-05 20:59:27 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1163593005/240001
5 years, 6 months ago (2015-06-05 21:19:13 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_rel/builds/96316)
5 years, 6 months ago (2015-06-05 21:38:11 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1163593005/260001
5 years, 6 months ago (2015-06-05 22:50:12 UTC) #21
stevenjb
Still lgtm, just a tiny entirely optional nit/FYI. https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc File chrome/browser/extensions/api/settings_private/settings_private_event_router.cc (right): https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc#newcode104 chrome/browser/extensions/api/settings_private/settings_private_event_router.cc:104: #endif ...
5 years, 6 months ago (2015-06-05 22:59:15 UTC) #22
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 6 months ago (2015-06-05 23:55:16 UTC) #23
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/f13e590ff96fc4a53f42f5549c0ed3d0872ab68d Cr-Commit-Position: refs/heads/master@{#333180}
5 years, 6 months ago (2015-06-05 23:56:30 UTC) #24
Oren Blasberg
https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode112 chrome/browser/extensions/api/settings_private/prefs_util.cc:112: pref_object->type = GetType(name, value->GetType()); Somehow, this line segfaults if ...
5 years, 6 months ago (2015-06-06 00:42:55 UTC) #25
stevenjb
https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode112 chrome/browser/extensions/api/settings_private/prefs_util.cc:112: pref_object->type = GetType(name, value->GetType()); On 2015/06/06 00:42:55, Oren Blasberg ...
5 years, 6 months ago (2015-06-06 00:48:17 UTC) #26
Oren Blasberg
5 years, 6 months ago (2015-06-06 01:02:11 UTC) #27
Message was sent while issue was closed.
https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensi...
File chrome/browser/extensions/api/settings_private/prefs_util.cc (right):

https://codereview.chromium.org/1163593005/diff/260001/chrome/browser/extensi...
chrome/browser/extensions/api/settings_private/prefs_util.cc:112:
pref_object->type = GetType(name, value->GetType());
On 2015/06/06 00:48:17, stevenjb wrote:
> On 2015/06/06 00:42:55, Oren Blasberg wrote:
> > Somehow, this line segfaults if name is 'cros.accounts.users' (and if we
also
> > add cros.accounts.users to the whitelist, of course).  According to gdb, the
> > value of type_ is 0x8 (a pointer to 0x8.... umm) Very weird :\
> 
> Is value maybe NULL?

Whoops, you're right, it's null.
However, I don't get why. I'm basically doing the same thing as what
accounts_options_handler.cc does [1], except that file is going through
GetList() which calls GetPref, and I'm just calling GetPref directly. GetList
calls "GetAsList" on the value but if the value's null that wouldn't make a
difference.

Maybe some sort of timing/lifetime issue.. basically since we load all prefs on
startup, adding 'cros.users.accounts' to the prefs_util.cc whitelist causes
md-settings to crash on load.

Hopefully the clarity of Monday morning will bring fresh insight.


[1]
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/...

Powered by Google App Engine
This is Rietveld 408576698