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 ThreadableLoaderClient; | 66 class ThreadableLoaderClient; |
67 class XHRReplayData; | 67 class XHRReplayData; |
68 class XMLHttpRequest; | 68 class XMLHttpRequest; |
69 | 69 |
70 struct WebSocketFrame; | 70 struct WebSocketFrame; |
71 class WebSocketHandshakeRequest; | 71 class WebSocketHandshakeRequest; |
72 class WebSocketHandshakeResponse; | 72 class WebSocketHandshakeResponse; |
73 | 73 |
74 typedef String ErrorString; | 74 typedef String ErrorString; |
75 | 75 |
76 class InspectorResourceAgent : public InspectorBaseAgent<InspectorResourceAgent>
, public InspectorBackendDispatcher::NetworkCommandHandler { | 76 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { |
77 public: | 77 public: |
78 static PassOwnPtr<InspectorResourceAgent> create(InstrumentingAgents* instru
mentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client, Inspector
CompositeState* state) | 78 static PassOwnPtr<InspectorResourceAgent> create(InstrumentingAgents* instru
mentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client, Inspector
CompositeState* state) |
79 { | 79 { |
80 return adoptPtr(new InspectorResourceAgent(instrumentingAgents, pageAgen
t, client, state)); | 80 return adoptPtr(new InspectorResourceAgent(instrumentingAgents, pageAgen
t, client, state)); |
81 } | 81 } |
82 | 82 |
83 virtual void setFrontend(InspectorFrontend*); | 83 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
84 virtual void clearFrontend(); | 84 virtual void clearFrontend() OVERRIDE; |
85 virtual void restore(); | 85 virtual void restore() OVERRIDE; |
86 | 86 |
87 static PassRefPtr<InspectorResourceAgent> restore(Page*, InspectorCompositeS
tate*, InspectorFrontend*); | 87 static PassRefPtr<InspectorResourceAgent> restore(Page*, InspectorCompositeS
tate*, InspectorFrontend*); |
88 | 88 |
89 ~InspectorResourceAgent(); | 89 virtual ~InspectorResourceAgent(); |
90 | 90 |
91 // Called from instrumentation. | 91 // Called from instrumentation. |
92 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); | 92 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); |
93 void markResourceAsCached(unsigned long identifier); | 93 void markResourceAsCached(unsigned long identifier); |
94 void didReceiveResourceResponse(Frame*, unsigned long identifier, DocumentLo
ader*, const ResourceResponse&, ResourceLoader*); | 94 void didReceiveResourceResponse(Frame*, unsigned long identifier, DocumentLo
ader*, const ResourceResponse&, ResourceLoader*); |
95 void didReceiveData(unsigned long identifier, const char* data, int dataLeng
th, int encodedDataLength); | 95 void didReceiveData(unsigned long identifier, const char* data, int dataLeng
th, int encodedDataLength); |
96 void didFinishLoading(unsigned long identifier, DocumentLoader*, double mono
tonicFinishTime); | 96 void didFinishLoading(unsigned long identifier, DocumentLoader*, double mono
tonicFinishTime); |
97 void didReceiveCORSRedirectResponse(Frame*, unsigned long identifier, Docume
ntLoader*, const ResourceResponse&, ResourceLoader*); | 97 void didReceiveCORSRedirectResponse(Frame*, unsigned long identifier, Docume
ntLoader*, const ResourceResponse&, ResourceLoader*); |
98 void didFailLoading(unsigned long identifier, DocumentLoader*, const Resourc
eError&); | 98 void didFailLoading(unsigned long identifier, DocumentLoader*, const Resourc
eError&); |
99 void didCommitLoad(Frame*, DocumentLoader*); | 99 void didCommitLoad(Frame*, DocumentLoader*); |
(...skipping 24 matching lines...) Expand all Loading... |
124 void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifie
r, const WebSocketHandshakeResponse&); | 124 void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifie
r, const WebSocketHandshakeResponse&); |
125 void didCloseWebSocket(Document*, unsigned long identifier); | 125 void didCloseWebSocket(Document*, unsigned long identifier); |
126 void didReceiveWebSocketFrame(unsigned long identifier, const WebSocketFrame
&); | 126 void didReceiveWebSocketFrame(unsigned long identifier, const WebSocketFrame
&); |
127 void didSendWebSocketFrame(unsigned long identifier, const WebSocketFrame&); | 127 void didSendWebSocketFrame(unsigned long identifier, const WebSocketFrame&); |
128 void didReceiveWebSocketFrameError(unsigned long identifier, const String&); | 128 void didReceiveWebSocketFrameError(unsigned long identifier, const String&); |
129 | 129 |
130 // called from Internals for layout test purposes. | 130 // called from Internals for layout test purposes. |
131 void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize
, int maximumSingleResourceContentSize); | 131 void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize
, int maximumSingleResourceContentSize); |
132 | 132 |
133 // Called from frontend | 133 // Called from frontend |
134 virtual void enable(ErrorString*); | 134 virtual void enable(ErrorString*) OVERRIDE; |
135 virtual void disable(ErrorString*); | 135 virtual void disable(ErrorString*) OVERRIDE; |
136 virtual void setUserAgentOverride(ErrorString*, const String& userAgent); | 136 virtual void setUserAgentOverride(ErrorString*, const String& userAgent) OVE
RRIDE; |
137 virtual void setExtraHTTPHeaders(ErrorString*, const RefPtr<JSONObject>&); | 137 virtual void setExtraHTTPHeaders(ErrorString*, const RefPtr<JSONObject>&) OV
ERRIDE; |
138 virtual void getResponseBody(ErrorString*, const String& requestId, String*
content, bool* base64Encoded); | 138 virtual void getResponseBody(ErrorString*, const String& requestId, String*
content, bool* base64Encoded) OVERRIDE; |
139 | 139 |
140 virtual void replayXHR(ErrorString*, const String& requestId); | 140 virtual void replayXHR(ErrorString*, const String& requestId) OVERRIDE; |
141 | 141 |
142 virtual void canClearBrowserCache(ErrorString*, bool*); | 142 virtual void canClearBrowserCache(ErrorString*, bool*) OVERRIDE; |
143 virtual void clearBrowserCache(ErrorString*); | 143 virtual void clearBrowserCache(ErrorString*) OVERRIDE; |
144 virtual void canClearBrowserCookies(ErrorString*, bool*); | 144 virtual void canClearBrowserCookies(ErrorString*, bool*) OVERRIDE; |
145 virtual void clearBrowserCookies(ErrorString*); | 145 virtual void clearBrowserCookies(ErrorString*) OVERRIDE; |
146 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled); | 146 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; |
147 | 147 |
148 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>); | 148 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; |
149 | 149 |
150 // Called from other agents. | 150 // Called from other agents. |
151 bool fetchResourceContent(Frame*, const KURL&, String* content, bool* base64
Encoded); | 151 bool fetchResourceContent(Frame*, const KURL&, String* content, bool* base64
Encoded); |
152 | 152 |
153 private: | 153 private: |
154 InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorC
lient*, InspectorCompositeState*); | 154 InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorC
lient*, InspectorCompositeState*); |
155 | 155 |
156 void enable(); | 156 void enable(); |
157 | 157 |
158 InspectorPageAgent* m_pageAgent; | 158 InspectorPageAgent* m_pageAgent; |
(...skipping 10 matching lines...) Expand all Loading... |
169 | 169 |
170 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 170 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
171 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 171 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
172 bool m_isRecalculatingStyle; | 172 bool m_isRecalculatingStyle; |
173 }; | 173 }; |
174 | 174 |
175 } // namespace WebCore | 175 } // namespace WebCore |
176 | 176 |
177 | 177 |
178 #endif // !defined(InspectorResourceAgent_h) | 178 #endif // !defined(InspectorResourceAgent_h) |
OLD | NEW |