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

Unified Diff: chrome/browser/extensions/api/storage/managed_value_store_cache.cc

Issue 47513018: Make the internal storage of policy::Schemas ref counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-4-new-generate
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/policy/browser_policy_connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/storage/managed_value_store_cache.cc
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index b60b773bc7a3ba84199273dcb4c7d1bc96e4226a..c1957f301b47c70a2a1b7e3e110d5be58ded9e3f 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -112,7 +112,7 @@ void ManagedValueStoreCache::ExtensionTracker::Observe(
}
// TODO(joaodasilva): also load extensions that use the storage API for now,
- // to support the Legacy Browser Support extension. Remove this for M30.
+ // to support the Legacy Browser Support extension. Remove this.
// http://crbug.com/240704
if ((*it)->HasAPIPermission(APIPermission::kStorage))
managed_extensions->Insert(*it);
@@ -138,10 +138,9 @@ void ManagedValueStoreCache::ExtensionTracker::LoadSchemas(
std::string schema_file;
if (!(*it)->manifest()->GetString(
manifest_keys::kStorageManagedSchema, &schema_file)) {
- // TODO(joaodasilva): Remove this for M32. http://crbug.com/240704
+ // TODO(joaodasilva): Remove this. http://crbug.com/240704
if ((*it)->HasAPIPermission(APIPermission::kStorage)) {
- descriptor->RegisterComponent((*it)->id(),
- scoped_ptr<policy::SchemaOwner>());
+ descriptor->RegisterComponent((*it)->id(), policy::Schema());
} else {
NOTREACHED();
}
@@ -150,10 +149,10 @@ void ManagedValueStoreCache::ExtensionTracker::LoadSchemas(
// The extension should have been validated, so assume the schema exists
// and is valid.
std::string error;
- scoped_ptr<policy::SchemaOwner> schema =
+ policy::Schema schema =
StorageSchemaManifestHandler::GetSchema(it->get(), &error);
- CHECK(schema) << error;
- descriptor->RegisterComponent((*it)->id(), schema.Pass());
+ CHECK(schema.valid()) << error;
+ descriptor->RegisterComponent((*it)->id(), schema);
}
BrowserThread::PostTask(
« no previous file with comments | « no previous file | chrome/browser/policy/browser_policy_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698