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

Issue 60823003: Introduced a ForwardingPolicyProvider. (Closed)

Created:
7 years, 1 month ago by Joao da Silva
Modified:
7 years, 1 month ago
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Introduced a ForwardingPolicyProvider. This policy provider forwards its methods to a delegate policy provider, but keeps its own state of initialization for each policy domain. This allows the Profile PolicyService to have a ForwardingPolicyProvider instead of directly reading from the platform provider, so that each Profile can be in a different initialization state. This means that the IsInitializationComplete() signal is now reliable and never goes from "ready" to "not ready". Also introduced a readiness signal for each domain at the SchemaRegistry. This allows policy providers to determine when to reload based on the availability of schemas for each component that supports policy. All of that together means that the ManagedValueStoreCache (which implements the API that allows extensions to read policy) can be greatly simplified, by simply waiting for the IsInitializationComplete() signal before starting to read policy values. The SchemaRegistry updates also enable a similar simplification in the ComponentCloudPolicyService, which will come later. BUG=270667, 108992, 171477 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235005

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : fixes #

Patch Set 4 : rebase, fixes #

Total comments: 39

Patch Set 5 : rebase, addressed comments #

Patch Set 6 : rebase #

Total comments: 8

Patch Set 7 : rebase, addressed comments #

Patch Set 8 : fixed unittest when enable_extensions=0 #

Total comments: 6

Patch Set 9 : fix crash on android, rebase on profile_policy_connector changes #

Total comments: 1

Patch Set 10 : fix includes #

Total comments: 8

Patch Set 11 : fixed ios #

Unified diffs Side-by-side diffs Delta from patch set Stats (+657 lines, -377 lines) Patch
M chrome/browser/chromeos/policy/proxy_policy_provider.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/policy/proxy_policy_provider.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/storage/managed_value_store_cache.h View 4 chunks +4 lines, -62 lines 0 comments Download
M chrome/browser/extensions/api/storage/managed_value_store_cache.cc View 1 2 3 4 5 6 8 chunks +79 lines, -187 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store.h View 1 2 3 4 1 chunk +3 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +51 lines, -41 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_apitest.cc View 1 2 3 chunks +3 lines, -9 lines 0 comments Download
M chrome/browser/policy/browser_policy_connector.h View 3 chunks +3 lines, -9 lines 0 comments Download
M chrome/browser/policy/browser_policy_connector.cc View 3 chunks +17 lines, -21 lines 0 comments Download
M chrome/browser/policy/configuration_policy_provider.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/policy/configuration_policy_provider.cc View 2 2 chunks +5 lines, -6 lines 0 comments Download
A chrome/browser/policy/forwarding_policy_provider.h View 1 2 3 4 5 6 7 8 1 chunk +68 lines, -0 lines 0 comments Download
A chrome/browser/policy/forwarding_policy_provider.cc View 1 2 3 4 1 chunk +89 lines, -0 lines 0 comments Download
A chrome/browser/policy/forwarding_policy_provider_unittest.cc View 1 2 3 4 5 6 7 1 chunk +173 lines, -0 lines 0 comments Download
M chrome/browser/policy/mock_configuration_policy_provider.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/policy/mock_configuration_policy_provider.cc View 1 2 3 4 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/policy/profile_policy_connector.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/policy/profile_policy_connector.cc View 1 2 3 4 5 6 7 8 4 chunks +23 lines, -7 lines 0 comments Download
M chrome/browser/policy/profile_policy_connector_factory.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +15 lines, -12 lines 0 comments Download
M chrome/browser/policy/profile_policy_connector_stub.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/policy/schema_registry.h View 4 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/policy/schema_registry.cc View 4 chunks +34 lines, -2 lines 0 comments Download
M chrome/browser/policy/schema_registry_service.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/policy/schema_registry_unittest.cc View 1 2 3 4 2 chunks +28 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/settings/managed_storage_disabled/manifest.json View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/settings/managed_storage_disabled/schema.json View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/test/data/extensions/api_test/settings/managed_storage_events/manifest.json View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/settings/managed_storage_events/schema.json View 1 2 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Joao da Silva
Please have a look. This uses the recent refactorings in the policy code to significantly ...
7 years, 1 month ago (2013-11-09 21:37:55 UTC) #1
bartfab (slow)
https://codereview.chromium.org/60823003/diff/690001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc File chrome/browser/extensions/api/storage/managed_value_store_cache.cc (right): https://codereview.chromium.org/60823003/diff/690001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc#newcode18 chrome/browser/extensions/api/storage/managed_value_store_cache.cc:18: #include "chrome/browser/extensions/extension_system.h" Nit: No longer used. https://codereview.chromium.org/60823003/diff/690001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc#newcode215 chrome/browser/extensions/api/storage/managed_value_store_cache.cc:215: // ...
7 years, 1 month ago (2013-11-11 14:40:08 UTC) #2
Joao da Silva
@Bartosz: PTAL @Benjamin: ping :-) All the dependencies are in, so this CL is ready ...
7 years, 1 month ago (2013-11-12 15:26:33 UTC) #3
not at google - send to devlin
lgtm, nice cleanup indeed. https://codereview.chromium.org/60823003/diff/1080001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc File chrome/browser/extensions/api/storage/managed_value_store_cache.cc (right): https://codereview.chromium.org/60823003/diff/1080001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc#newcode277 chrome/browser/extensions/api/storage/managed_value_store_cache.cc:277: policy::PolicyDomain domain) { for consistency ...
7 years, 1 month ago (2013-11-13 00:30:17 UTC) #4
Joao da Silva
@Bartosz: ping :-) https://codereview.chromium.org/60823003/diff/1080001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc File chrome/browser/extensions/api/storage/managed_value_store_cache.cc (right): https://codereview.chromium.org/60823003/diff/1080001/chrome/browser/extensions/api/storage/managed_value_store_cache.cc#newcode277 chrome/browser/extensions/api/storage/managed_value_store_cache.cc:277: policy::PolicyDomain domain) { On 2013/11/13 00:30:18, ...
7 years, 1 month ago (2013-11-13 08:56:47 UTC) #5
bartfab (slow)
lgtm https://chromiumcodereview.appspot.com/60823003/diff/690001/chrome/browser/policy/forwarding_policy_provider_unittest.cc File chrome/browser/policy/forwarding_policy_provider_unittest.cc (right): https://chromiumcodereview.appspot.com/60823003/diff/690001/chrome/browser/policy/forwarding_policy_provider_unittest.cc#newcode25 chrome/browser/policy/forwarding_policy_provider_unittest.cc:25: class ForwardingPolicyProviderTest : public testing::Test { On 2013/11/12 ...
7 years, 1 month ago (2013-11-13 11:56:34 UTC) #6
Joao da Silva
@Bartosz: addressed the previous comments. The latest patch set has a fix for a crash ...
7 years, 1 month ago (2013-11-13 17:30:48 UTC) #7
bartfab (slow)
lgtm https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/profile_policy_connector.h File chrome/browser/policy/profile_policy_connector.h (right): https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/profile_policy_connector.h#newcode63 chrome/browser/policy/profile_policy_connector.h:63: #endif Nit: Add // defined(OS_CHROMEOS) to make it ...
7 years, 1 month ago (2013-11-13 18:23:34 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joaodasilva@chromium.org/60823003/1690001
7 years, 1 month ago (2013-11-13 22:14:24 UTC) #9
commit-bot: I haz the power
Change committed as 235005
7 years, 1 month ago (2013-11-14 01:23:45 UTC) #10
Joao da Silva
7 years, 1 month ago (2013-11-14 08:23:41 UTC) #11
Message was sent while issue was closed.
Forgot to publish these drafts. Thanks for the reviews!

https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/p...
File chrome/browser/policy/profile_policy_connector.h (right):

https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/p...
chrome/browser/policy/profile_policy_connector.h:63: #endif
On 2013/11/13 18:23:35, bartfab wrote:
> Nit: Add // defined(OS_CHROMEOS) to make it clearer which #if is ending here.

Done.

https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/p...
chrome/browser/policy/profile_policy_connector.h:66: #endif
On 2013/11/13 18:23:35, bartfab wrote:
> Nit: Add // defined(ENABLE_CONFIGURATION_POLICY) to make it clearer which #if
is
> ending here.

Done.

https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/p...
File chrome/browser/policy/profile_policy_connector_factory.cc (right):

https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/p...
chrome/browser/policy/profile_policy_connector_factory.cc:108: #endif
On 2013/11/13 18:23:35, bartfab wrote:
> Nit: Add // defined(OS_CHROMEOS) to make it clearer which #if is ending here.

Done.

https://codereview.chromium.org/60823003/diff/1590001/chrome/browser/policy/p...
chrome/browser/policy/profile_policy_connector_factory.cc:112: #endif
On 2013/11/13 18:23:35, bartfab wrote:
> Nit: Add // defined(ENABLE_CONFIGURATION_POLICY) to make it clearer which #if
is
> ending here.

Done.

Powered by Google App Engine
This is Rietveld 408576698