OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef V8AsyncCallTracker_h | |
6 #define V8AsyncCallTracker_h | |
7 | |
8 #include "bindings/core/v8/ScriptState.h" | |
9 #include "core/inspector/V8DebuggerAgent.h" | |
10 #include "platform/heap/Handle.h" | |
11 #include "wtf/Forward.h" | |
12 #include "wtf/HashMap.h" | |
13 #include "wtf/Noncopyable.h" | |
14 | |
15 namespace blink { | |
16 | |
17 class ScriptState; | |
18 | |
19 class V8AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<V8
AsyncCallTracker>, public ScriptState::Observer, public V8DebuggerAgent::AsyncCa
llTrackingListener { | |
20 WTF_MAKE_NONCOPYABLE(V8AsyncCallTracker); | |
21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8AsyncCallTracker); | |
22 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8AsyncCallTracker); | |
23 public: | |
24 static PassOwnPtrWillBeRawPtr<V8AsyncCallTracker> create(V8DebuggerAgent* de
buggerAgent) | |
25 { | |
26 return adoptPtrWillBeNoop(new V8AsyncCallTracker(debuggerAgent)); | |
27 } | |
28 | |
29 ~V8AsyncCallTracker(); | |
30 DECLARE_TRACE(); | |
31 | |
32 // V8DebuggerAgent::AsyncCallTrackingListener implementation: | |
33 void asyncCallTrackingStateChanged(bool tracking) override; | |
34 void resetAsyncOperations() override; | |
35 | |
36 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id); | |
37 | |
38 // ScriptState::Observer implementation: | |
39 void willDisposeScriptState(ScriptState*) override; | |
40 | |
41 private: | |
42 explicit V8AsyncCallTracker(V8DebuggerAgent*); | |
43 | |
44 void didEnqueueV8AsyncTask(ScriptState*, const String& eventName, int id); | |
45 void willHandleV8AsyncTask(ScriptState*, const String& eventName, int id); | |
46 | |
47 class V8ContextAsyncOperations; | |
48 WillBeHeapHashMap<RefPtr<ScriptState>, OwnPtrWillBeMember<V8ContextAsyncOper
ations>> m_contextAsyncOperationMap; | |
49 RawPtrWillBeMember<V8DebuggerAgent> m_debuggerAgent; | |
50 }; | |
51 | |
52 } // namespace blink | |
53 | |
54 #endif // V8AsyncCallTracker_h | |
OLD | NEW |