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 | 8 |
9 namespace policy { | 9 namespace policy { |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 schema_map_ = new SchemaMap(map); | 48 schema_map_ = new SchemaMap(map); |
49 Notify(true); | 49 Notify(true); |
50 } | 50 } |
51 | 51 |
52 void SchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) { | 52 void SchemaRegistry::UnregisterComponent(const PolicyNamespace& ns) { |
53 DomainMap map(schema_map_->GetDomains()); | 53 DomainMap map(schema_map_->GetDomains()); |
54 if (map[ns.domain].erase(ns.component_id) != 0) { | 54 if (map[ns.domain].erase(ns.component_id) != 0) { |
55 schema_map_ = new SchemaMap(map); | 55 schema_map_ = new SchemaMap(map); |
56 Notify(false); | 56 Notify(false); |
57 } else { | 57 } else { |
58 NOTREACHED(); | |
Primiano Tucci (use gerrit)
2016/01/05 11:55:17
same here (conflicts)
ssid
2016/01/06 20:26:33
Done.
| |
59 } | 58 } |
60 } | 59 } |
61 | 60 |
62 bool SchemaRegistry::IsReady() const { | 61 bool SchemaRegistry::IsReady() const { |
63 for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i) { | 62 for (int i = 0; i < POLICY_DOMAIN_SIZE; ++i) { |
64 if (!domains_ready_[i]) | 63 if (!domains_ready_[i]) |
65 return false; | 64 return false; |
66 } | 65 } |
67 return true; | 66 return true; |
68 } | 67 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown( | 222 void ForwardingSchemaRegistry::OnSchemaRegistryShuttingDown( |
224 SchemaRegistry* registry) { | 223 SchemaRegistry* registry) { |
225 DCHECK_EQ(wrapped_, registry); | 224 DCHECK_EQ(wrapped_, registry); |
226 wrapped_->RemoveObserver(this); | 225 wrapped_->RemoveObserver(this); |
227 wrapped_->RemoveInternalObserver(this); | 226 wrapped_->RemoveInternalObserver(this); |
228 wrapped_ = NULL; | 227 wrapped_ = NULL; |
229 // Keep serving the same |schema_map_|. | 228 // Keep serving the same |schema_map_|. |
230 } | 229 } |
231 | 230 |
232 } // namespace policy | 231 } // namespace policy |
OLD | NEW |