Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| index a508c26b2408aba05e39358f4299f7b34c4fb971..179dcd088d3d34e6be1e055b93b62cf44b9d0695 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| @@ -729,4 +729,22 @@ void V8ScriptRunner::ThrowException(v8::Isolate* isolate, |
| CallInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); |
| } |
| +v8::MaybeLocal<v8::Value> V8ScriptRunner::CallExtraHelper( |
| + ScriptState* script_state, |
| + const char* name, |
| + size_t num_args, |
| + v8::Local<v8::Value>* args) { |
| + v8::Isolate* isolate = script_state->GetIsolate(); |
| + v8::Local<v8::Value> undefined = v8::Undefined(isolate); |
|
haraken
2017/04/13 22:55:44
Nit: This variable looks redundant.
adithyas
2017/04/18 15:28:12
Yup, removed.
|
| + v8::Local<v8::Value> function_value; |
| + v8::Local<v8::Context> context = script_state->GetContext(); |
| + if (!context->GetExtrasBindingObject() |
| + ->Get(context, V8AtomicString(isolate, name)) |
| + .ToLocal(&function_value)) |
| + return v8::MaybeLocal<v8::Value>(); |
| + v8::Local<v8::Function> function = function_value.As<v8::Function>(); |
| + return V8ScriptRunner::CallInternalFunction(function, undefined, num_args, |
| + args, isolate); |
| +} |
| + |
| } // namespace blink |