diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-07 12:43:52 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-07 12:43:52 +0000 |
commit | 05e1e70d1295a76fff2e87e2b50b79452280ebe6 (patch) | |
tree | 729dcb99f8d5c49d3314a03434c543513734f7a9 /chrome/browser/extensions | |
parent | a3eca3c61331c18c25c3c92c920f04e082f2d01e (diff) | |
download | chromium_src-05e1e70d1295a76fff2e87e2b50b79452280ebe6.zip chromium_src-05e1e70d1295a76fff2e87e2b50b79452280ebe6.tar.gz chromium_src-05e1e70d1295a76fff2e87e2b50b79452280ebe6.tar.bz2 |
Make the internal storage policy::Schemas ref counted.
The policy Schemas are used to represent the expected data types of policy
values. Making their internal storage refcounted will allow passing them to background threads
that use them to validate data being loaded, while the UI thread may be
concurrently loading a new Schema for the same component.
This change makes Schema directly reference the InternalStorage struct, so that
SchemaOwner is not necessary anymore.
BUG=270667
R=dconnelly@chromium.org, kalman@chromium.org
Review URL: https://codereview.chromium.org/47513018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/api/storage/managed_value_store_cache.cc | 13 |
1 files changed, 6 insertions, 7 deletions
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 b60b773..c1957f30 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( |