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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 2823473002: Remove ScriptState::GetFromExtrasExports (Closed)
Patch Set: Rebase, remove unused var Created 3 years, 8 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 | « third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bddcca1dd1bd1eea89ad23b5aa57f97532224e43..f662e6455d188200ce076df02a2ef35bd46c8849 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -731,4 +731,21 @@ 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> 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, v8::Undefined(isolate),
+ num_args, args, isolate);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698