Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / inspector / JavaScriptCallFrame.h
index ac0c035..2eb05d3 100644 (file)
 #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 ScriptValue;
 
-class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame>, public ScriptWrappable {
+class JavaScriptCallFrame : public RefCountedWillBeGarbageCollectedFinalized<JavaScriptCallFrame>, public ScriptWrappable {
+    DEFINE_WRAPPERTYPEINFO();
 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;
@@ -64,21 +68,24 @@ public:
     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();
-    ScriptValue setVariableValue(int scopeNumber, const String& variableName, const ScriptValue& 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