#define JavaScriptCallFrame_h
-#include "bindings/v8/ScopedPersistent.h"
-#include "bindings/v8/ScriptWrappable.h"
-#include <v8-debug.h>
+#include "bindings/core/v8/ScopedPersistent.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/ScriptWrappable.h"
#include "wtf/RefCounted.h"
#include "wtf/text/WTFString.h"
+#include <v8.h>
-namespace WebCore {
+namespace blink {
-class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame>, public ScriptWrappable {
+class ScriptValue;
+
+class JavaScriptCallFrame : public RefCountedWillBeGarbageCollectedFinalized<JavaScriptCallFrame>, public ScriptWrappable {
public:
- static PassRefPtr<JavaScriptCallFrame> create(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame)
+ static PassRefPtrWillBeRawPtr<JavaScriptCallFrame> create(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame)
{
- return adoptRef(new JavaScriptCallFrame(debuggerContext, callFrame));
+ return adoptRefWillBeNoop(new JavaScriptCallFrame(debuggerContext, callFrame));
}
~JavaScriptCallFrame();
+ void trace(Visitor*);
JavaScriptCallFrame* caller();
int sourceID() const;
int line() const;
int column() const;
+ String scriptName() const;
String functionName() const;
v8::Handle<v8::Value> scopeChain() const;
int scopeType(int scopeIndex) const;
v8::Handle<v8::Value> thisObject() const;
String stepInPositions() const;
+ bool isAtReturn() const;
+ v8::Handle<v8::Value> returnValue() const;
- v8::Handle<v8::Value> evaluate(const String& expression);
+ v8::Handle<v8::Value> evaluateWithExceptionDetails(const String& expression);
v8::Handle<v8::Value> restart();
- v8::Handle<v8::Value> setVariableValue(int scopeNumber, const String& variableName, v8::Handle<v8::Value> newValue);
- v8::Handle<v8::Object> innerCallFrame();
+ ScriptValue setVariableValue(ScriptState*, int scopeNumber, const String& variableName, const ScriptValue& newValue);
+
+ static v8::Handle<v8::Object> createExceptionDetails(v8::Handle<v8::Message>, v8::Isolate*);
private:
JavaScriptCallFrame(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame);
+ int callV8FunctionReturnInt(const char* name) const;
+ String callV8FunctionReturnString(const char* name) const;
+
v8::Isolate* m_isolate;
- RefPtr<JavaScriptCallFrame> m_caller;
+ RefPtrWillBeMember<JavaScriptCallFrame> m_caller;
ScopedPersistent<v8::Context> m_debuggerContext;
ScopedPersistent<v8::Object> m_callFrame;
};
-} // namespace WebCore
+} // namespace blink
#endif // JavaScriptCallFrame_h