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

Unified Diff: extensions/renderer/object_backed_native_handler.cc

Issue 1866103002: [Extensions] Expand bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/renderer/object_backed_native_handler.cc
diff --git a/extensions/renderer/object_backed_native_handler.cc b/extensions/renderer/object_backed_native_handler.cc
index 3ddf62222f39fc64ad355486db9fed6f9a15c602..e0c31078b0396d65cc53fd6ff62f06168da4b0e1 100644
--- a/extensions/renderer/object_backed_native_handler.cc
+++ b/extensions/renderer/object_backed_native_handler.cc
@@ -73,10 +73,14 @@ void ObjectBackedNativeHandler::Router(
std::string feature_name = *v8::String::Utf8Value(feature_name_string);
// TODO(devlin): Eventually, we should fail if either script_context is null
// or feature_name is empty.
- if (script_context &&
- !feature_name.empty() &&
- !script_context->GetAvailability(feature_name).is_available()) {
- return;
+ if (script_context && !feature_name.empty()) {
+ Feature::Availability availability =
+ script_context->GetAvailability(feature_name);
+ if (!availability.is_available()) {
+ DVLOG(1) << feature_name
+ << " is not available: " << availability.message();
+ return;
+ }
asargent_no_longer_on_chrome 2016/04/11 17:30:14 Did you intend for this to get checked in or were
Devlin 2016/04/13 19:51:26 I wanted to check this one in (I think DVLOG is ok
asargent_no_longer_on_chrome 2016/04/13 23:02:40 Ok, just wasn't sure since a checked-in DVLOG is m
}
}
// This CHECK is *important*. Otherwise, we'll go around happily executing

Powered by Google App Engine
This is Rietveld 408576698