Commit 7829c011 authored by rockot's avatar rockot Committed by Commit bot

Add CHECKs to catch invalid builtin manifest resources earlier

BUG=653382
TBR=ben@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2440193003
Cr-Commit-Position: refs/heads/master@{#426894}
parent f898cd59
......@@ -225,9 +225,14 @@ ServiceManagerContext::ServiceManagerContext() {
std::string contents = GetContentClient()->GetDataResource(
kManifests[i].resource_id,
ui::ScaleFactor::SCALE_FACTOR_NONE).as_string();
DCHECK(!contents.empty());
base::debug::Alias(&i);
CHECK(!contents.empty());
std::unique_ptr<base::Value> manifest_value =
base::JSONReader::Read(contents);
base::debug::Alias(&contents);
CHECK(manifest_value);
std::unique_ptr<base::Value> overlay_value =
GetContentClient()->browser()->GetServiceManifestOverlay(
kManifests[i].name);
......@@ -238,6 +243,7 @@ ServiceManagerContext::ServiceManagerContext() {
CHECK(overlay_value->GetAsDictionary(&overlay_dictionary));
MergeDictionary(manifest_dictionary, overlay_dictionary);
}
manifest_provider->AddManifestValue(kManifests[i].name,
std::move(manifest_value));
}
......
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