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/core/v8/ScriptValue.h" | 34 #include "bindings/core/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 AsyncFileSystemCallbacks; |
44 class Event; | 45 class Event; |
45 class EventListener; | 46 class EventListener; |
46 class EventTarget; | 47 class EventTarget; |
47 class ExecutionContext; | 48 class ExecutionContext; |
48 class ExecutionContextTask; | 49 class ExecutionContextTask; |
49 class MutationObserver; | 50 class MutationObserver; |
50 class XMLHttpRequest; | 51 class XMLHttpRequest; |
51 | 52 |
52 class AsyncCallStackTracker { | 53 class AsyncCallStackTracker { |
53 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); | 54 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 97 |
97 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*, const Sc
riptValue& callFrames); | 98 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*, const Sc
riptValue& callFrames); |
98 bool hasEnqueuedMutationRecord(ExecutionContext*, MutationObserver*); | 99 bool hasEnqueuedMutationRecord(ExecutionContext*, MutationObserver*); |
99 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); | 100 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); |
100 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); | 101 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); |
101 | 102 |
102 void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*, c
onst ScriptValue& callFrames); | 103 void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*, c
onst ScriptValue& callFrames); |
103 void didKillAllExecutionContextTasks(ExecutionContext*); | 104 void didKillAllExecutionContextTasks(ExecutionContext*); |
104 void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask
*); | 105 void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask
*); |
105 | 106 |
| 107 void didEnqueueAsyncFileSystemCallback(ExecutionContext*, AsyncFileSystemCal
lbacks*, const ScriptValue& callFrames); |
| 108 void didRemoveAsyncFileSystemCallback(ExecutionContext*, AsyncFileSystemCall
backs*); |
| 109 void willHandleAsyncFileSystemCallback(ExecutionContext*, AsyncFileSystemCal
lbacks*, bool hasMore); |
| 110 |
106 void didEnqueueV8AsyncTask(ExecutionContext*, const String& eventName, int i
d, const ScriptValue& callFrames); | 111 void didEnqueueV8AsyncTask(ExecutionContext*, const String& eventName, int i
d, const ScriptValue& callFrames); |
107 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i
d); | 112 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i
d); |
108 | 113 |
| 114 void willRescheduleAsyncCallChain(); |
| 115 void didRescheduleAsyncCallChain(); |
| 116 |
109 void didFireAsyncCall(); | 117 void didFireAsyncCall(); |
110 void clear(); | 118 void clear(); |
111 | 119 |
112 private: | 120 private: |
113 void willHandleXHREvent(XMLHttpRequest*, EventTarget*, Event*); | 121 void willHandleXHREvent(XMLHttpRequest*, EventTarget*, Event*); |
114 | 122 |
115 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c
onst ScriptValue& callFrames); | 123 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c
onst ScriptValue& callFrames); |
116 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtr<AsyncCallChain>)
; | 124 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtr<AsyncCallChain>)
; |
117 void clearCurrentAsyncCallChain(); | 125 void clearCurrentAsyncCallChain(); |
118 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); | 126 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); |
119 bool validateCallFrames(const ScriptValue& callFrames); | 127 bool validateCallFrames(const ScriptValue& callFrames); |
120 | 128 |
121 class ExecutionContextData; | 129 class ExecutionContextData; |
122 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); | 130 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); |
123 | 131 |
124 unsigned m_maxAsyncCallStackDepth; | 132 unsigned m_maxAsyncCallStackDepth; |
125 RefPtr<AsyncCallChain> m_currentAsyncCallChain; | 133 RefPtr<AsyncCallChain> m_currentAsyncCallChain; |
126 unsigned m_nestedAsyncCallCount; | 134 unsigned m_nestedAsyncCallCount; |
| 135 bool m_rescheduleNextAsyncCallChain; |
| 136 RefPtr<AsyncCallChain> m_rescheduledAsyncCallChain; |
127 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa
taMap; | 137 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa
taMap; |
128 ExecutionContextDataMap m_executionContextDataMap; | 138 ExecutionContextDataMap m_executionContextDataMap; |
129 }; | 139 }; |
130 | 140 |
131 } // namespace WebCore | 141 } // namespace WebCore |
132 | 142 |
133 #endif // !defined(AsyncCallStackTracker_h) | 143 #endif // !defined(AsyncCallStackTracker_h) |
OLD | NEW |