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

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

Issue 1179903003: [DevTools] Log failed XHR requests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void didFinishLoading(unsigned long identifier, double monotonicFinishTime, int64_t encodedDataLength); 89 void didFinishLoading(unsigned long identifier, double monotonicFinishTime, int64_t encodedDataLength);
90 void didReceiveCORSRedirectResponse(LocalFrame*, unsigned long identifier, D ocumentLoader*, const ResourceResponse&, ResourceLoader*); 90 void didReceiveCORSRedirectResponse(LocalFrame*, unsigned long identifier, D ocumentLoader*, const ResourceResponse&, ResourceLoader*);
91 void didFailLoading(unsigned long identifier, const ResourceError&); 91 void didFailLoading(unsigned long identifier, const ResourceError&);
92 void didCommitLoad(LocalFrame*, DocumentLoader*); 92 void didCommitLoad(LocalFrame*, DocumentLoader*);
93 void scriptImported(unsigned long identifier, const String& sourceString); 93 void scriptImported(unsigned long identifier, const String& sourceString);
94 void didReceiveScriptResponse(unsigned long identifier); 94 void didReceiveScriptResponse(unsigned long identifier);
95 bool shouldForceCORSPreflight(); 95 bool shouldForceCORSPreflight();
96 96
97 void documentThreadableLoaderStartedLoadingForClient(unsigned long identifie r, ThreadableLoaderClient*); 97 void documentThreadableLoaderStartedLoadingForClient(unsigned long identifie r, ThreadableLoaderClient*);
98 void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicStrin g& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderM ap& headers, bool includeCrendentials); 98 void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicStrin g& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderM ap& headers, bool includeCrendentials);
99 void didFailXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*); 99 void didFailXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoaderC lient*, const AtomicString&, const String&);
100 void didFinishXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoade rClient*, unsigned long identifier, ScriptString sourceString, const AtomicStrin g&, const String&); 100 void didFinishXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoade rClient*, const AtomicString&, const String&);
101 101
102 void willSendEventSourceRequest(ThreadableLoaderClient*); 102 void willSendEventSourceRequest(ThreadableLoaderClient*);
103 void willDispachEventSourceEvent(ThreadableLoaderClient*, const AtomicString & eventName, const AtomicString& eventId, const Vector<UChar>& data); 103 void willDispachEventSourceEvent(ThreadableLoaderClient*, const AtomicString & eventName, const AtomicString& eventId, const Vector<UChar>& data);
104 void didFinishEventSourceRequest(ThreadableLoaderClient*); 104 void didFinishEventSourceRequest(ThreadableLoaderClient*);
105 105
106 void willDestroyResource(Resource*); 106 void willDestroyResource(Resource*);
107 107
108 void applyUserAgentOverride(String* userAgent); 108 void applyUserAgentOverride(String* userAgent);
109 109
110 // FIXME: InspectorResourceAgent should not be aware of style recalculation. 110 // FIXME: InspectorResourceAgent should not be aware of style recalculation.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // Called from other agents. 144 // Called from other agents.
145 void setHostId(const String&); 145 void setHostId(const String&);
146 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas e64Encoded); 146 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas e64Encoded);
147 147
148 private: 148 private:
149 explicit InspectorResourceAgent(InspectorPageAgent*); 149 explicit InspectorResourceAgent(InspectorPageAgent*);
150 150
151 void enable(); 151 void enable();
152 void delayedRemoveReplayXHR(XMLHttpRequest*); 152 void delayedRemoveReplayXHR(XMLHttpRequest*);
153 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); 153 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*);
154 void didFinishXHRInternal(ExecutionContext*, XMLHttpRequest*, ThreadableLoad erClient*, const AtomicString&, const String&, bool);
154 155
155 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get ResponseBodyCallback>); 156 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get ResponseBodyCallback>);
156 157
157 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; 158 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
158 String m_userAgentOverride; 159 String m_userAgentOverride;
159 String m_hostId; 160 String m_hostId;
160 OwnPtr<NetworkResourcesData> m_resourcesData; 161 OwnPtr<NetworkResourcesData> m_resourcesData;
161 162
163 typedef HashMap<ThreadableLoaderClient*, unsigned long> ThreadableLoaderClie ntRequestIdMap;
164
162 // Stores the data for replaying XHR until an identifier for the load is 165 // Stores the data for replaying XHR until an identifier for the load is
163 // generated by the loader and passed to the inspector via the 166 // generated by the loader and passed to the inspector via the
164 // documentThreadableLoaderStartedLoadingForClient() method. 167 // documentThreadableLoaderStartedLoadingForClient() method.
165 ThreadableLoaderClient* m_pendingXHR; 168 ThreadableLoaderClient* m_pendingXHR;
166 RefPtrWillBeMember<XHRReplayData> m_pendingXHRReplayData; 169 RefPtrWillBeMember<XHRReplayData> m_pendingXHRReplayData;
170 ThreadableLoaderClientRequestIdMap m_xhrRequestIdMap;
167 171
168 // Stores the pointer to the ThreadableLoaderClient for an EventSource 172 // Stores the pointer to the ThreadableLoaderClient for an EventSource
169 // (actually, the EventSource instance itself) for which a loader is being 173 // (actually, the EventSource instance itself) for which a loader is being
170 // initialized, until an identifier for the load is generated by the loader 174 // initialized, until an identifier for the load is generated by the loader
171 // and passed to the inspector via the 175 // and passed to the inspector via the
172 // documentThreadableLoaderStartedLoadingForClient() method. 176 // documentThreadableLoaderStartedLoadingForClient() method.
173 // 177 //
174 // Since the DocumentThreadableLoader may call 178 // Since the DocumentThreadableLoader may call
175 // documentThreadableLoaderStartedLoadingForClient() only synchronously to 179 // documentThreadableLoaderStartedLoadingForClient() only synchronously to
176 // the creation of the loader, it's unnecessary to store the pointer to a 180 // the creation of the loader, it's unnecessary to store the pointer to a
177 // map. 181 // map.
178 ThreadableLoaderClient* m_pendingEventSource; 182 ThreadableLoaderClient* m_pendingEventSource;
179 typedef HashMap<ThreadableLoaderClient*, unsigned long> EventSourceRequestId Map; 183 ThreadableLoaderClientRequestIdMap m_eventSourceRequestIdMap;
180 EventSourceRequestIdMap m_eventSourceRequestIdMap;
181 184
182 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig ationInitiatorMap; 185 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig ationInitiatorMap;
183 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; 186 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap;
184 187
185 // FIXME: InspectorResourceAgent should now be aware of style recalculation. 188 // FIXME: InspectorResourceAgent should now be aware of style recalculation.
186 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; 189 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator;
187 bool m_isRecalculatingStyle; 190 bool m_isRecalculatingStyle;
188 191
189 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; 192 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs;
190 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet ed; 193 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet ed;
191 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; 194 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer;
192 }; 195 };
193 196
194 } // namespace blink 197 } // namespace blink
195 198
196 199
197 #endif // !defined(InspectorResourceAgent_h) 200 #endif // !defined(InspectorResourceAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInstrumentation.idl ('k') | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698