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 23 matching lines...) Expand all Loading... | |
34 #include "bindings/v8/ScriptValue.h" | 34 #include "bindings/v8/ScriptValue.h" |
35 #include "wtf/Deque.h" | 35 #include "wtf/Deque.h" |
36 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
37 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
39 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
40 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 class Event; | |
44 class EventListener; | 45 class EventListener; |
45 class EventTarget; | 46 class EventTarget; |
46 class ExecutionContext; | 47 class ExecutionContext; |
47 class MutationObserver; | 48 class MutationObserver; |
48 class XMLHttpRequest; | 49 class XMLHttpRequest; |
49 | 50 |
50 class AsyncCallStackTracker { | 51 class AsyncCallStackTracker { |
51 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); | 52 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); |
52 public: | 53 public: |
53 class AsyncCallStack : public RefCounted<AsyncCallStack> { | 54 class AsyncCallStack : public RefCounted<AsyncCallStack> { |
(...skipping 26 matching lines...) Expand all Loading... | |
80 const AsyncCallChain* currentAsyncCallChain() const; | 81 const AsyncCallChain* currentAsyncCallChain() const; |
81 | 82 |
82 void didInstallTimer(ExecutionContext*, int timerId, bool singleShot, const ScriptValue& callFrames); | 83 void didInstallTimer(ExecutionContext*, int timerId, bool singleShot, const ScriptValue& callFrames); |
83 void didRemoveTimer(ExecutionContext*, int timerId); | 84 void didRemoveTimer(ExecutionContext*, int timerId); |
84 void willFireTimer(ExecutionContext*, int timerId); | 85 void willFireTimer(ExecutionContext*, int timerId); |
85 | 86 |
86 void didRequestAnimationFrame(ExecutionContext*, int callbackId, const Scrip tValue& callFrames); | 87 void didRequestAnimationFrame(ExecutionContext*, int callbackId, const Scrip tValue& callFrames); |
87 void didCancelAnimationFrame(ExecutionContext*, int callbackId); | 88 void didCancelAnimationFrame(ExecutionContext*, int callbackId); |
88 void willFireAnimationFrame(ExecutionContext*, int callbackId); | 89 void willFireAnimationFrame(ExecutionContext*, int callbackId); |
89 | 90 |
90 void willHandleEvent(EventTarget*, const AtomicString& eventType, EventListe ner*, bool useCapture); | 91 void didEnqueueEvent(EventTarget*, Event*, const ScriptValue& callFrames); |
yurys
2014/06/16 11:52:15
Maybe call them did{Enqueue,Dispatch}AnimationEven
aandrey
2014/06/16 12:18:38
It will be reused for a few other events in next p
| |
92 void didDispatchEvent(EventTarget*, Event*); | |
93 void willHandleEvent(EventTarget*, Event*, EventListener*, bool useCapture); | |
91 void willLoadXHR(XMLHttpRequest*, const ScriptValue& callFrames); | 94 void willLoadXHR(XMLHttpRequest*, const ScriptValue& callFrames); |
92 | 95 |
93 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*, const Sc riptValue& callFrames); | 96 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*, const Sc riptValue& callFrames); |
94 bool hasEnqueuedMutationRecord(ExecutionContext*, MutationObserver*); | 97 bool hasEnqueuedMutationRecord(ExecutionContext*, MutationObserver*); |
95 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); | 98 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); |
96 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); | 99 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); |
97 | 100 |
98 void didFireAsyncCall(); | 101 void didFireAsyncCall(); |
99 void clear(); | 102 void clear(); |
100 | 103 |
101 private: | 104 private: |
102 void willHandleXHREvent(XMLHttpRequest*, EventTarget*, const AtomicString& e ventType); | 105 void willHandleXHREvent(XMLHttpRequest*, EventTarget*, Event*); |
103 | 106 |
104 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c onst ScriptValue& callFrames); | 107 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c onst ScriptValue& callFrames); |
105 void setCurrentAsyncCallChain(PassRefPtr<AsyncCallChain>); | 108 void setCurrentAsyncCallChain(PassRefPtr<AsyncCallChain>); |
106 void clearCurrentAsyncCallChain(); | 109 void clearCurrentAsyncCallChain(); |
107 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); | 110 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); |
108 static bool validateCallFrames(const ScriptValue& callFrames); | 111 static bool validateCallFrames(const ScriptValue& callFrames); |
109 | 112 |
110 class ExecutionContextData; | 113 class ExecutionContextData; |
111 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); | 114 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); |
112 | 115 |
113 unsigned m_maxAsyncCallStackDepth; | 116 unsigned m_maxAsyncCallStackDepth; |
114 RefPtr<AsyncCallChain> m_currentAsyncCallChain; | 117 RefPtr<AsyncCallChain> m_currentAsyncCallChain; |
115 unsigned m_nestedAsyncCallCount; | 118 unsigned m_nestedAsyncCallCount; |
116 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa taMap; | 119 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa taMap; |
117 ExecutionContextDataMap m_executionContextDataMap; | 120 ExecutionContextDataMap m_executionContextDataMap; |
118 }; | 121 }; |
119 | 122 |
120 } // namespace WebCore | 123 } // namespace WebCore |
121 | 124 |
122 #endif // !defined(AsyncCallStackTracker_h) | 125 #endif // !defined(AsyncCallStackTracker_h) |
OLD | NEW |