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

Unified Diff: extensions/renderer/module_system.cc

Issue 2936083002: [Extensions] Remove unsafe variants of CallModuleMethod (Closed)
Patch Set: . Created 3 years, 6 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/module_system.h ('k') | extensions/renderer/script_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 7fba82b3c1e816eb03385209f780eefc57671356..2349218a544884d9bd8b341915c78bcb5a4b8c03 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -285,42 +285,6 @@ v8::Local<v8::Value> ModuleSystem::RequireForJsInner(
return handle_scope.Escape(exports);
}
-v8::Local<v8::Value> ModuleSystem::CallModuleMethod(
- const std::string& module_name,
- const std::string& method_name,
- int argc,
- v8::Local<v8::Value> argv[]) {
- TRACE_EVENT2("v8",
- "v8.callModuleMethod",
- "module_name",
- module_name,
- "method_name",
- method_name);
-
- v8::EscapableHandleScope handle_scope(GetIsolate());
- v8::Local<v8::Context> v8_context = context()->v8_context();
- v8::Context::Scope context_scope(v8_context);
-
- v8::Local<v8::Function> function =
- GetModuleFunction(module_name, method_name);
- if (function.IsEmpty()) {
- NOTREACHED() << "GetModuleFunction() returns empty function handle";
- return handle_scope.Escape(v8::Undefined(GetIsolate()));
- }
-
- v8::Local<v8::Value> result;
- {
- v8::TryCatch try_catch(GetIsolate());
- try_catch.SetCaptureMessage(true);
- result = context_->CallFunction(function, argc, argv);
- if (try_catch.HasCaught()) {
- HandleException(try_catch);
- result = v8::Undefined(GetIsolate());
- }
- }
- return handle_scope.Escape(result);
-}
-
void ModuleSystem::CallModuleMethodSafe(const std::string& module_name,
const std::string& method_name) {
v8::HandleScope handle_scope(GetIsolate());
« no previous file with comments | « extensions/renderer/module_system.h ('k') | extensions/renderer/script_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698