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

Issue 6074003: Handle policy refresh internally in ConfigurationPolicyPrefStore. (Closed)

Created:
10 years ago by Mattias Nissler (ping if slow)
Modified:
4 years, 2 months ago
Reviewers:
Dan Beam, danno
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org, Jakob Kummerow
Visibility:
Public.

Description

Handle policy refresh internally in ConfigurationPolicyPrefStore. This removes the final bits of thread-switching madness from PrefValueStore and also makes sure only the PrefStores and PrefService instances that are actually affected by a policy change get reconfigured. BUG=67715 TEST=unit tests in configuration_policy_provider_unittest.cc Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70050

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments. #

Patch Set 3 : updates #

Patch Set 4 : Rebase to ToT #

Total comments: 1

Patch Set 5 : fix nit #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1138 lines, -1472 lines) Patch
M base/values.h View 2 chunks +0 lines, -21 lines 0 comments Download
M base/values.cc View 1 chunk +0 lines, -108 lines 0 comments Download
M base/values_unittest.cc View 2 chunks +1 line, -132 lines 0 comments Download
M chrome/browser/policy/config_dir_policy_provider.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/policy/configuration_policy_pref_store.h View 1 2 3 2 chunks +34 lines, -82 lines 0 comments Download
M chrome/browser/policy/configuration_policy_pref_store.cc View 1 2 3 4 11 chunks +557 lines, -359 lines 2 comments Download
M chrome/browser/policy/configuration_policy_pref_store_unittest.cc View 1 2 3 13 chunks +332 lines, -307 lines 0 comments Download
M chrome/browser/policy/configuration_policy_provider.h View 1 chunk +13 lines, -8 lines 0 comments Download
M chrome/browser/policy/device_management_policy_provider.h View 2 chunks +1 line, -8 lines 0 comments Download
M chrome/browser/policy/device_management_policy_provider.cc View 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/policy/device_management_policy_provider_unittest.cc View 1 5 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/policy/mock_configuration_policy_provider.h View 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/policy/mock_configuration_policy_provider.cc View 3 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/prefs/pref_member_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prefs/pref_notifier_impl_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prefs/pref_service.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/prefs/pref_service.cc View 4 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/prefs/pref_service_mock_builder.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/prefs/pref_service_mock_builder.cc View 2 chunks +2 lines, -6 lines 0 comments Download
M chrome/browser/prefs/pref_value_map.h View 2 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_value_map.cc View 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/prefs/pref_value_map_unittest.cc View 1 chunk +76 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_value_store.h View 7 chunks +2 lines, -50 lines 0 comments Download
M chrome/browser/prefs/pref_value_store.cc View 4 chunks +2 lines, -148 lines 0 comments Download
M chrome/browser/prefs/pref_value_store_unittest.cc View 1 2 3 3 chunks +2 lines, -222 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_store_observer_mock.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/testing_pref_service.cc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 9 (1 generated)
Mattias Nissler (ping if slow)
Please review!
10 years ago (2010-12-21 17:31:50 UTC) #1
danno
look pretty close http://codereview.chromium.org/6074003/diff/1/chrome/browser/policy/config_dir_policy_provider.cc File chrome/browser/policy/config_dir_policy_provider.cc (right): http://codereview.chromium.org/6074003/diff/1/chrome/browser/policy/config_dir_policy_provider.cc#newcode72 chrome/browser/policy/config_dir_policy_provider.cc:72: last_modification = std::max(last_modification, file_info.last_modified); unlrelated to ...
10 years ago (2010-12-22 14:00:19 UTC) #2
Mattias Nissler (ping if slow)
Comments answered/addressed. http://codereview.chromium.org/6074003/diff/1/chrome/browser/policy/config_dir_policy_provider.cc File chrome/browser/policy/config_dir_policy_provider.cc (right): http://codereview.chromium.org/6074003/diff/1/chrome/browser/policy/config_dir_policy_provider.cc#newcode72 chrome/browser/policy/config_dir_policy_provider.cc:72: last_modification = std::max(last_modification, file_info.last_modified); On 2010/12/22 14:00:19, ...
10 years ago (2010-12-22 14:11:03 UTC) #3
danno
lgtm
10 years ago (2010-12-23 09:39:04 UTC) #4
Mattias Nissler (ping if slow)
I rebased after battre committed his latest change, can you please recheck whether this is ...
10 years ago (2010-12-23 11:33:54 UTC) #5
danno
slgtm with a nit http://codereview.chromium.org/6074003/diff/19001/chrome/browser/policy/configuration_policy_pref_store.cc File chrome/browser/policy/configuration_policy_pref_store.cc (right): http://codereview.chromium.org/6074003/diff/19001/chrome/browser/policy/configuration_policy_pref_store.cc#newcode81 chrome/browser/policy/configuration_policy_pref_store.cc:81: // Remove the preferences found ...
10 years ago (2010-12-23 12:16:33 UTC) #6
Dan Beam
https://codereview.chromium.org/6074003/diff/4030/chrome/browser/policy/configuration_policy_pref_store.cc File chrome/browser/policy/configuration_policy_pref_store.cc (right): https://codereview.chromium.org/6074003/diff/4030/chrome/browser/policy/configuration_policy_pref_store.cc#newcode391 chrome/browser/policy/configuration_policy_pref_store.cc:391: if (value->GetAsBoolean(&disable_sync) && disable_sync) mnissler@: why is this pref ...
4 years, 2 months ago (2016-09-29 01:50:01 UTC) #8
Mattias Nissler (ping if slow)
4 years, 2 months ago (2016-09-29 08:00:34 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/6074003/diff/4030/chrome/browser/policy/confi...
File chrome/browser/policy/configuration_policy_pref_store.cc (right):

https://codereview.chromium.org/6074003/diff/4030/chrome/browser/policy/confi...
chrome/browser/policy/configuration_policy_pref_store.cc:391: if
(value->GetAsBoolean(&disable_sync) && disable_sync)
On 2016/09/29 01:50:01, Dan Beam wrote:
> mnissler@: why is this pref not being set regardless of truthiness?  i.e. why
> shouldn't this be set when !disable_sync as well?

When I wrote this code, it conceptually didn't make sense for an admin to
force-enable sync. Which would be implied by an admin configuring
kPolicySyncDisabled = false. Has that changed now? Why are you asking?

For background, the general idea about policy-controlled prefs is that they
provide overrides expression the constraints imposed by the admin. If the admin
doesn't care, it's left up to the user to make a decision. That said,
prefs::kSyncManaged is a degenerate case, since this pref was introduced for the
sole purpose of communicating the policy setting to the sync code, there's
actually no way for the user to manipulate this pref.

Powered by Google App Engine
This is Rietveld 408576698