| OLD | NEW |
| 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 #include "extensions/features/features.h" |
| 8 | 9 |
| 9 namespace policy { | 10 namespace policy { |
| 10 | 11 |
| 11 SchemaRegistry::Observer::~Observer() {} | 12 SchemaRegistry::Observer::~Observer() {} |
| 12 | 13 |
| 13 SchemaRegistry::InternalObserver::~InternalObserver() {} | 14 SchemaRegistry::InternalObserver::~InternalObserver() {} |
| 14 | 15 |
| 15 SchemaRegistry::SchemaRegistry() : schema_map_(new SchemaMap) { | 16 SchemaRegistry::SchemaRegistry() : schema_map_(new SchemaMap) { |
| 16 for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i) | 17 for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i) |
| 17 domains_ready_[i] = false; | 18 domains_ready_[i] = false; |
| 18 #if !defined(ENABLE_EXTENSIONS) | 19 #if !BUILDFLAG(ENABLE_EXTENSIONS) |
| 19 SetExtensionsDomainsReady(); | 20 SetExtensionsDomainsReady(); |
| 20 #endif | 21 #endif |
| 21 } | 22 } |
| 22 | 23 |
| 23 SchemaRegistry::~SchemaRegistry() { | 24 SchemaRegistry::~SchemaRegistry() { |
| 24 for (auto& observer : internal_observers_) | 25 for (auto& observer : internal_observers_) |
| 25 observer.OnSchemaRegistryShuttingDown(this); | 26 observer.OnSchemaRegistryShuttingDown(this); |
| 26 } | 27 } |
| 27 | 28 |
| 28 void SchemaRegistry::RegisterComponent(const PolicyNamespace& ns, | 29 void SchemaRegistry::RegisterComponent(const PolicyNamespace& ns, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 wrapped_ = NULL; | 244 wrapped_ = NULL; |
| 244 // Keep serving the same |schema_map_|. | 245 // Keep serving the same |schema_map_|. |
| 245 } | 246 } |
| 246 | 247 |
| 247 void ForwardingSchemaRegistry::UpdateReadiness() { | 248 void ForwardingSchemaRegistry::UpdateReadiness() { |
| 248 if (wrapped_->IsReady()) | 249 if (wrapped_->IsReady()) |
| 249 SetAllDomainsReady(); | 250 SetAllDomainsReady(); |
| 250 } | 251 } |
| 251 | 252 |
| 252 } // namespace policy | 253 } // namespace policy |
| OLD | NEW |