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

Unified Diff: Source/bindings/v8/ScheduledAction.cpp

Issue 24758003: ScriptController: limit script execution API to executeScript and callFunction, pass valid ScriptEx… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/ ScheduledAction executing in given context. Created 7 years, 3 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 | « Source/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/ScriptController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScheduledAction.cpp
diff --git a/Source/bindings/v8/ScheduledAction.cpp b/Source/bindings/v8/ScheduledAction.cpp
index e4780f8a1c4f9f82fcf89132b5450f6adba99443..41074ba02464481191fc31a87902bea2633d236e 100644
--- a/Source/bindings/v8/ScheduledAction.cpp
+++ b/Source/bindings/v8/ScheduledAction.cpp
@@ -90,16 +90,17 @@ void ScheduledAction::execute(Frame* frame)
v8::Handle<v8::Context> context = m_context.newLocal(m_isolate);
if (context.IsEmpty())
return;
- v8::Context::Scope scope(context);
TRACE_EVENT0("v8", "ScheduledAction::execute");
if (!m_function.isEmpty()) {
+ v8::Context::Scope scope(context);
Vector<v8::Handle<v8::Value> > args;
createLocalHandlesForArgs(&args);
frame->script()->callFunction(m_function.newLocal(m_isolate), context->Global(), args.size(), args.data());
- } else
- frame->script()->compileAndRunScript(m_code);
+ } else {
+ frame->script()->executeScriptAndReturnValue(context, ScriptSourceCode(m_code));
+ }
// The frame might be invalid at this point because JavaScript could have released it.
}
« no previous file with comments | « Source/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/ScriptController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698