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

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: Latest master 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 1ffc355cc481573e8791e2bc0a5571b70a6f2762..3728543d2be924e1d91fb9c3acb6c11e3f8c3270 100644
--- a/extensions/renderer/object_backed_native_handler.cc
+++ b/extensions/renderer/object_backed_native_handler.cc
@@ -74,10 +74,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;
+ }
}
}
// This CHECK is *important*. Otherwise, we'll go around happily executing
« no previous file with comments | « extensions/renderer/lazy_background_page_native_handler.cc ('k') | extensions/renderer/print_native_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698