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

Unified Diff: extensions/common/features/feature_provider.cc

Issue 1835863002: Added check for behavior feature existense (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Get*Feature return |nullptr| instead crash if feature is missing Created 4 years, 8 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 | « extensions/common/features/feature_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/feature_provider.cc
diff --git a/extensions/common/features/feature_provider.cc b/extensions/common/features/feature_provider.cc
index e420094ae7726c7a9a2810e28c9716684bfae008..7d25717b9013aa93f69e3afb1b3e1983a6bdcd72 100644
--- a/extensions/common/features/feature_provider.cc
+++ b/extensions/common/features/feature_provider.cc
@@ -13,6 +13,7 @@
#include "base/trace_event/trace_event.h"
#include "content/public/common/content_switches.h"
#include "extensions/common/extensions_client.h"
+#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_util.h"
#include "extensions/common/switches.h"
@@ -67,10 +68,10 @@ const Feature* GetFeatureFromProviderByName(const std::string& provider_name,
const std::string& feature_name) {
const Feature* feature =
FeatureProvider::GetByName(provider_name)->GetFeature(feature_name);
- if (!feature) {
- CRASH_WITH_MINIDUMP("Feature \"" + feature_name + "\" not found in " +
- "FeatureProvider \"" + provider_name + "\"");
- }
+ // We should always refer to existing features, but we can't CHECK here
+ // due to flaky JSONReader fails, see: crbug.com/176381, crbug.com/602936
+ DCHECK(feature) << "Feature \"" << feature_name << "\" not found in "
+ << "FeatureProvider \"" << provider_name << "\"";
return feature;
}
« no previous file with comments | « extensions/common/features/feature_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698