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 V8AsyncCallTracker_h | 5 #ifndef V8AsyncCallTracker_h |
6 #define V8AsyncCallTracker_h | 6 #define V8AsyncCallTracker_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "core/inspector/InspectorDebuggerAgent.h" | 9 #include "core/inspector/InspectorDebuggerAgent.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
12 #include "wtf/HashMap.h" | 12 #include "wtf/HashMap.h" |
13 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class InspectorDebuggerAgent; | 17 class InspectorDebuggerAgent; |
18 class ScriptState; | 18 class ScriptState; |
19 | 19 |
20 class V8AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<V8
AsyncCallTracker>, public ScriptState::Observer, public InspectorDebuggerAgent::
AsyncCallTrackingListener { | 20 class V8AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<V8
AsyncCallTracker>, public ScriptState::Observer, public InspectorDebuggerAgent::
AsyncCallTrackingListener { |
21 WTF_MAKE_NONCOPYABLE(V8AsyncCallTracker); | 21 WTF_MAKE_NONCOPYABLE(V8AsyncCallTracker); |
| 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8AsyncCallTracker); |
22 public: | 23 public: |
23 explicit V8AsyncCallTracker(InspectorDebuggerAgent*); | 24 explicit V8AsyncCallTracker(InspectorDebuggerAgent*); |
24 ~V8AsyncCallTracker(); | 25 ~V8AsyncCallTracker(); |
25 void trace(Visitor*); | 26 void trace(Visitor*); |
26 | 27 |
27 // InspectorDebuggerAgent::AsyncCallTrackingListener implementation: | 28 // InspectorDebuggerAgent::AsyncCallTrackingListener implementation: |
28 void asyncCallTrackingStateChanged(bool tracking) override; | 29 void asyncCallTrackingStateChanged(bool tracking) override; |
29 void resetAsyncCallChains() override; | 30 void resetAsyncCallChains() override; |
30 | 31 |
31 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id); | 32 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id); |
32 | 33 |
33 // ScriptState::Observer implementation: | 34 // ScriptState::Observer implementation: |
34 void willDisposeScriptState(ScriptState*) override; | 35 void willDisposeScriptState(ScriptState*) override; |
35 | 36 |
36 private: | 37 private: |
37 void didEnqueueV8AsyncTask(ScriptState*, const String& eventName, int id); | 38 void didEnqueueV8AsyncTask(ScriptState*, const String& eventName, int id); |
38 void willHandleV8AsyncTask(ScriptState*, const String& eventName, int id); | 39 void willHandleV8AsyncTask(ScriptState*, const String& eventName, int id); |
39 | 40 |
40 class V8ContextAsyncCallChains; | 41 class V8ContextAsyncCallChains; |
41 using V8ContextAsyncChainMap = WillBeHeapHashMap<ScriptState*, OwnPtrWillBeM
ember<V8ContextAsyncCallChains> >; | 42 using V8ContextAsyncChainMap = WillBeHeapHashMap<ScriptState*, OwnPtrWillBeM
ember<V8ContextAsyncCallChains> >; |
42 V8ContextAsyncChainMap m_contextAsyncCallChainMap; | 43 V8ContextAsyncChainMap m_contextAsyncCallChainMap; |
43 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; | 44 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; |
44 }; | 45 }; |
45 | 46 |
46 } // namespace blink | 47 } // namespace blink |
47 | 48 |
48 #endif // V8AsyncCallTracker_h | 49 #endif // V8AsyncCallTracker_h |
OLD | NEW |