Accept invalid Schemas for the managed storage API.

Extensions won't get installed if they declare a managed storage schema
and the schema is invalid. But if the schema is modified or deleted
after the extension is installed then this CHECK will be hit whenever
Chrome restarts.

If the schema is modified or becomes invalid then the managed storage
API won't pickup the right policies for the extension, but that's
better than crashing the browser.

BUG=399208

Review URL: https://codereview.chromium.org/464893002

Cr-Commit-Position: refs/heads/master@{#289623}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289623 0039d316-1c4b-4281-b951-d872f2087c98
parent 8a07e58b
...@@ -206,7 +206,10 @@ void ManagedValueStoreCache::ExtensionTracker::LoadSchemasOnBlockingPool( ...@@ -206,7 +206,10 @@ void ManagedValueStoreCache::ExtensionTracker::LoadSchemasOnBlockingPool(
std::string error; std::string error;
policy::Schema schema = policy::Schema schema =
StorageSchemaManifestHandler::GetSchema(it->get(), &error); StorageSchemaManifestHandler::GetSchema(it->get(), &error);
CHECK(schema.valid()) << error; // If the schema is invalid then proceed with an empty schema. The extension
// will be listed in chrome://policy but won't be able to load any policies.
if (!schema.valid())
schema = policy::Schema();
(*components)[(*it)->id()] = schema; (*components)[(*it)->id()] = schema;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment