Index: third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp b/third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp |
index cd558cf23a850dd4518ff788e91690098e27b4b1..55d456deb73f9209f221f236a6bc05b9d46827f3 100644 |
--- a/third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp |
+++ b/third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp |
@@ -30,17 +30,23 @@ |
#include "core/inspector/ScriptCallStack.h" |
-#include "core/inspector/ScriptAsyncCallStack.h" |
#include "platform/TracedValue.h" |
namespace blink { |
PassRefPtr<ScriptCallStack> ScriptCallStack::create(Vector<ScriptCallFrame>& frames) |
{ |
- return adoptRef(new ScriptCallStack(frames)); |
+ return adoptRef(new ScriptCallStack(String(), frames, nullptr)); |
} |
-ScriptCallStack::ScriptCallStack(Vector<ScriptCallFrame>& frames) |
+PassRefPtr<ScriptCallStack> ScriptCallStack::create(const String& description, Vector<ScriptCallFrame>& frames, PassRefPtr<ScriptCallStack> parent) |
+{ |
+ return adoptRef(new ScriptCallStack(description, frames, parent)); |
+} |
+ |
+ScriptCallStack::ScriptCallStack(const String& description, Vector<ScriptCallFrame>& frames, PassRefPtr<ScriptCallStack> parent) |
+ : m_description(description) |
+ , m_parent(parent) |
{ |
m_frames.swap(frames); |
} |
@@ -55,27 +61,29 @@ const ScriptCallFrame &ScriptCallStack::at(size_t index) const |
return m_frames[index]; |
} |
-size_t ScriptCallStack::size() const |
+void ScriptCallStack::setParent(PassRefPtr<ScriptCallStack> parent) |
{ |
- return m_frames.size(); |
+ m_parent = parent; |
} |
-PassRefPtr<ScriptAsyncCallStack> ScriptCallStack::asyncCallStack() const |
-{ |
- return m_asyncCallStack; |
-} |
- |
-void ScriptCallStack::setAsyncCallStack(PassRefPtr<ScriptAsyncCallStack> asyncCallStack) |
+size_t ScriptCallStack::size() const |
{ |
- m_asyncCallStack = asyncCallStack; |
+ return m_frames.size(); |
} |
-PassRefPtr<TypeBuilder::Array<TypeBuilder::Console::CallFrame> > ScriptCallStack::buildInspectorArray() const |
+PassRefPtr<TypeBuilder::Runtime::StackTrace> ScriptCallStack::buildInspectorObject() const |
{ |
- RefPtr<TypeBuilder::Array<TypeBuilder::Console::CallFrame> > frames = TypeBuilder::Array<TypeBuilder::Console::CallFrame>::create(); |
+ RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::CallFrame>> frames = TypeBuilder::Array<TypeBuilder::Runtime::CallFrame>::create(); |
for (size_t i = 0; i < m_frames.size(); i++) |
frames->addItem(m_frames.at(i).buildInspectorObject()); |
- return frames; |
+ |
+ RefPtr<TypeBuilder::Runtime::StackTrace> stackTrace = TypeBuilder::Runtime::StackTrace::create() |
+ .setCallFrames(frames.release()); |
+ if (!m_description.isEmpty()) |
+ stackTrace->setDescription(m_description); |
+ if (m_parent) |
+ stackTrace->setParent(m_parent->buildInspectorObject()); |
+ return stackTrace; |
} |
void ScriptCallStack::toTracedValue(TracedValue* value, const char* name) const |