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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 virtual void canClearBrowserCookies(ErrorString*, bool*) OVERRIDE; | 140 virtual void canClearBrowserCookies(ErrorString*, bool*) OVERRIDE; |
140 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; | 141 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; |
141 | 142 |
142 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; | 143 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; |
143 | 144 |
144 // Called from other agents. | 145 // Called from other agents. |
145 void setHostId(const String&); | 146 void setHostId(const String&); |
146 bool fetchResourceContent(LocalFrame*, const KURL&, String* content, bool* b
ase64Encoded); | 147 bool fetchResourceContent(LocalFrame*, const KURL&, String* content, bool* b
ase64Encoded); |
147 | 148 |
148 private: | 149 private: |
149 InspectorResourceAgent(InspectorPageAgent*); | 150 explicit InspectorResourceAgent(InspectorPageAgent*); |
150 | 151 |
151 void enable(); | 152 void enable(); |
152 | 153 |
153 InspectorPageAgent* m_pageAgent; | 154 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
154 InspectorFrontend::Network* m_frontend; | 155 InspectorFrontend::Network* m_frontend; |
155 String m_userAgentOverride; | 156 String m_userAgentOverride; |
156 String m_hostId; | 157 String m_hostId; |
157 OwnPtr<NetworkResourcesData> m_resourcesData; | 158 OwnPtr<NetworkResourcesData> m_resourcesData; |
158 | 159 |
159 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; | 160 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; |
160 PendingXHRReplayDataMap m_pendingXHRReplayData; | 161 PendingXHRReplayDataMap m_pendingXHRReplayData; |
161 | 162 |
162 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; | 163 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; |
163 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; | 164 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; |
164 | 165 |
165 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 166 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
166 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 167 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
167 bool m_isRecalculatingStyle; | 168 bool m_isRecalculatingStyle; |
168 }; | 169 }; |
169 | 170 |
170 } // namespace WebCore | 171 } // namespace WebCore |
171 | 172 |
172 | 173 |
173 #endif // !defined(InspectorResourceAgent_h) | 174 #endif // !defined(InspectorResourceAgent_h) |
OLD | NEW |