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 #ifndef AsyncCallChain_h | 5 #ifndef AsyncCallChain_h |
6 #define AsyncCallChain_h | 6 #define AsyncCallChain_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | |
9 #include "wtf/Deque.h" | 8 #include "wtf/Deque.h" |
10 #include "wtf/Forward.h" | 9 #include "wtf/Forward.h" |
11 #include "wtf/RefCounted.h" | 10 #include "wtf/RefCounted.h" |
| 11 #include "wtf/text/WTFString.h" |
12 #include <v8.h> | 12 #include <v8.h> |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class AsyncCallStack final : public RefCountedWillBeGarbageCollectedFinalized<As
yncCallStack> { | 16 class AsyncCallStack final : public RefCounted<AsyncCallStack> { |
17 public: | 17 public: |
18 AsyncCallStack(const String&, v8::Local<v8::Object>); | 18 AsyncCallStack(const String&, v8::Local<v8::Object>); |
19 ~AsyncCallStack(); | 19 ~AsyncCallStack(); |
20 DEFINE_INLINE_TRACE() { } | 20 |
21 String description() const { return m_description; } | 21 String description() const { return m_description; } |
22 v8::Local<v8::Object> callFrames(v8::Isolate* isolate) const { return v8::Lo
cal<v8::Object>::New(isolate, m_callFrames); } | 22 v8::Local<v8::Object> callFrames(v8::Isolate* isolate) const { return v8::Lo
cal<v8::Object>::New(isolate, m_callFrames); } |
23 private: | 23 private: |
24 String m_description; | 24 String m_description; |
25 v8::Global<v8::Object> m_callFrames; | 25 v8::Global<v8::Object> m_callFrames; |
26 }; | 26 }; |
27 | 27 |
28 using AsyncCallStackVector = WillBeHeapDeque<RefPtrWillBeMember<AsyncCallStack>,
4>; | 28 using AsyncCallStackVector = Deque<RefPtr<AsyncCallStack>, 4>; |
29 | 29 |
30 class AsyncCallChain final : public RefCountedWillBeGarbageCollectedFinalized<As
yncCallChain> { | 30 class AsyncCallChain final : public RefCounted<AsyncCallChain> { |
31 public: | 31 public: |
32 static PassRefPtrWillBeRawPtr<AsyncCallChain> create(PassRefPtrWillBeRawPtr<
AsyncCallStack>, AsyncCallChain* prevChain, unsigned asyncCallChainMaxLength); | 32 static PassRefPtr<AsyncCallChain> create(PassRefPtr<AsyncCallStack>, AsyncCa
llChain* prevChain, unsigned asyncCallChainMaxLength); |
33 ~AsyncCallChain(); | 33 ~AsyncCallChain(); |
34 const AsyncCallStackVector& callStacks() const { return m_callStacks; } | 34 const AsyncCallStackVector& callStacks() const { return m_callStacks; } |
35 DECLARE_TRACE(); | |
36 | 35 |
37 private: | 36 private: |
38 AsyncCallChain(PassRefPtrWillBeRawPtr<AsyncCallStack>, AsyncCallChain* prevC
hain, unsigned asyncCallChainMaxLength); | 37 AsyncCallChain(PassRefPtr<AsyncCallStack>, AsyncCallChain* prevChain, unsign
ed asyncCallChainMaxLength); |
39 | 38 |
40 AsyncCallStackVector m_callStacks; | 39 AsyncCallStackVector m_callStacks; |
41 }; | 40 }; |
42 | 41 |
43 } // namespace blink | 42 } // namespace blink |
44 | 43 |
45 | 44 |
46 #endif // !defined(AsyncCallChain_h) | 45 #endif // !defined(AsyncCallChain_h) |
OLD | NEW |