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

Unified Diff: chrome/browser/policy/schema_registry_service.cc

Issue 349643002: Decoupled the SchemaRegistryService from SchemaRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/schema_registry_service.cc
diff --git a/chrome/browser/policy/schema_registry_service.cc b/chrome/browser/policy/schema_registry_service.cc
index b8124cde9f07fe88b498da9f1e193f8b3524c3ab..9cf2b494e8f06fc8c49b4a98e6dd50ebb8d0f749 100644
--- a/chrome/browser/policy/schema_registry_service.cc
+++ b/chrome/browser/policy/schema_registry_service.cc
@@ -4,31 +4,26 @@
#include "chrome/browser/policy/schema_registry_service.h"
-#include "base/logging.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/schema.h"
+#include "components/policy/core/common/schema_registry.h"
namespace policy {
SchemaRegistryService::SchemaRegistryService(
+ scoped_ptr<SchemaRegistry> registry,
const Schema& chrome_schema,
CombinedSchemaRegistry* global_registry)
- : global_registry_(global_registry) {
- if (chrome_schema.valid())
- RegisterComponent(PolicyNamespace(POLICY_DOMAIN_CHROME, ""), chrome_schema);
- SetReady(POLICY_DOMAIN_CHROME);
- if (global_registry_)
- global_registry->Track(this);
+ : registry_(registry.Pass()) {
+ if (chrome_schema.valid()) {
+ registry_->RegisterComponent(PolicyNamespace(POLICY_DOMAIN_CHROME, ""),
+ chrome_schema);
+ }
+ registry_->SetReady(POLICY_DOMAIN_CHROME);
+ if (global_registry)
+ global_registry->Track(registry_.get());
}
SchemaRegistryService::~SchemaRegistryService() {}
-void SchemaRegistryService::Shutdown() {
- if (global_registry_) {
- global_registry_->Untrack(this);
- global_registry_ = NULL;
- }
- DCHECK(!HasObservers());
-}
-
} // namespace policy
« no previous file with comments | « chrome/browser/policy/schema_registry_service.h ('k') | chrome/browser/policy/schema_registry_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698