Chromium Code Reviews| 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..e82eb32b412c3ce2c6bc4588fb1c4605d4c48e65 100644 |
| --- a/third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp |
| @@ -30,19 +30,25 @@ |
| #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_frames.swap(frames); |
| + m_description = description; |
|
dgozman
2016/02/04 01:43:06
nit: use initializer syntax
pfeldman
2016/02/04 03:15:59
Done.
|
| + m_parent = parent; |
| } |
| ScriptCallStack::~ScriptCallStack() |
| @@ -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 |