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

Unified Diff: Source/core/inspector/JavaScriptCallFrame.cpp

Issue 136333007: DevTools: Implement evaluation on async call frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
Index: Source/core/inspector/JavaScriptCallFrame.cpp
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index 38032cc9fb624ab4345e99419a6bc538f516ca03..2166665db10071a4b42129e3283fd3fab1bd11c3 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -143,12 +143,25 @@ v8::Handle<v8::Value> JavaScriptCallFrame::returnValue() const
return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "returnValue"));
}
-v8::Handle<v8::Value> JavaScriptCallFrame::evaluate(const String& expression)
+ScriptValue JavaScriptCallFrame::evaluate(const String& expression, const ScriptValue& contextExtension)
+{
+ return runEvaluate("evaluate", expression, contextExtension);
+}
+
+ScriptValue JavaScriptCallFrame::evaluateGlobal(const String& expression, const ScriptValue& contextExtension)
+{
+ return runEvaluate("evaluateGlobal", expression, contextExtension);
+}
+
+ScriptValue JavaScriptCallFrame::runEvaluate(const char* methodName, const String& expression, const ScriptValue& contextExtension)
{
v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
- v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "evaluate")));
- v8::Handle<v8::Value> argv[] = { v8String(m_debuggerContext.newLocal(m_isolate)->GetIsolate(), expression) };
- return evalFunction->Call(callFrame, 1, argv);
+ v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, methodName)));
+ v8::Handle<v8::Value> argv[] = {
+ v8String(m_debuggerContext.newLocal(m_isolate)->GetIsolate(), expression),
+ contextExtension.v8Value()
+ };
+ return ScriptValue(evalFunction->Call(callFrame, 2, argv), m_isolate);
yurys 2014/01/21 11:56:52 Please use WTF_ARRAY_LENGTH
aandrey 2014/01/21 13:30:22 Done.
}
v8::Handle<v8::Value> JavaScriptCallFrame::restart()

Powered by Google App Engine
This is Rietveld 408576698