| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 class XHRReplayData; | 67 class XHRReplayData; |
| 68 class XMLHttpRequest; | 68 class XMLHttpRequest; |
| 69 | 69 |
| 70 class WebSocketHandshakeRequest; | 70 class WebSocketHandshakeRequest; |
| 71 class WebSocketHandshakeResponse; | 71 class WebSocketHandshakeResponse; |
| 72 | 72 |
| 73 typedef String ErrorString; | 73 typedef String ErrorString; |
| 74 | 74 |
| 75 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { | 75 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { |
| 76 public: | 76 public: |
| 77 static PassOwnPtr<InspectorResourceAgent> create(InspectorPageAgent* pageAge
nt) | 77 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg
ent* pageAgent) |
| 78 { | 78 { |
| 79 return adoptPtr(new InspectorResourceAgent(pageAgent)); | 79 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 82 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 83 virtual void clearFrontend() OVERRIDE; | 83 virtual void clearFrontend() OVERRIDE; |
| 84 virtual void restore() OVERRIDE; | 84 virtual void restore() OVERRIDE; |
| 85 | 85 |
| 86 virtual ~InspectorResourceAgent(); | 86 virtual ~InspectorResourceAgent(); |
| 87 virtual void trace(Visitor*) OVERRIDE; |
| 87 | 88 |
| 88 // Called from instrumentation. | 89 // Called from instrumentation. |
| 89 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); | 90 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); |
| 90 void markResourceAsCached(unsigned long identifier); | 91 void markResourceAsCached(unsigned long identifier); |
| 91 void didReceiveResourceResponse(LocalFrame*, unsigned long identifier, Docum
entLoader*, const ResourceResponse&, ResourceLoader*); | 92 void didReceiveResourceResponse(LocalFrame*, unsigned long identifier, Docum
entLoader*, const ResourceResponse&, ResourceLoader*); |
| 92 void didReceiveData(LocalFrame*, unsigned long identifier, const char* data,
int dataLength, int encodedDataLength); | 93 void didReceiveData(LocalFrame*, unsigned long identifier, const char* data,
int dataLength, int encodedDataLength); |
| 93 void didFinishLoading(unsigned long identifier, DocumentLoader*, double mono
tonicFinishTime, int64_t encodedDataLength); | 94 void didFinishLoading(unsigned long identifier, DocumentLoader*, double mono
tonicFinishTime, int64_t encodedDataLength); |
| 94 void didReceiveCORSRedirectResponse(LocalFrame*, unsigned long identifier, D
ocumentLoader*, const ResourceResponse&, ResourceLoader*); | 95 void didReceiveCORSRedirectResponse(LocalFrame*, unsigned long identifier, D
ocumentLoader*, const ResourceResponse&, ResourceLoader*); |
| 95 void didFailLoading(unsigned long identifier, const ResourceError&); | 96 void didFailLoading(unsigned long identifier, const ResourceError&); |
| 96 void didCommitLoad(LocalFrame*, DocumentLoader*); | 97 void didCommitLoad(LocalFrame*, DocumentLoader*); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do
uble) OVERRIDE; | 142 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do
uble) OVERRIDE; |
| 142 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; | 143 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; |
| 143 | 144 |
| 144 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; | 145 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; |
| 145 | 146 |
| 146 // Called from other agents. | 147 // Called from other agents. |
| 147 void setHostId(const String&); | 148 void setHostId(const String&); |
| 148 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); | 149 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); |
| 149 | 150 |
| 150 private: | 151 private: |
| 151 InspectorResourceAgent(InspectorPageAgent*); | 152 explicit InspectorResourceAgent(InspectorPageAgent*); |
| 152 | 153 |
| 153 void enable(); | 154 void enable(); |
| 154 void delayedRemoveReplayXHR(XMLHttpRequest*); | 155 void delayedRemoveReplayXHR(XMLHttpRequest*); |
| 155 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); | 156 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); |
| 156 | 157 |
| 157 InspectorPageAgent* m_pageAgent; | 158 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 158 InspectorFrontend::Network* m_frontend; | 159 InspectorFrontend::Network* m_frontend; |
| 159 String m_userAgentOverride; | 160 String m_userAgentOverride; |
| 160 String m_hostId; | 161 String m_hostId; |
| 161 OwnPtr<NetworkResourcesData> m_resourcesData; | 162 OwnPtr<NetworkResourcesData> m_resourcesData; |
| 162 | 163 |
| 163 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; | 164 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; |
| 164 PendingXHRReplayDataMap m_pendingXHRReplayData; | 165 PendingXHRReplayDataMap m_pendingXHRReplayData; |
| 165 | 166 |
| 166 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; | 167 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; |
| 167 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; | 168 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; |
| 168 | 169 |
| 169 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 170 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
| 170 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 171 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
| 171 bool m_isRecalculatingStyle; | 172 bool m_isRecalculatingStyle; |
| 172 | 173 |
| 173 WillBePersistentHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHR
s; | 174 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; |
| 174 WillBePersistentHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHR
sToBeDeleted; | 175 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet
ed; |
| 175 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; | 176 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; |
| 176 }; | 177 }; |
| 177 | 178 |
| 178 } // namespace blink | 179 } // namespace blink |
| 179 | 180 |
| 180 | 181 |
| 181 #endif // !defined(InspectorResourceAgent_h) | 182 #endif // !defined(InspectorResourceAgent_h) |
| OLD | NEW |