| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 class Resource; | 47 class Resource; |
| 48 struct FetchInitiatorInfo; | 48 struct FetchInitiatorInfo; |
| 49 class Document; | 49 class Document; |
| 50 class DocumentLoader; | 50 class DocumentLoader; |
| 51 class FormData; | 51 class FormData; |
| 52 class LocalFrame; | 52 class LocalFrame; |
| 53 class HTTPHeaderMap; | 53 class HTTPHeaderMap; |
| 54 class InspectorClient; | |
| 55 class InspectorFrontend; | 54 class InspectorFrontend; |
| 56 class InspectorPageAgent; | 55 class InspectorPageAgent; |
| 57 class InstrumentingAgents; | 56 class InstrumentingAgents; |
| 58 class JSONObject; | 57 class JSONObject; |
| 59 class KURL; | 58 class KURL; |
| 60 class NetworkResourcesData; | 59 class NetworkResourcesData; |
| 61 class Page; | 60 class Page; |
| 62 class ResourceError; | 61 class ResourceError; |
| 63 class ResourceLoader; | 62 class ResourceLoader; |
| 64 class ResourceRequest; | 63 class ResourceRequest; |
| 65 class ResourceResponse; | 64 class ResourceResponse; |
| 66 class ThreadableLoaderClient; | 65 class ThreadableLoaderClient; |
| 67 class XHRReplayData; | 66 class XHRReplayData; |
| 68 class XMLHttpRequest; | 67 class XMLHttpRequest; |
| 69 | 68 |
| 70 class WebSocketHandshakeRequest; | 69 class WebSocketHandshakeRequest; |
| 71 class WebSocketHandshakeResponse; | 70 class WebSocketHandshakeResponse; |
| 72 | 71 |
| 73 typedef String ErrorString; | 72 typedef String ErrorString; |
| 74 | 73 |
| 75 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { | 74 class InspectorResourceAgent FINAL : public InspectorBaseAgent<InspectorResource
Agent>, public InspectorBackendDispatcher::NetworkCommandHandler { |
| 76 public: | 75 public: |
| 77 static PassOwnPtr<InspectorResourceAgent> create(InspectorPageAgent* pageAge
nt, InspectorClient* client) | 76 static PassOwnPtr<InspectorResourceAgent> create(InspectorPageAgent* pageAge
nt) |
| 78 { | 77 { |
| 79 return adoptPtr(new InspectorResourceAgent(pageAgent, client)); | 78 return adoptPtr(new InspectorResourceAgent(pageAgent)); |
| 80 } | 79 } |
| 81 | 80 |
| 82 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 81 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 83 virtual void clearFrontend() OVERRIDE; | 82 virtual void clearFrontend() OVERRIDE; |
| 84 virtual void restore() OVERRIDE; | 83 virtual void restore() OVERRIDE; |
| 85 | 84 |
| 86 virtual ~InspectorResourceAgent(); | 85 virtual ~InspectorResourceAgent(); |
| 87 | 86 |
| 88 // Called from instrumentation. | 87 // Called from instrumentation. |
| 89 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); | 88 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // Called from frontend | 129 // Called from frontend |
| 131 virtual void enable(ErrorString*) OVERRIDE; | 130 virtual void enable(ErrorString*) OVERRIDE; |
| 132 virtual void disable(ErrorString*) OVERRIDE; | 131 virtual void disable(ErrorString*) OVERRIDE; |
| 133 virtual void setUserAgentOverride(ErrorString*, const String& userAgent) OVE
RRIDE; | 132 virtual void setUserAgentOverride(ErrorString*, const String& userAgent) OVE
RRIDE; |
| 134 virtual void setExtraHTTPHeaders(ErrorString*, const RefPtr<JSONObject>&) OV
ERRIDE; | 133 virtual void setExtraHTTPHeaders(ErrorString*, const RefPtr<JSONObject>&) OV
ERRIDE; |
| 135 virtual void getResponseBody(ErrorString*, const String& requestId, String*
content, bool* base64Encoded) OVERRIDE; | 134 virtual void getResponseBody(ErrorString*, const String& requestId, String*
content, bool* base64Encoded) OVERRIDE; |
| 136 | 135 |
| 137 virtual void replayXHR(ErrorString*, const String& requestId) OVERRIDE; | 136 virtual void replayXHR(ErrorString*, const String& requestId) OVERRIDE; |
| 138 | 137 |
| 139 virtual void canClearBrowserCache(ErrorString*, bool*) OVERRIDE; | 138 virtual void canClearBrowserCache(ErrorString*, bool*) OVERRIDE; |
| 140 virtual void clearBrowserCache(ErrorString*) OVERRIDE; | |
| 141 virtual void canClearBrowserCookies(ErrorString*, bool*) OVERRIDE; | 139 virtual void canClearBrowserCookies(ErrorString*, bool*) OVERRIDE; |
| 142 virtual void clearBrowserCookies(ErrorString*) OVERRIDE; | |
| 143 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; | 140 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) OVERRIDE; |
| 144 | 141 |
| 145 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; | 142 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResour
ceForFrontendCallback>) OVERRIDE; |
| 146 | 143 |
| 147 // Called from other agents. | 144 // Called from other agents. |
| 148 bool fetchResourceContent(LocalFrame*, const KURL&, String* content, bool* b
ase64Encoded); | 145 bool fetchResourceContent(LocalFrame*, const KURL&, String* content, bool* b
ase64Encoded); |
| 149 | 146 |
| 150 private: | 147 private: |
| 151 InspectorResourceAgent(InspectorPageAgent*, InspectorClient*); | 148 InspectorResourceAgent(InspectorPageAgent*); |
| 152 | 149 |
| 153 void enable(); | 150 void enable(); |
| 154 | 151 |
| 155 InspectorPageAgent* m_pageAgent; | 152 InspectorPageAgent* m_pageAgent; |
| 156 InspectorClient* m_client; | |
| 157 InspectorFrontend::Network* m_frontend; | 153 InspectorFrontend::Network* m_frontend; |
| 158 String m_userAgentOverride; | 154 String m_userAgentOverride; |
| 159 OwnPtr<NetworkResourcesData> m_resourcesData; | 155 OwnPtr<NetworkResourcesData> m_resourcesData; |
| 160 | 156 |
| 161 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; | 157 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; |
| 162 PendingXHRReplayDataMap m_pendingXHRReplayData; | 158 PendingXHRReplayDataMap m_pendingXHRReplayData; |
| 163 | 159 |
| 164 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; | 160 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; |
| 165 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; | 161 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; |
| 166 | 162 |
| 167 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 163 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
| 168 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 164 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
| 169 bool m_isRecalculatingStyle; | 165 bool m_isRecalculatingStyle; |
| 170 }; | 166 }; |
| 171 | 167 |
| 172 } // namespace WebCore | 168 } // namespace WebCore |
| 173 | 169 |
| 174 | 170 |
| 175 #endif // !defined(InspectorResourceAgent_h) | 171 #endif // !defined(InspectorResourceAgent_h) |
| OLD | NEW |