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

Unified Diff: extensions/browser/extension_zoom_request_client.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
Index: extensions/browser/extension_zoom_request_client.cc
diff --git a/extensions/browser/extension_zoom_request_client.cc b/extensions/browser/extension_zoom_request_client.cc
index ce8b45ce4acc009ec4c491b1978594113f1c14d7..c462a2a7f51abbe817a9c037aded921b964a9bfa 100644
--- a/extensions/browser/extension_zoom_request_client.cc
+++ b/extensions/browser/extension_zoom_request_client.cc
@@ -5,6 +5,7 @@
#include "extensions/browser/extension_zoom_request_client.h"
#include "extensions/common/features/behavior_feature.h"
+#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_provider.h"
namespace extensions {
@@ -15,10 +16,9 @@ ExtensionZoomRequestClient::ExtensionZoomRequestClient(
}
bool ExtensionZoomRequestClient::ShouldSuppressBubble() const {
- return FeatureProvider::GetBehaviorFeature(
- BehaviorFeature::kZoomWithoutBubble)
- ->IsAvailableToExtension(extension())
- .is_available();
+ const Feature* feature =
+ FeatureProvider::GetBehaviorFeature(BehaviorFeature::kZoomWithoutBubble);
+ return feature && feature->IsAvailableToExtension(extension()).is_available();
}
ExtensionZoomRequestClient::~ExtensionZoomRequestClient() {
« no previous file with comments | « chrome/common/extensions/sync_helper.cc ('k') | extensions/browser/guest_view/extensions_guest_view_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698