OSDN Git Service

Merge WebKit at r71558: Initial merge by git.
[android-x86/external-webkit.git] / WebCore / inspector / ScriptCallStack.h
similarity index 66%
rename from WebCore/bindings/js/ScriptCallStack.h
rename to WebCore/inspector/ScriptCallStack.h
index 17d1c46..54c6bba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Google Inc. All rights reserved.
+ * Copyright (c) 2008, 2010 Google Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
 #define ScriptCallStack_h
 
 #include "ScriptCallFrame.h"
-#include "ScriptState.h"
 #include <wtf/Noncopyable.h>
-#include <wtf/RefPtr.h>
-
-namespace JSC {
-    class ExecState;
-    class JSValue;
-}
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
-    class InspectorArray;
+class InspectorArray;
+
+class ScriptCallStack : public Noncopyable {
+public:
+    static const size_t maxCallStackSizeToCapture = 200;
 
-    class ScriptCallStack : public Noncopyable {
-    public:
-        ScriptCallStack(JSC::ExecState*, unsigned skipArgumentCount = 0);
-        ~ScriptCallStack();
+    ScriptCallStack(Vector<ScriptCallFrame>&);
+    ~ScriptCallStack();
 
-        ScriptState* state() const { return m_exec; }
-        ScriptState* globalState() const { return m_exec->lexicalGlobalObject()->globalExec(); }
-        // frame retrieval methods
-        const ScriptCallFrame &at(unsigned);
-        unsigned size();
-        static bool stackTrace(int, const RefPtr<InspectorArray>&);
+    const ScriptCallFrame &at(size_t);
+    size_t size();
+    static bool stackTrace(int, const RefPtr<InspectorArray>&);
 
-    private:
-        void initialize();
-        bool m_initialized;
+    bool isEqual(ScriptCallStack*) const;
+    PassRefPtr<InspectorArray> buildInspectorObject() const;
 
-        JSC::ExecState* m_exec;
-        Vector<ScriptCallFrame> m_frames;
-        JSC::JSFunction* m_caller;
-    };
+private:
+    Vector<ScriptCallFrame> m_frames;
+};
 
 } // namespace WebCore