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

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

Issue 1417003003: [tracing] Dump child processes' memory metrics in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: primiano's comments Created 4 years, 11 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698