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/V8AsyncCallTracker.h" | 6 #include "core/inspector/V8AsyncCallTracker.h" |
7 | 7 |
8 #include "bindings/core/v8/V8PerContextData.h" | 8 #include "bindings/core/v8/V8PerContextData.h" |
9 #include "core/inspector/AsyncCallChainMap.h" | 9 #include "core/inspector/AsyncCallChainMap.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 WTF_MAKE_NONCOPYABLE(V8ContextAsyncCallChains); | 27 WTF_MAKE_NONCOPYABLE(V8ContextAsyncCallChains); |
28 public: | 28 public: |
29 explicit V8ContextAsyncCallChains(InspectorDebuggerAgent* debuggerAgent) | 29 explicit V8ContextAsyncCallChains(InspectorDebuggerAgent* debuggerAgent) |
30 : m_v8AsyncCallChains(debuggerAgent) | 30 : m_v8AsyncCallChains(debuggerAgent) |
31 { | 31 { |
32 } | 32 } |
33 | 33 |
34 ~V8ContextAsyncCallChains() | 34 ~V8ContextAsyncCallChains() |
35 { | 35 { |
36 // FIXME: get rid of the dispose method and this class altogether once A syncCallChainMap is always allocated on C++ heap. | 36 // FIXME: get rid of the dispose method and this class altogether once A syncCallChainMap is always allocated on C++ heap. |
37 m_v8AsyncCallChains.dispose(); | 37 m_v8AsyncCallChains.dispose(); |
haraken
2014/12/25 23:55:09
Not related to this CL, it looks unsafe to touch m
sof
2014/12/26 07:19:25
Yes, there needs to be a dispose()/reset() call fr
| |
38 } | 38 } |
39 | 39 |
40 void trace(Visitor* visitor) | 40 void trace(Visitor* visitor) |
41 { | 41 { |
42 #if ENABLE(OILPAN) | 42 #if ENABLE(OILPAN) |
43 visitor->trace(m_v8AsyncCallChains); | 43 visitor->trace(m_v8AsyncCallChains); |
44 #endif | 44 #endif |
45 } | 45 } |
46 | 46 |
47 AsyncCallChainMap<String> m_v8AsyncCallChains; | 47 AsyncCallChainMap<String> m_v8AsyncCallChains; |
(...skipping 16 matching lines...) Expand all Loading... | |
64 { | 64 { |
65 ASSERT(m_contextAsyncCallChainMap.isEmpty()); | 65 ASSERT(m_contextAsyncCallChainMap.isEmpty()); |
66 } | 66 } |
67 | 67 |
68 void V8AsyncCallTracker::trace(Visitor* visitor) | 68 void V8AsyncCallTracker::trace(Visitor* visitor) |
69 { | 69 { |
70 #if ENABLE(OILPAN) | 70 #if ENABLE(OILPAN) |
71 visitor->trace(m_contextAsyncCallChainMap); | 71 visitor->trace(m_contextAsyncCallChainMap); |
72 visitor->trace(m_debuggerAgent); | 72 visitor->trace(m_debuggerAgent); |
73 #endif | 73 #endif |
74 InspectorDebuggerAgent::AsyncCallTrackingListener::trace(visitor); | |
74 } | 75 } |
75 | 76 |
76 void V8AsyncCallTracker::asyncCallTrackingStateChanged(bool) | 77 void V8AsyncCallTracker::asyncCallTrackingStateChanged(bool) |
77 { | 78 { |
78 } | 79 } |
79 | 80 |
80 void V8AsyncCallTracker::resetAsyncCallChains() | 81 void V8AsyncCallTracker::resetAsyncCallChains() |
81 { | 82 { |
82 for (auto& it : m_contextAsyncCallChainMap) | 83 for (auto& it : m_contextAsyncCallChainMap) |
83 it.key->removeObserver(this); | 84 it.key->removeObserver(this); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 if (V8ContextAsyncCallChains* contextCallChains = m_contextAsyncCallChainMap .get(state)) { | 123 if (V8ContextAsyncCallChains* contextCallChains = m_contextAsyncCallChainMap .get(state)) { |
123 String taskId = makeV8AsyncTaskUniqueId(eventName, id); | 124 String taskId = makeV8AsyncTaskUniqueId(eventName, id); |
124 m_debuggerAgent->setCurrentAsyncCallChain(state->isolate(), contextCallC hains->m_v8AsyncCallChains.get(taskId)); | 125 m_debuggerAgent->setCurrentAsyncCallChain(state->isolate(), contextCallC hains->m_v8AsyncCallChains.get(taskId)); |
125 contextCallChains->m_v8AsyncCallChains.remove(taskId); | 126 contextCallChains->m_v8AsyncCallChains.remove(taskId); |
126 } else { | 127 } else { |
127 m_debuggerAgent->setCurrentAsyncCallChain(state->isolate(), nullptr); | 128 m_debuggerAgent->setCurrentAsyncCallChain(state->isolate(), nullptr); |
128 } | 129 } |
129 } | 130 } |
130 | 131 |
131 } // namespace blink | 132 } // namespace blink |
OLD | NEW |