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

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

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
Index: extensions/common/features/feature_provider.h
diff --git a/extensions/common/features/feature_provider.h b/extensions/common/features/feature_provider.h
index ae975137b508e845f81fca7498652006bf2bcaa3..824ce85b3eef12e6cfd702302eb45f12564e5f77 100644
--- a/extensions/common/features/feature_provider.h
+++ b/extensions/common/features/feature_provider.h
@@ -39,6 +39,8 @@ class FeatureProvider {
// Directly get Features from the common FeatureProvider types.
// Each is equivalent to GetByName('featuretype')->GetFeature(name).
+ // NOTE: These functions may return |nullptr| in case corresponding JSON file
+ // got corrupted.
static const Feature* GetAPIFeature(const std::string& name);
static const Feature* GetManifestFeature(const std::string& name);
static const Feature* GetPermissionFeature(const std::string& name);

Powered by Google App Engine
This is Rietveld 408576698