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

Unified Diff: content/browser/service_manager/service_manager_context.cc

Issue 2440193003: Add CHECKs to catch invalid builtin manifest resources earlier (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_manager/service_manager_context.cc
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc
index 92ff7652101af04ec2c6220d843c2553abed86a1..72730fce09c7d0ebef60ff3de560964c7e32310e 100644
--- a/content/browser/service_manager/service_manager_context.cc
+++ b/content/browser/service_manager/service_manager_context.cc
@@ -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));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698