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/v8/V8DebuggerAgentImpl.h" | 9 #include "core/inspector/v8/V8DebuggerAgentImpl.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 ScriptState; | 17 class ScriptState; |
18 | 18 |
19 class V8AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<V8
AsyncCallTracker>, public ScriptState::Observer { | 19 class V8AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<V8
AsyncCallTracker>, public ScriptState::Observer { |
20 WTF_MAKE_NONCOPYABLE(V8AsyncCallTracker); | 20 WTF_MAKE_NONCOPYABLE(V8AsyncCallTracker); |
21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8AsyncCallTracker); | |
22 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8AsyncCallTracker); | 21 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8AsyncCallTracker); |
23 public: | 22 public: |
24 static PassOwnPtrWillBeRawPtr<V8AsyncCallTracker> create(V8DebuggerAgentImpl
* debuggerAgent) | 23 static PassOwnPtrWillBeRawPtr<V8AsyncCallTracker> create(V8DebuggerAgentImpl
* debuggerAgent) |
25 { | 24 { |
26 return adoptPtrWillBeNoop(new V8AsyncCallTracker(debuggerAgent)); | 25 return adoptPtrWillBeNoop(new V8AsyncCallTracker(debuggerAgent)); |
27 } | 26 } |
28 | 27 |
29 ~V8AsyncCallTracker(); | 28 ~V8AsyncCallTracker(); |
30 DECLARE_TRACE(); | 29 DECLARE_TRACE(); |
31 | 30 |
32 void asyncCallTrackingStateChanged(bool tracking); | 31 void asyncCallTrackingStateChanged(bool tracking); |
33 void resetAsyncOperations(); | 32 void resetAsyncOperations(); |
34 | 33 |
35 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id); | 34 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id); |
36 | 35 |
37 // ScriptState::Observer implementation: | 36 // ScriptState::Observer implementation: |
38 void willDisposeScriptState(ScriptState*) override; | 37 void willDisposeScriptState(ScriptState*) override; |
39 | 38 |
40 private: | 39 private: |
41 explicit V8AsyncCallTracker(V8DebuggerAgentImpl*); | 40 explicit V8AsyncCallTracker(V8DebuggerAgentImpl*); |
42 | 41 |
43 void didEnqueueV8AsyncTask(ScriptState*, const String& eventName, int id); | 42 void didEnqueueV8AsyncTask(ScriptState*, const String& eventName, int id); |
44 void willHandleV8AsyncTask(ScriptState*, const String& eventName, int id); | 43 void willHandleV8AsyncTask(ScriptState*, const String& eventName, int id); |
45 | 44 |
46 class V8ContextAsyncOperations; | 45 class V8ContextAsyncOperations; |
47 WillBeHeapHashMap<RefPtr<ScriptState>, OwnPtrWillBeMember<V8ContextAsyncOper
ations>> m_contextAsyncOperationMap; | 46 WillBeHeapHashMap<RefPtr<ScriptState>, OwnPtrWillBeMember<V8ContextAsyncOper
ations>> m_contextAsyncOperationMap; |
48 RawPtrWillBeMember<V8DebuggerAgentImpl> m_debuggerAgent; | 47 V8DebuggerAgentImpl* m_debuggerAgent; |
49 }; | 48 }; |
50 | 49 |
51 } // namespace blink | 50 } // namespace blink |
52 | 51 |
53 #endif // V8AsyncCallTracker_h | 52 #endif // V8AsyncCallTracker_h |
OLD | NEW |