| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 class Resource; | 44 class Resource; |
| 45 struct FetchInitiatorInfo; | 45 struct FetchInitiatorInfo; |
| 46 class Document; | 46 class Document; |
| 47 class DocumentLoader; | 47 class DocumentLoader; |
| 48 class ExecutionContext; | 48 class ExecutionContext; |
| 49 class FormData; | 49 class FormData; |
| 50 class LocalFrame; | 50 class LocalFrame; |
| 51 class HTTPHeaderMap; | 51 class HTTPHeaderMap; |
| 52 class InspectorFrontend; | 52 class InspectorFrontend; |
| 53 class InspectorPageAgent; |
| 53 class JSONObject; | 54 class JSONObject; |
| 54 class KURL; | 55 class KURL; |
| 55 class NetworkResourcesData; | 56 class NetworkResourcesData; |
| 56 class ResourceError; | 57 class ResourceError; |
| 57 class ResourceLoader; | 58 class ResourceLoader; |
| 58 class ResourceRequest; | 59 class ResourceRequest; |
| 59 class ResourceResponse; | 60 class ResourceResponse; |
| 60 class ThreadableLoaderClient; | 61 class ThreadableLoaderClient; |
| 61 class XHRReplayData; | 62 class XHRReplayData; |
| 62 class XMLHttpRequest; | 63 class XMLHttpRequest; |
| 63 | 64 |
| 64 class WebSocketHandshakeRequest; | 65 class WebSocketHandshakeRequest; |
| 65 class WebSocketHandshakeResponse; | 66 class WebSocketHandshakeResponse; |
| 66 | 67 |
| 67 typedef String ErrorString; | 68 typedef String ErrorString; |
| 68 | 69 |
| 69 class InspectorResourceAgent final : public InspectorBaseAgent<InspectorResource
Agent, InspectorFrontend::Network>, public InspectorBackendDispatcher::NetworkCo
mmandHandler { | 70 class InspectorResourceAgent final : public InspectorBaseAgent<InspectorResource
Agent, InspectorFrontend::Network>, public InspectorBackendDispatcher::NetworkCo
mmandHandler { |
| 70 public: | 71 public: |
| 71 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(LocalFrame* ins
pectedFrame) | 72 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg
ent* pageAgent) |
| 72 { | 73 { |
| 73 return adoptPtrWillBeNoop(new InspectorResourceAgent(inspectedFrame)); | 74 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent)); |
| 74 } | 75 } |
| 75 | 76 |
| 76 void disable(ErrorString*) override; | 77 void disable(ErrorString*) override; |
| 77 void restore() override; | 78 void restore() override; |
| 78 | 79 |
| 79 virtual ~InspectorResourceAgent(); | 80 virtual ~InspectorResourceAgent(); |
| 80 DECLARE_VIRTUAL_TRACE(); | 81 DECLARE_VIRTUAL_TRACE(); |
| 81 | 82 |
| 82 // Called from instrumentation. | 83 // Called from instrumentation. |
| 83 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); | 84 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 Loading... |
| 137 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do
uble) override; | 138 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do
uble) override; |
| 138 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) override; | 139 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) override; |
| 139 | 140 |
| 140 virtual void setDataSizeLimitsForTest(ErrorString*, int maxTotal, int maxRes
ource) override; | 141 virtual void setDataSizeLimitsForTest(ErrorString*, int maxTotal, int maxRes
ource) override; |
| 141 | 142 |
| 142 // Called from other agents. | 143 // Called from other agents. |
| 143 void setHostId(const String&); | 144 void setHostId(const String&); |
| 144 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); | 145 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); |
| 145 | 146 |
| 146 private: | 147 private: |
| 147 explicit InspectorResourceAgent(LocalFrame*); | 148 explicit InspectorResourceAgent(InspectorPageAgent*); |
| 148 | 149 |
| 149 void enable(); | 150 void enable(); |
| 150 void delayedRemoveReplayXHR(XMLHttpRequest*); | 151 void delayedRemoveReplayXHR(XMLHttpRequest*); |
| 151 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); | 152 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); |
| 152 | 153 |
| 153 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get
ResponseBodyCallback>); | 154 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get
ResponseBodyCallback>); |
| 154 | 155 |
| 155 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; | 156 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 156 String m_userAgentOverride; | 157 String m_userAgentOverride; |
| 157 String m_hostId; | 158 String m_hostId; |
| 158 OwnPtr<NetworkResourcesData> m_resourcesData; | 159 OwnPtr<NetworkResourcesData> m_resourcesData; |
| 159 | 160 |
| 160 typedef WillBeHeapHashMap<ThreadableLoaderClient*, RefPtrWillBeMember<XHRRep
layData> > PendingXHRReplayDataMap; | 161 typedef WillBeHeapHashMap<ThreadableLoaderClient*, RefPtrWillBeMember<XHRRep
layData> > PendingXHRReplayDataMap; |
| 161 PendingXHRReplayDataMap m_pendingXHRReplayData; | 162 PendingXHRReplayDataMap m_pendingXHRReplayData; |
| 162 | 163 |
| 163 ThreadableLoaderClient* m_pendingEventSource; | 164 ThreadableLoaderClient* m_pendingEventSource; |
| 164 typedef HashMap<ThreadableLoaderClient*, unsigned long> EventSourceRequestId
Map; | 165 typedef HashMap<ThreadableLoaderClient*, unsigned long> EventSourceRequestId
Map; |
| 165 EventSourceRequestIdMap m_eventSourceRequestIdMap; | 166 EventSourceRequestIdMap m_eventSourceRequestIdMap; |
| 166 | 167 |
| 167 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; | 168 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; |
| 168 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; | 169 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; |
| 169 | 170 |
| 170 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 171 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
| 171 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 172 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
| 172 bool m_isRecalculatingStyle; | 173 bool m_isRecalculatingStyle; |
| 173 | 174 |
| 174 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; | 175 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; |
| 175 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet
ed; | 176 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet
ed; |
| 176 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; | 177 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace blink | 180 } // namespace blink |
| 180 | 181 |
| 181 | 182 |
| 182 #endif // !defined(InspectorResourceAgent_h) | 183 #endif // !defined(InspectorResourceAgent_h) |
| OLD | NEW |