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

Unified Diff: components/policy/core/common/schema_registry_tracking_policy_provider.cc

Issue 775613004: Improve documentation for special-purpose policy providers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy_provider_dcheck
Patch Set: Address nits. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/schema_registry_tracking_policy_provider.cc
diff --git a/components/policy/core/common/forwarding_policy_provider.cc b/components/policy/core/common/schema_registry_tracking_policy_provider.cc
similarity index 76%
rename from components/policy/core/common/forwarding_policy_provider.cc
rename to components/policy/core/common/schema_registry_tracking_policy_provider.cc
index 9c8060202c91b50e3675f333e5fedcce837438ee..4f8e7194bb852d0b30793927355458ba51ee9e12 100644
--- a/components/policy/core/common/forwarding_policy_provider.cc
+++ b/components/policy/core/common/schema_registry_tracking_policy_provider.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/policy/core/common/forwarding_policy_provider.h"
+#include "components/policy/core/common/schema_registry_tracking_policy_provider.h"
#include "components/policy/core/common/schema_map.h"
#include "components/policy/core/common/schema_registry.h"
namespace policy {
-ForwardingPolicyProvider::ForwardingPolicyProvider(
+SchemaRegistryTrackingPolicyProvider::SchemaRegistryTrackingPolicyProvider(
ConfigurationPolicyProvider* delegate)
: delegate_(delegate), state_(WAITING_FOR_REGISTRY_READY) {
delegate_->AddObserver(this);
@@ -17,29 +17,29 @@ ForwardingPolicyProvider::ForwardingPolicyProvider(
OnUpdatePolicy(delegate_);
}
-ForwardingPolicyProvider::~ForwardingPolicyProvider() {
+SchemaRegistryTrackingPolicyProvider::~SchemaRegistryTrackingPolicyProvider() {
delegate_->RemoveObserver(this);
}
-void ForwardingPolicyProvider::Init(SchemaRegistry* registry) {
+void SchemaRegistryTrackingPolicyProvider::Init(SchemaRegistry* registry) {
ConfigurationPolicyProvider::Init(registry);
if (registry->IsReady())
OnSchemaRegistryReady();
}
-bool ForwardingPolicyProvider::IsInitializationComplete(PolicyDomain domain)
- const {
+bool SchemaRegistryTrackingPolicyProvider::IsInitializationComplete(
+ PolicyDomain domain) const {
if (domain == POLICY_DOMAIN_CHROME)
return delegate_->IsInitializationComplete(domain);
// This provider keeps its own state for all the other domains.
return state_ == READY;
}
-void ForwardingPolicyProvider::RefreshPolicies() {
+void SchemaRegistryTrackingPolicyProvider::RefreshPolicies() {
delegate_->RefreshPolicies();
}
-void ForwardingPolicyProvider::OnSchemaRegistryReady() {
+void SchemaRegistryTrackingPolicyProvider::OnSchemaRegistryReady() {
DCHECK_EQ(WAITING_FOR_REGISTRY_READY, state_);
// This provider's registry is ready, meaning that it has all the initial
// components schemas; the delegate's registry should also see them now,
@@ -59,7 +59,8 @@ void ForwardingPolicyProvider::OnSchemaRegistryReady() {
RefreshPolicies();
}
-void ForwardingPolicyProvider::OnSchemaRegistryUpdated(bool has_new_schemas) {
+void SchemaRegistryTrackingPolicyProvider::OnSchemaRegistryUpdated(
+ bool has_new_schemas) {
if (state_ != READY)
return;
if (has_new_schemas) {
@@ -72,7 +73,7 @@ void ForwardingPolicyProvider::OnSchemaRegistryUpdated(bool has_new_schemas) {
}
}
-void ForwardingPolicyProvider::OnUpdatePolicy(
+void SchemaRegistryTrackingPolicyProvider::OnUpdatePolicy(
ConfigurationPolicyProvider* provider) {
DCHECK_EQ(delegate_, provider);
@@ -84,7 +85,7 @@ void ForwardingPolicyProvider::OnUpdatePolicy(
bundle->CopyFrom(delegate_->policies());
schema_map()->FilterBundle(bundle.get());
} else {
- // Always forward the Chrome policy, even if the components are not ready
+ // Always pass on the Chrome policy, even if the components are not ready
// yet.
const PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, "");
bundle->Get(chrome_ns).CopyFrom(delegate_->policies().Get(chrome_ns));

Powered by Google App Engine
This is Rietveld 408576698