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

Unified Diff: extensions/renderer/object_backed_native_handler.cc

Issue 1854983002: [Extensions] Add more bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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/renderer/object_backed_native_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23be1d6789e88bfedfa253fcd8040f77f3fa7cd0..3ddf62222f39fc64ad355486db9fed6f9a15c602 100644
--- a/extensions/renderer/object_backed_native_handler.cc
+++ b/extensions/renderer/object_backed_native_handler.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/memory/linked_ptr.h"
#include "content/public/child/worker_thread.h"
+#include "extensions/common/extension_api.h"
#include "extensions/renderer/console.h"
#include "extensions/renderer/module_system.h"
#include "extensions/renderer/script_context.h"
@@ -102,6 +103,9 @@ void ObjectBackedNativeHandler::RouteFunction(
v8::Local<v8::Object> data = v8::Object::New(isolate);
SetPrivate(data, kHandlerFunction,
v8::External::New(isolate, new HandlerFunction(handler_function)));
+ DCHECK(feature_name.empty() ||
+ ExtensionAPI::GetSharedInstance()->GetFeatureDependency(feature_name))
+ << feature_name;
SetPrivate(data, kFeatureName,
v8_helpers::ToV8StringUnsafe(isolate, feature_name));
v8::Local<v8::FunctionTemplate> function_template =
« no previous file with comments | « extensions/renderer/object_backed_native_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698