| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/inspector/ScriptAsyncCallStack.h" | 5 #include "core/inspector/ScriptAsyncCallStack.h" |
| 6 | 6 |
| 7 namespace blink { | 7 namespace blink { |
| 8 | 8 |
| 9 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> ScriptAsyncCallStack::create(const
String& description, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, PassRefP
trWillBeRawPtr<ScriptAsyncCallStack> asyncStackTrace) | 9 PassRefPtr<ScriptAsyncCallStack> ScriptAsyncCallStack::create(const String& desc
ription, PassRefPtr<ScriptCallStack> callStack, PassRefPtr<ScriptAsyncCallStack>
asyncStackTrace) |
| 10 { | 10 { |
| 11 return adoptRefWillBeNoop(new ScriptAsyncCallStack(description, callStack, a
syncStackTrace)); | 11 return adoptRef(new ScriptAsyncCallStack(description, callStack, asyncStackT
race)); |
| 12 } | 12 } |
| 13 | 13 |
| 14 ScriptAsyncCallStack::ScriptAsyncCallStack(const String& description, PassRefPtr
WillBeRawPtr<ScriptCallStack> callStack, PassRefPtrWillBeRawPtr<ScriptAsyncCallS
tack> asyncStackTrace) | 14 ScriptAsyncCallStack::ScriptAsyncCallStack(const String& description, PassRefPtr
<ScriptCallStack> callStack, PassRefPtr<ScriptAsyncCallStack> asyncStackTrace) |
| 15 : m_description(description) | 15 : m_description(description) |
| 16 , m_callStack(callStack) | 16 , m_callStack(callStack) |
| 17 , m_asyncStackTrace(asyncStackTrace) | 17 , m_asyncStackTrace(asyncStackTrace) |
| 18 { | 18 { |
| 19 ASSERT(m_callStack); | 19 ASSERT(m_callStack); |
| 20 } | 20 } |
| 21 | 21 |
| 22 ScriptAsyncCallStack::~ScriptAsyncCallStack() | 22 ScriptAsyncCallStack::~ScriptAsyncCallStack() |
| 23 { | 23 { |
| 24 } | 24 } |
| 25 | 25 |
| 26 PassRefPtr<TypeBuilder::Console::AsyncStackTrace> ScriptAsyncCallStack::buildIns
pectorObject() const | 26 PassRefPtr<TypeBuilder::Console::AsyncStackTrace> ScriptAsyncCallStack::buildIns
pectorObject() const |
| 27 { | 27 { |
| 28 RefPtr<TypeBuilder::Console::AsyncStackTrace> result = TypeBuilder::Console:
:AsyncStackTrace::create() | 28 RefPtr<TypeBuilder::Console::AsyncStackTrace> result = TypeBuilder::Console:
:AsyncStackTrace::create() |
| 29 .setCallFrames(m_callStack->buildInspectorArray()) | 29 .setCallFrames(m_callStack->buildInspectorArray()) |
| 30 .release(); | 30 .release(); |
| 31 result->setDescription(m_description); | 31 result->setDescription(m_description); |
| 32 if (m_asyncStackTrace) | 32 if (m_asyncStackTrace) |
| 33 result->setAsyncStackTrace(m_asyncStackTrace->buildInspectorObject()); | 33 result->setAsyncStackTrace(m_asyncStackTrace->buildInspectorObject()); |
| 34 return result.release(); | 34 return result.release(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 DEFINE_TRACE(ScriptAsyncCallStack) | |
| 38 { | |
| 39 visitor->trace(m_callStack); | |
| 40 visitor->trace(m_asyncStackTrace); | |
| 41 } | |
| 42 | |
| 43 } // namespace blink | 37 } // namespace blink |
| OLD | NEW |