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