Index: extensions/renderer/module_system.cc |
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc |
index a8e3bdb07e23bb8a6f340ba30d965b36e425cd84..e576c384ce1ed37b49ac21a61a359bebe94fac3b 100644 |
--- a/extensions/renderer/module_system.cc |
+++ b/extensions/renderer/module_system.cc |
@@ -284,15 +284,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[]) { |
@@ -331,20 +322,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); |
@@ -362,7 +365,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); |
} |