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 "config.h" | 5 #include "config.h" |
6 #include "core/inspector/AsyncCallChain.h" | 6 #include "core/inspector/AsyncCallChain.h" |
7 | 7 |
8 #include "wtf/text/WTFString.h" | 8 #include "wtf/text/WTFString.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 DEFINE_TRACE(AsyncCallChain) | |
13 { | |
14 visitor->trace(m_callStacks); | |
15 } | |
16 | |
17 AsyncCallStack::AsyncCallStack(const String& description, v8::Local<v8::Object>
callFrames) | 12 AsyncCallStack::AsyncCallStack(const String& description, v8::Local<v8::Object>
callFrames) |
18 : m_description(description) | 13 : m_description(description) |
19 , m_callFrames(callFrames->GetIsolate(), callFrames) | 14 , m_callFrames(callFrames->GetIsolate(), callFrames) |
20 { | 15 { |
21 } | 16 } |
22 | 17 |
23 AsyncCallStack::~AsyncCallStack() | 18 AsyncCallStack::~AsyncCallStack() |
24 { | 19 { |
25 } | 20 } |
26 | 21 |
27 PassRefPtrWillBeRawPtr<AsyncCallChain> AsyncCallChain::create(PassRefPtrWillBeRa
wPtr<AsyncCallStack> stack, AsyncCallChain* prevChain, unsigned asyncCallChainMa
xLength) | 22 PassRefPtr<AsyncCallChain> AsyncCallChain::create(PassRefPtr<AsyncCallStack> sta
ck, AsyncCallChain* prevChain, unsigned asyncCallChainMaxLength) |
28 { | 23 { |
29 return adoptRefWillBeNoop(new AsyncCallChain(stack, prevChain, asyncCallChai
nMaxLength)); | 24 return adoptRef(new AsyncCallChain(stack, prevChain, asyncCallChainMaxLength
)); |
30 } | 25 } |
31 | 26 |
32 AsyncCallChain::AsyncCallChain(PassRefPtrWillBeRawPtr<AsyncCallStack> stack, Asy
ncCallChain* prevChain, unsigned asyncCallChainMaxLength) | 27 AsyncCallChain::AsyncCallChain(PassRefPtr<AsyncCallStack> stack, AsyncCallChain*
prevChain, unsigned asyncCallChainMaxLength) |
33 { | 28 { |
34 if (stack) | 29 if (stack) |
35 m_callStacks.append(stack); | 30 m_callStacks.append(stack); |
36 if (prevChain) { | 31 if (prevChain) { |
37 const AsyncCallStackVector& other = prevChain->m_callStacks; | 32 const AsyncCallStackVector& other = prevChain->m_callStacks; |
38 for (size_t i = 0; i < other.size() && m_callStacks.size() < asyncCallCh
ainMaxLength; i++) | 33 for (size_t i = 0; i < other.size() && m_callStacks.size() < asyncCallCh
ainMaxLength; i++) |
39 m_callStacks.append(other[i]); | 34 m_callStacks.append(other[i]); |
40 } | 35 } |
41 } | 36 } |
42 | 37 |
43 AsyncCallChain::~AsyncCallChain() | 38 AsyncCallChain::~AsyncCallChain() |
44 { | 39 { |
45 } | 40 } |
46 | 41 |
47 } // namespace blink | 42 } // namespace blink |
OLD | NEW |