OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 #define AsyncCallTracker_h | 32 #define AsyncCallTracker_h |
33 | 33 |
34 #include "core/inspector/InspectorDebuggerAgent.h" | 34 #include "core/inspector/InspectorDebuggerAgent.h" |
35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 class AsyncCallChain; | |
43 class Event; | 42 class Event; |
44 class EventListener; | 43 class EventListener; |
45 class EventTarget; | 44 class EventTarget; |
46 class ExecutionContext; | 45 class ExecutionContext; |
47 class ExecutionContextTask; | 46 class ExecutionContextTask; |
48 class FormData; | 47 class FormData; |
49 class HTTPHeaderMap; | 48 class HTTPHeaderMap; |
50 class InspectorDebuggerAgent; | 49 class InspectorDebuggerAgent; |
51 class KURL; | 50 class KURL; |
52 class MutationObserver; | 51 class MutationObserver; |
53 class ThreadableLoaderClient; | 52 class ThreadableLoaderClient; |
54 class XMLHttpRequest; | 53 class XMLHttpRequest; |
55 | 54 |
56 class AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<Asyn
cCallTracker>, public InspectorDebuggerAgent::AsyncCallTrackingListener { | 55 class AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<Asyn
cCallTracker>, public InspectorDebuggerAgent::AsyncCallTrackingListener { |
57 WTF_MAKE_NONCOPYABLE(AsyncCallTracker); | 56 WTF_MAKE_NONCOPYABLE(AsyncCallTracker); |
58 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AsyncCallTracker); | 57 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AsyncCallTracker); |
59 public: | 58 public: |
60 AsyncCallTracker(InspectorDebuggerAgent*, InstrumentingAgents*); | 59 AsyncCallTracker(InspectorDebuggerAgent*, InstrumentingAgents*); |
61 virtual ~AsyncCallTracker(); | 60 virtual ~AsyncCallTracker(); |
62 | 61 |
63 // InspectorDebuggerAgent::AsyncCallTrackingListener implementation: | 62 // InspectorDebuggerAgent::AsyncCallTrackingListener implementation: |
64 void asyncCallTrackingStateChanged(bool tracking) override; | 63 void asyncCallTrackingStateChanged(bool tracking) override; |
65 void resetAsyncCallChains() override; | 64 void resetAsyncOperations() override; |
66 | 65 |
67 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); | 66 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); |
68 void didRemoveTimer(ExecutionContext*, int timerId); | 67 void didRemoveTimer(ExecutionContext*, int timerId); |
69 bool willFireTimer(ExecutionContext*, int timerId); | 68 bool willFireTimer(ExecutionContext*, int timerId); |
70 void didFireTimer() { didFireAsyncCall(); }; | 69 void didFireTimer() { didFireAsyncCall(); }; |
71 | 70 |
72 void didRequestAnimationFrame(ExecutionContext*, int callbackId); | 71 void didRequestAnimationFrame(ExecutionContext*, int callbackId); |
73 void didCancelAnimationFrame(ExecutionContext*, int callbackId); | 72 void didCancelAnimationFrame(ExecutionContext*, int callbackId); |
74 bool willFireAnimationFrame(ExecutionContext*, int callbackId); | 73 bool willFireAnimationFrame(ExecutionContext*, int callbackId); |
75 void didFireAnimationFrame() { didFireAsyncCall(); }; | 74 void didFireAnimationFrame() { didFireAsyncCall(); }; |
(...skipping 22 matching lines...) Expand all Loading... |
98 void traceAsyncCallbackStarting(ExecutionContext*, int operationId); | 97 void traceAsyncCallbackStarting(ExecutionContext*, int operationId); |
99 void traceAsyncCallbackCompleted() { didFireAsyncCall(); }; | 98 void traceAsyncCallbackCompleted() { didFireAsyncCall(); }; |
100 | 99 |
101 void trace(Visitor*) override; | 100 void trace(Visitor*) override; |
102 | 101 |
103 class ExecutionContextData; | 102 class ExecutionContextData; |
104 | 103 |
105 private: | 104 private: |
106 void willHandleXHREvent(XMLHttpRequest*, Event*); | 105 void willHandleXHREvent(XMLHttpRequest*, Event*); |
107 | 106 |
108 void setCurrentAsyncCallChain(ExecutionContext*, int operationId); | 107 bool isKnownAsyncOperationId(ExecutionContext*, int operationId) const; |
| 108 void willFireAsyncCall(int operationId); |
109 void didFireAsyncCall(); | 109 void didFireAsyncCall(); |
110 | 110 |
111 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); | 111 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); |
112 | 112 |
113 using ExecutionContextDataMap = WillBeHeapHashMap<RawPtrWillBeMember<Executi
onContext>, OwnPtrWillBeMember<ExecutionContextData>>; | 113 using ExecutionContextDataMap = WillBeHeapHashMap<RawPtrWillBeMember<Executi
onContext>, OwnPtrWillBeMember<ExecutionContextData>>; |
114 ExecutionContextDataMap m_executionContextDataMap; | 114 ExecutionContextDataMap m_executionContextDataMap; |
115 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; | 115 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; |
116 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; | 116 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace blink | 119 } // namespace blink |
120 | 120 |
121 #endif // AsyncCallTracker_h | 121 #endif // AsyncCallTracker_h |
OLD | NEW |