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

Side by Side Diff: components/policy/core/common/schema_registry.cc

Issue 392233003: Cleanups to the policy code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/policy/core/common/schema_registry.h" 5 #include "components/policy/core/common/schema_registry.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace policy { 9 namespace policy {
10 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 ForwardingSchemaRegistry::~ForwardingSchemaRegistry() { 198 ForwardingSchemaRegistry::~ForwardingSchemaRegistry() {
199 if (wrapped_) { 199 if (wrapped_) {
200 wrapped_->RemoveObserver(this); 200 wrapped_->RemoveObserver(this);
201 wrapped_->RemoveInternalObserver(this); 201 wrapped_->RemoveInternalObserver(this);
202 } 202 }
203 } 203 }
204 204
205 void ForwardingSchemaRegistry::RegisterComponents( 205 void ForwardingSchemaRegistry::RegisterComponents(
206 PolicyDomain domain, 206 PolicyDomain domain,
207 const ComponentMap& components) { 207 const ComponentMap& components) {
208 // POLICY_DOMAIN_CHROME is skipped to avoid spurious updated when a new 208 // POLICY_DOMAIN_CHROME is skipped to avoid spurious updates when a new
209 // Profile is created. If the ForwardingSchemaRegistry is meant to be used 209 // Profile is created. If the ForwardingSchemaRegistry is used outside
210 // outside device-level accounts then this should become configurable. 210 // device-level accounts then this should become configurable.
211 if (wrapped_ && domain != POLICY_DOMAIN_CHROME) 211 if (wrapped_ && domain != POLICY_DOMAIN_CHROME)
212 wrapped_->RegisterComponents(domain, components); 212 wrapped_->RegisterComponents(domain, components);
213 // Ignore otherwise. 213 // Ignore otherwise.
214 } 214 }
215 215
216 void ForwardingSchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) { 216 void ForwardingSchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) {
217 if (wrapped_) 217 if (wrapped_)
218 wrapped_->UnregisterComponent(ns); 218 wrapped_->UnregisterComponent(ns);
219 // Ignore otherwise. 219 // Ignore otherwise.
220 } 220 }
(...skipping 10 matching lines...) Expand all
231 void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown( 231 void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown(
232 SchemaRegistry* registry) { 232 SchemaRegistry* registry) {
233 DCHECK_EQ(wrapped_, registry); 233 DCHECK_EQ(wrapped_, registry);
234 wrapped_->RemoveObserver(this); 234 wrapped_->RemoveObserver(this);
235 wrapped_->RemoveInternalObserver(this); 235 wrapped_->RemoveInternalObserver(this);
236 wrapped_ = NULL; 236 wrapped_ = NULL;
237 // Keep serving the same |schema_map_|. 237 // Keep serving the same |schema_map_|.
238 } 238 }
239 239
240 } // namespace policy 240 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698