| Index: extensions/renderer/script_context.cc
|
| diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc
|
| index 256381e1b839e2f5348e0c676f8efad11303481a..431bb4de8b6eaa45334d41168a55f14ffb440817 100644
|
| --- a/extensions/renderer/script_context.cc
|
| +++ b/extensions/renderer/script_context.cc
|
| @@ -180,29 +180,6 @@ content::RenderFrame* ScriptContext::GetRenderFrame() const {
|
| return NULL;
|
| }
|
|
|
| -v8::Local<v8::Value> ScriptContext::CallFunction(
|
| - const v8::Local<v8::Function>& function,
|
| - int argc,
|
| - v8::Local<v8::Value> argv[]) const {
|
| - DCHECK(thread_checker_.CalledOnValidThread());
|
| - v8::EscapableHandleScope handle_scope(isolate());
|
| - v8::Context::Scope scope(v8_context());
|
| -
|
| - v8::MicrotasksScope microtasks(
|
| - isolate(), v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| - if (!is_valid_) {
|
| - return handle_scope.Escape(
|
| - v8::Local<v8::Primitive>(v8::Undefined(isolate())));
|
| - }
|
| -
|
| - v8::Local<v8::Object> global = v8_context()->Global();
|
| - if (!web_frame_)
|
| - return handle_scope.Escape(function->Call(global, argc, argv));
|
| - return handle_scope.Escape(
|
| - v8::Local<v8::Value>(web_frame_->CallFunctionEvenIfScriptDisabled(
|
| - function, global, argc, argv)));
|
| -}
|
| -
|
| void ScriptContext::SafeCallFunction(const v8::Local<v8::Function>& function,
|
| int argc,
|
| v8::Local<v8::Value> argv[]) {
|
| @@ -530,4 +507,27 @@ gin::ContextHolder* ScriptContext::Runner::GetContextHolder() {
|
| return gin::PerContextData::From(context_->v8_context())->context_holder();
|
| }
|
|
|
| +v8::Local<v8::Value> ScriptContext::CallFunction(
|
| + const v8::Local<v8::Function>& function,
|
| + int argc,
|
| + v8::Local<v8::Value> argv[]) const {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + v8::EscapableHandleScope handle_scope(isolate());
|
| + v8::Context::Scope scope(v8_context());
|
| +
|
| + v8::MicrotasksScope microtasks(isolate(),
|
| + v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| + if (!is_valid_) {
|
| + return handle_scope.Escape(
|
| + v8::Local<v8::Primitive>(v8::Undefined(isolate())));
|
| + }
|
| +
|
| + v8::Local<v8::Object> global = v8_context()->Global();
|
| + if (!web_frame_)
|
| + return handle_scope.Escape(function->Call(global, argc, argv));
|
| + return handle_scope.Escape(
|
| + v8::Local<v8::Value>(web_frame_->CallFunctionEvenIfScriptDisabled(
|
| + function, global, argc, argv)));
|
| +}
|
| +
|
| } // namespace extensions
|
|
|