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

Unified Diff: extensions/renderer/module_system.cc

Issue 2556153002: [Extensions] Convert more callers of CallModuleMethod (Closed)
Patch Set: revert doc change Created 4 years 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 034291c629768026db87bea3ff8e16863265e5a7..3cdf194dbda91af6d7121038256c9dc76474a62a 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -285,15 +285,6 @@ v8::Local<v8::Value> ModuleSystem::RequireForJsInner(
v8::Local<v8::Value> ModuleSystem::CallModuleMethod(
const std::string& module_name,
- const std::string& method_name) {
- v8::EscapableHandleScope handle_scope(GetIsolate());
- v8::Local<v8::Value> no_args;
- return handle_scope.Escape(
- CallModuleMethod(module_name, method_name, 0, &no_args));
-}
-
-v8::Local<v8::Value> ModuleSystem::CallModuleMethod(
- const std::string& module_name,
const std::string& method_name,
int argc,
v8::Local<v8::Value> argv[]) {
@@ -332,20 +323,32 @@ void ModuleSystem::CallModuleMethodSafe(const std::string& module_name,
const std::string& method_name) {
v8::HandleScope handle_scope(GetIsolate());
v8::Local<v8::Value> no_args;
- CallModuleMethodSafe(module_name, method_name, 0, &no_args);
+ CallModuleMethodSafe(module_name, method_name, 0, &no_args,
+ ScriptInjectionCallback::CompleteCallback());
}
void ModuleSystem::CallModuleMethodSafe(
const std::string& module_name,
const std::string& method_name,
std::vector<v8::Local<v8::Value>>* args) {
- CallModuleMethodSafe(module_name, method_name, args->size(), args->data());
+ CallModuleMethodSafe(module_name, method_name, args->size(), args->data(),
+ ScriptInjectionCallback::CompleteCallback());
}
void ModuleSystem::CallModuleMethodSafe(const std::string& module_name,
const std::string& method_name,
int argc,
v8::Local<v8::Value> argv[]) {
+ CallModuleMethodSafe(module_name, method_name, argc, argv,
+ ScriptInjectionCallback::CompleteCallback());
+}
+
+void ModuleSystem::CallModuleMethodSafe(
+ const std::string& module_name,
+ const std::string& method_name,
+ int argc,
+ v8::Local<v8::Value> argv[],
+ const ScriptInjectionCallback::CompleteCallback& callback) {
TRACE_EVENT2("v8", "v8.callModuleMethodSafe", "module_name", module_name,
"method_name", method_name);
@@ -363,7 +366,7 @@ void ModuleSystem::CallModuleMethodSafe(const std::string& module_name,
{
v8::TryCatch try_catch(GetIsolate());
try_catch.SetCaptureMessage(true);
- context_->SafeCallFunction(function, argc, argv);
+ context_->SafeCallFunction(function, argc, argv, callback);
if (try_catch.HasCaught())
HandleException(try_catch);
}
« 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