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