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