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

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

Issue 1183173002: [DevTools] Show sync XHR info during request loading. (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
« no previous file with comments | « no previous file | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 class XHRReplayData; 63 class XHRReplayData;
64 class XMLHttpRequest; 64 class XMLHttpRequest;
65 65
66 class WebSocketHandshakeRequest; 66 class WebSocketHandshakeRequest;
67 class WebSocketHandshakeResponse; 67 class WebSocketHandshakeResponse;
68 68
69 typedef String ErrorString; 69 typedef String ErrorString;
70 70
71 class CORE_EXPORT InspectorResourceAgent final : public InspectorBaseAgent<Inspe ctorResourceAgent, InspectorFrontend::Network>, public InspectorBackendDispatche r::NetworkCommandHandler { 71 class CORE_EXPORT InspectorResourceAgent final : public InspectorBaseAgent<Inspe ctorResourceAgent, InspectorFrontend::Network>, public InspectorBackendDispatche r::NetworkCommandHandler {
72 public: 72 public:
73 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg ent* pageAgent) 73 class Client {
74 public:
75 virtual ~Client() { }
76
77 virtual void flushPendingProtocolNotifications() { }
pfeldman 2015/06/15 15:21:00 Lets make it available to the InspectorBaseAgent::
dgozman 2015/06/15 15:56:12 Found InspectorFrotendChannel::flush.
78 };
79
80 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg ent* pageAgent, Client* client)
74 { 81 {
75 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent)); 82 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent, client)) ;
76 } 83 }
77 84
78 void disable(ErrorString*) override; 85 void disable(ErrorString*) override;
79 void restore() override; 86 void restore() override;
80 87
81 virtual ~InspectorResourceAgent(); 88 virtual ~InspectorResourceAgent();
82 DECLARE_VIRTUAL_TRACE(); 89 DECLARE_VIRTUAL_TRACE();
83 90
84 // Called from instrumentation. 91 // Called from instrumentation.
85 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); 92 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do uble) override; 146 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do uble) override;
140 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) override; 147 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) override;
141 148
142 virtual void setDataSizeLimitsForTest(ErrorString*, int maxTotal, int maxRes ource) override; 149 virtual void setDataSizeLimitsForTest(ErrorString*, int maxTotal, int maxRes ource) override;
143 150
144 // Called from other agents. 151 // Called from other agents.
145 void setHostId(const String&); 152 void setHostId(const String&);
146 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas e64Encoded); 153 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas e64Encoded);
147 154
148 private: 155 private:
149 explicit InspectorResourceAgent(InspectorPageAgent*); 156 InspectorResourceAgent(InspectorPageAgent*, Client*);
150 157
151 void enable(); 158 void enable();
152 void delayedRemoveReplayXHR(XMLHttpRequest*); 159 void delayedRemoveReplayXHR(XMLHttpRequest*);
153 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); 160 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*);
154 161
155 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get ResponseBodyCallback>); 162 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get ResponseBodyCallback>);
156 163
157 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; 164 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
165 Client* m_client;
158 String m_userAgentOverride; 166 String m_userAgentOverride;
159 String m_hostId; 167 String m_hostId;
160 OwnPtr<NetworkResourcesData> m_resourcesData; 168 OwnPtr<NetworkResourcesData> m_resourcesData;
161 169
162 // Stores the data for replaying XHR until an identifier for the load is 170 // 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 171 // generated by the loader and passed to the inspector via the
164 // documentThreadableLoaderStartedLoadingForClient() method. 172 // documentThreadableLoaderStartedLoadingForClient() method.
165 typedef WillBeHeapHashMap<ThreadableLoaderClient*, RefPtrWillBeMember<XHRRep layData> > PendingXHRReplayDataMap; 173 ThreadableLoaderClient* m_pendingXHR;
166 PendingXHRReplayDataMap m_pendingXHRReplayData; 174 RefPtrWillBeMember<XHRReplayData> m_pendingXHRReplayData;
167 175
168 // Stores the pointer to the ThreadableLoaderClient for an EventSource 176 // Stores the pointer to the ThreadableLoaderClient for an EventSource
169 // (actually, the EventSource instance itself) for which a loader is being 177 // (actually, the EventSource instance itself) for which a loader is being
170 // initialized, until an identifier for the load is generated by the loader 178 // initialized, until an identifier for the load is generated by the loader
171 // and passed to the inspector via the 179 // and passed to the inspector via the
172 // documentThreadableLoaderStartedLoadingForClient() method. 180 // documentThreadableLoaderStartedLoadingForClient() method.
173 // 181 //
174 // Since the DocumentThreadableLoader may call 182 // Since the DocumentThreadableLoader may call
175 // documentThreadableLoaderStartedLoadingForClient() only synchronously to 183 // documentThreadableLoaderStartedLoadingForClient() only synchronously to
176 // the creation of the loader, it's unnecessary to store the pointer to a 184 // the creation of the loader, it's unnecessary to store the pointer to a
(...skipping 11 matching lines...) Expand all
188 196
189 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; 197 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs;
190 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet ed; 198 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet ed;
191 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; 199 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer;
192 }; 200 };
193 201
194 } // namespace blink 202 } // namespace blink
195 203
196 204
197 #endif // !defined(InspectorResourceAgent_h) 205 #endif // !defined(InspectorResourceAgent_h)
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698