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 AsyncCallStack::AsyncCallStack(const String& description, v8::Local<v8::Object>
callFrames) | 12 AsyncCallStack::AsyncCallStack(const String& description, v8::Local<v8::Object>
callFrames) |
13 : m_description(description) | 13 : m_description(description) |
14 , m_callFrames(callFrames->GetIsolate(), callFrames) | 14 , m_callFrames(callFrames->GetIsolate(), callFrames) |
15 { | 15 { |
16 } | 16 } |
17 | 17 |
18 AsyncCallStack::~AsyncCallStack() | 18 AsyncCallStack::~AsyncCallStack() |
19 { | 19 { |
20 } | 20 } |
21 | 21 |
22 PassRefPtr<AsyncCallChain> AsyncCallChain::create(PassRefPtr<AsyncCallStack> sta
ck, AsyncCallChain* prevChain, unsigned asyncCallChainMaxLength) | 22 PassRefPtr<AsyncCallChain> AsyncCallChain::create(v8::Local<v8::Context> creatio
nContext, PassRefPtr<AsyncCallStack> stack, AsyncCallChain* prevChain, unsigned
asyncCallChainMaxLength) |
23 { | 23 { |
24 return adoptRef(new AsyncCallChain(stack, prevChain, asyncCallChainMaxLength
)); | 24 return adoptRef(new AsyncCallChain(creationContext, stack, prevChain, asyncC
allChainMaxLength)); |
25 } | 25 } |
26 | 26 |
27 AsyncCallChain::AsyncCallChain(PassRefPtr<AsyncCallStack> stack, AsyncCallChain*
prevChain, unsigned asyncCallChainMaxLength) | 27 AsyncCallChain::AsyncCallChain(v8::Local<v8::Context> creationContext, PassRefPt
r<AsyncCallStack> stack, AsyncCallChain* prevChain, unsigned asyncCallChainMaxLe
ngth) |
28 { | 28 { |
| 29 m_creationContext.Reset(creationContext->GetIsolate(), creationContext); |
29 if (stack) | 30 if (stack) |
30 m_callStacks.append(stack); | 31 m_callStacks.append(stack); |
31 if (prevChain) { | 32 if (prevChain) { |
32 const AsyncCallStackVector& other = prevChain->m_callStacks; | 33 const AsyncCallStackVector& other = prevChain->m_callStacks; |
33 for (size_t i = 0; i < other.size() && m_callStacks.size() < asyncCallCh
ainMaxLength; i++) | 34 for (size_t i = 0; i < other.size() && m_callStacks.size() < asyncCallCh
ainMaxLength; i++) |
34 m_callStacks.append(other[i]); | 35 m_callStacks.append(other[i]); |
35 } | 36 } |
36 } | 37 } |
37 | 38 |
38 AsyncCallChain::~AsyncCallChain() | 39 AsyncCallChain::~AsyncCallChain() |
39 { | 40 { |
40 } | 41 } |
41 | 42 |
42 } // namespace blink | 43 } // namespace blink |
OLD | NEW |