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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 namespace WTF { | 42 namespace WTF { |
43 class String; | 43 class String; |
44 } | 44 } |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 class Resource; | 48 class Resource; |
49 struct FetchInitiatorInfo; | 49 struct FetchInitiatorInfo; |
50 class Document; | 50 class Document; |
51 class DocumentLoader; | 51 class DocumentLoader; |
| 52 class EditedResourcesContentManager; |
52 class FormData; | 53 class FormData; |
53 class LocalFrame; | 54 class LocalFrame; |
54 class HTTPHeaderMap; | 55 class HTTPHeaderMap; |
55 class InspectorFrontend; | 56 class InspectorFrontend; |
56 class InspectorPageAgent; | 57 class InspectorPageAgent; |
57 class InstrumentingAgents; | 58 class InstrumentingAgents; |
58 class JSONObject; | 59 class JSONObject; |
59 class KURL; | 60 class KURL; |
60 class NetworkResourcesData; | 61 class NetworkResourcesData; |
61 class Page; | 62 class Page; |
62 class ResourceError; | 63 class ResourceError; |
63 class ResourceLoader; | 64 class ResourceLoader; |
64 class ResourceRequest; | 65 class ResourceRequest; |
65 class ResourceResponse; | 66 class ResourceResponse; |
66 class ThreadableLoaderClient; | 67 class ThreadableLoaderClient; |
67 class XHRReplayData; | 68 class XHRReplayData; |
68 class XMLHttpRequest; | 69 class XMLHttpRequest; |
69 | 70 |
70 class WebSocketHandshakeRequest; | 71 class WebSocketHandshakeRequest; |
71 class WebSocketHandshakeResponse; | 72 class WebSocketHandshakeResponse; |
72 | 73 |
73 typedef String ErrorString; | 74 typedef String ErrorString; |
74 | 75 |
75 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { | 76 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { |
76 public: | 77 public: |
77 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg
ent* pageAgent) | 78 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg
ent* pageAgent, EditedResourcesContentManager* editedResourcesContentManager) |
78 { | 79 { |
79 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent)); | 80 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent, editedRe
sourcesContentManager)); |
80 } | 81 } |
81 | 82 |
82 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 83 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
83 virtual void clearFrontend() OVERRIDE; | 84 virtual void clearFrontend() OVERRIDE; |
84 virtual void restore() OVERRIDE; | 85 virtual void restore() OVERRIDE; |
85 | 86 |
86 virtual ~InspectorResourceAgent(); | 87 virtual ~InspectorResourceAgent(); |
87 virtual void trace(Visitor*) OVERRIDE; | 88 virtual void trace(Visitor*) OVERRIDE; |
88 | 89 |
89 // Called from instrumentation. | 90 // Called from instrumentation. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do
uble) OVERRIDE; | 143 virtual void emulateNetworkConditions(ErrorString*, bool, double, double, do
uble) OVERRIDE; |
143 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; | 144 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; |
144 | 145 |
145 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; | 146 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; |
146 | 147 |
147 // Called from other agents. | 148 // Called from other agents. |
148 void setHostId(const String&); | 149 void setHostId(const String&); |
149 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); | 150 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); |
150 | 151 |
151 private: | 152 private: |
152 explicit InspectorResourceAgent(InspectorPageAgent*); | 153 InspectorResourceAgent(InspectorPageAgent*, EditedResourcesContentManager*); |
153 | 154 |
154 void enable(); | 155 void enable(); |
155 void delayedRemoveReplayXHR(XMLHttpRequest*); | 156 void delayedRemoveReplayXHR(XMLHttpRequest*); |
156 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); | 157 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); |
157 | 158 |
158 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 159 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 160 RawPtrWillBeMember<EditedResourcesContentManager> m_editedResourcesContentMa
nager; |
159 InspectorFrontend::Network* m_frontend; | 161 InspectorFrontend::Network* m_frontend; |
160 String m_userAgentOverride; | 162 String m_userAgentOverride; |
161 String m_hostId; | 163 String m_hostId; |
162 OwnPtr<NetworkResourcesData> m_resourcesData; | 164 OwnPtr<NetworkResourcesData> m_resourcesData; |
163 | 165 |
164 typedef WillBeHeapHashMap<ThreadableLoaderClient*, RefPtrWillBeMember<XHRRep
layData> > PendingXHRReplayDataMap; | 166 typedef WillBeHeapHashMap<ThreadableLoaderClient*, RefPtrWillBeMember<XHRRep
layData> > PendingXHRReplayDataMap; |
165 PendingXHRReplayDataMap m_pendingXHRReplayData; | 167 PendingXHRReplayDataMap m_pendingXHRReplayData; |
166 | 168 |
167 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; | 169 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; |
168 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; | 170 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; |
169 | 171 |
170 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 172 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
171 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 173 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
172 bool m_isRecalculatingStyle; | 174 bool m_isRecalculatingStyle; |
173 | 175 |
174 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; | 176 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRs; |
175 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet
ed; | 177 WillBeHeapHashSet<RefPtrWillBeMember<XMLHttpRequest> > m_replayXHRsToBeDelet
ed; |
176 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; | 178 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; |
177 }; | 179 }; |
178 | 180 |
179 } // namespace blink | 181 } // namespace blink |
180 | 182 |
181 | 183 |
182 #endif // !defined(InspectorResourceAgent_h) | 184 #endif // !defined(InspectorResourceAgent_h) |
OLD | NEW |