Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: Source/core/inspector/AsyncCallStackTracker.h

Issue 383363002: DevTools: Fix async stacks instrumentation for XHRs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void didRemoveTimer(ExecutionContext*, int timerId); 85 void didRemoveTimer(ExecutionContext*, int timerId);
86 void willFireTimer(ExecutionContext*, int timerId); 86 void willFireTimer(ExecutionContext*, int timerId);
87 87
88 void didRequestAnimationFrame(ExecutionContext*, int callbackId, const Scrip tValue& callFrames); 88 void didRequestAnimationFrame(ExecutionContext*, int callbackId, const Scrip tValue& callFrames);
89 void didCancelAnimationFrame(ExecutionContext*, int callbackId); 89 void didCancelAnimationFrame(ExecutionContext*, int callbackId);
90 void willFireAnimationFrame(ExecutionContext*, int callbackId); 90 void willFireAnimationFrame(ExecutionContext*, int callbackId);
91 91
92 void didEnqueueEvent(EventTarget*, Event*, const ScriptValue& callFrames); 92 void didEnqueueEvent(EventTarget*, Event*, const ScriptValue& callFrames);
93 void didRemoveEvent(EventTarget*, Event*); 93 void didRemoveEvent(EventTarget*, Event*);
94 void willHandleEvent(EventTarget*, Event*, EventListener*, bool useCapture); 94 void willHandleEvent(EventTarget*, Event*, EventListener*, bool useCapture);
95
95 void willLoadXHR(XMLHttpRequest*, const ScriptValue& callFrames); 96 void willLoadXHR(XMLHttpRequest*, const ScriptValue& callFrames);
97 void didLoadXHR(XMLHttpRequest*);
96 98
97 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*, const Sc riptValue& callFrames); 99 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*, const Sc riptValue& callFrames);
98 bool hasEnqueuedMutationRecord(ExecutionContext*, MutationObserver*); 100 bool hasEnqueuedMutationRecord(ExecutionContext*, MutationObserver*);
99 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); 101 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*);
100 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); 102 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*);
101 103
102 void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*, c onst ScriptValue& callFrames); 104 void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*, c onst ScriptValue& callFrames);
103 void didKillAllExecutionContextTasks(ExecutionContext*); 105 void didKillAllExecutionContextTasks(ExecutionContext*);
104 void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask *); 106 void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask *);
105 107
106 void didEnqueueV8AsyncTask(ExecutionContext*, const String& eventName, int i d, const ScriptValue& callFrames); 108 void didEnqueueV8AsyncTask(ExecutionContext*, const String& eventName, int i d, const ScriptValue& callFrames);
107 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i d); 109 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i d);
108 110
109 void didFireAsyncCall(); 111 void didFireAsyncCall();
110 void clear(); 112 void clear();
111 113
112 private: 114 private:
113 void willHandleXHREvent(XMLHttpRequest*, EventTarget*, Event*); 115 void willHandleXHREvent(XMLHttpRequest*, Event*);
114 116
115 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c onst ScriptValue& callFrames); 117 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c onst ScriptValue& callFrames);
116 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtr<AsyncCallChain>) ; 118 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtr<AsyncCallChain>) ;
117 void clearCurrentAsyncCallChain(); 119 void clearCurrentAsyncCallChain();
118 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); 120 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned);
119 bool validateCallFrames(const ScriptValue& callFrames); 121 bool validateCallFrames(const ScriptValue& callFrames);
120 122
121 class ExecutionContextData; 123 class ExecutionContextData;
122 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); 124 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*);
123 125
124 unsigned m_maxAsyncCallStackDepth; 126 unsigned m_maxAsyncCallStackDepth;
125 RefPtr<AsyncCallChain> m_currentAsyncCallChain; 127 RefPtr<AsyncCallChain> m_currentAsyncCallChain;
126 unsigned m_nestedAsyncCallCount; 128 unsigned m_nestedAsyncCallCount;
127 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa taMap; 129 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa taMap;
128 ExecutionContextDataMap m_executionContextDataMap; 130 ExecutionContextDataMap m_executionContextDataMap;
129 }; 131 };
130 132
131 } // namespace WebCore 133 } // namespace WebCore
132 134
133 #endif // !defined(AsyncCallStackTracker_h) 135 #endif // !defined(AsyncCallStackTracker_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698