| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 class Document; | 52 class Document; |
| 53 class DocumentLoader; | 53 class DocumentLoader; |
| 54 class FormData; | 54 class FormData; |
| 55 class Frame; | 55 class Frame; |
| 56 class HTTPHeaderMap; | 56 class HTTPHeaderMap; |
| 57 class InspectorArray; | 57 class InspectorArray; |
| 58 class InspectorClient; | 58 class InspectorClient; |
| 59 class InspectorFrontend; | 59 class InspectorFrontend; |
| 60 class InspectorObject; | 60 class InspectorObject; |
| 61 class InspectorPageAgent; | 61 class InspectorPageAgent; |
| 62 class InspectorPageFactory; |
| 62 class InspectorState; | 63 class InspectorState; |
| 63 class InstrumentingAgents; | 64 class InstrumentingAgents; |
| 64 class KURL; | 65 class KURL; |
| 65 class NetworkResourcesData; | 66 class NetworkResourcesData; |
| 66 class Page; | 67 class Page; |
| 67 class ResourceError; | 68 class ResourceError; |
| 68 class ResourceLoader; | 69 class ResourceLoader; |
| 69 class ResourceRequest; | 70 class ResourceRequest; |
| 70 class ResourceResponse; | 71 class ResourceResponse; |
| 71 class SharedBuffer; | 72 class SharedBuffer; |
| 72 class ThreadableLoaderClient; | 73 class ThreadableLoaderClient; |
| 73 class XHRReplayData; | 74 class XHRReplayData; |
| 74 class XMLHttpRequest; | 75 class XMLHttpRequest; |
| 75 | 76 |
| 76 struct WebSocketFrame; | 77 struct WebSocketFrame; |
| 77 class WebSocketHandshakeRequest; | 78 class WebSocketHandshakeRequest; |
| 78 class WebSocketHandshakeResponse; | 79 class WebSocketHandshakeResponse; |
| 79 | 80 |
| 80 typedef String ErrorString; | 81 typedef String ErrorString; |
| 81 | 82 |
| 82 class InspectorResourceAgent : public InspectorBaseAgent<InspectorResourceAgent>
, public InspectorBackendDispatcher::NetworkCommandHandler { | 83 class InspectorResourceAgent : public InspectorBaseAgent, public InspectorBacken
dDispatcher::NetworkCommandHandler { |
| 83 public: | 84 public: |
| 84 static PassOwnPtr<InspectorResourceAgent> create(InstrumentingAgents* instru
mentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client, Inspector
CompositeState* state) | 85 static PassRefPtr<InspectorResourceAgent> create(InstrumentingAgents*, Inspe
ctorState*, PassRefPtr<InspectorPageAgent>, InspectorClient*); |
| 85 { | |
| 86 return adoptPtr(new InspectorResourceAgent(instrumentingAgents, pageAgen
t, client, state)); | |
| 87 } | |
| 88 | 86 |
| 89 virtual void setFrontend(InspectorFrontend*); | 87 virtual void setFrontend(InspectorFrontend*); |
| 90 virtual void clearFrontend(); | 88 virtual void clearFrontend(); |
| 91 virtual void restore(); | 89 virtual void restore(); |
| 92 | 90 |
| 93 static PassRefPtr<InspectorResourceAgent> restore(Page*, InspectorCompositeS
tate*, InspectorFrontend*); | 91 virtual ~InspectorResourceAgent(); |
| 94 | |
| 95 ~InspectorResourceAgent(); | |
| 96 | 92 |
| 97 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const CachedResourceInitiatorInf
o&); | 93 void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequ
est&, const ResourceResponse& redirectResponse, const CachedResourceInitiatorInf
o&); |
| 98 void markResourceAsCached(unsigned long identifier); | 94 void markResourceAsCached(unsigned long identifier); |
| 99 void didReceiveResourceResponse(unsigned long identifier, DocumentLoader*, c
onst ResourceResponse&, ResourceLoader*); | 95 void didReceiveResourceResponse(unsigned long identifier, DocumentLoader*, c
onst ResourceResponse&, ResourceLoader*); |
| 100 void didReceiveData(unsigned long identifier, const char* data, int dataLeng
th, int encodedDataLength); | 96 void didReceiveData(unsigned long identifier, const char* data, int dataLeng
th, int encodedDataLength); |
| 101 void didFinishLoading(unsigned long identifier, DocumentLoader*, double mono
tonicFinishTime); | 97 void didFinishLoading(unsigned long identifier, DocumentLoader*, double mono
tonicFinishTime); |
| 102 void didFailLoading(unsigned long identifier, DocumentLoader*, const Resourc
eError&); | 98 void didFailLoading(unsigned long identifier, DocumentLoader*, const Resourc
eError&); |
| 103 void didCommitLoad(Frame*, DocumentLoader*); | 99 void didCommitLoad(Frame*, DocumentLoader*); |
| 104 void scriptImported(unsigned long identifier, const String& sourceString); | 100 void scriptImported(unsigned long identifier, const String& sourceString); |
| 105 void didReceiveScriptResponse(unsigned long identifier); | 101 void didReceiveScriptResponse(unsigned long identifier); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 virtual void clearBrowserCache(ErrorString*); | 143 virtual void clearBrowserCache(ErrorString*); |
| 148 virtual void canClearBrowserCookies(ErrorString*, bool*); | 144 virtual void canClearBrowserCookies(ErrorString*, bool*); |
| 149 virtual void clearBrowserCookies(ErrorString*); | 145 virtual void clearBrowserCookies(ErrorString*); |
| 150 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled); | 146 virtual void setCacheDisabled(ErrorString*, bool cacheDisabled); |
| 151 | 147 |
| 152 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, PassRefPtr<LoadResourceForFrontendCallback>); | 148 virtual void loadResourceForFrontend(ErrorString*, const String& frameId, co
nst String& url, PassRefPtr<LoadResourceForFrontendCallback>); |
| 153 | 149 |
| 154 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; | 150 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; |
| 155 | 151 |
| 156 private: | 152 private: |
| 157 InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorC
lient*, InspectorCompositeState*); | 153 InspectorResourceAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<Ins
pectorPageAgent>, InspectorClient*); |
| 158 | 154 |
| 159 void enable(); | 155 void enable(); |
| 160 | 156 |
| 161 InspectorPageAgent* m_pageAgent; | 157 RefPtr<InspectorPageAgent> m_pageAgent; |
| 162 InspectorClient* m_client; | 158 InspectorClient* m_client; |
| 163 InspectorFrontend::Network* m_frontend; | 159 InspectorFrontend::Network* m_frontend; |
| 164 String m_userAgentOverride; | 160 String m_userAgentOverride; |
| 165 OwnPtr<NetworkResourcesData> m_resourcesData; | 161 OwnPtr<NetworkResourcesData> m_resourcesData; |
| 166 bool m_loadingXHRSynchronously; | 162 bool m_loadingXHRSynchronously; |
| 167 | 163 |
| 168 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; | 164 typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRR
eplayDataMap; |
| 169 PendingXHRReplayDataMap m_pendingXHRReplayData; | 165 PendingXHRReplayDataMap m_pendingXHRReplayData; |
| 170 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 166 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
| 171 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 167 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
| 172 bool m_isRecalculatingStyle; | 168 bool m_isRecalculatingStyle; |
| 173 }; | 169 }; |
| 174 | 170 |
| 171 class InspectorResourceFactory : public InspectorBaseFactory<InspectorResourceFa
ctory, InspectorResourceAgent> { |
| 172 public: |
| 173 |
| 174 static PassOwnPtr<InspectorResourceFactory> create(InstrumentingAgents* inst
rumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory*
pageFactory, InspectorClient* client) |
| 175 { |
| 176 return adoptPtr(new InspectorResourceFactory(instrumentingAgents, compos
iteState, pageFactory, client)); |
| 177 } |
| 178 |
| 179 protected: |
| 180 InspectorResourceFactory(InstrumentingAgents*, InspectorCompositeState*, Ins
pectorPageFactory*, InspectorClient*); |
| 181 }; |
| 182 |
| 175 } // namespace WebCore | 183 } // namespace WebCore |
| 176 | 184 |
| 177 | 185 |
| 178 #endif // !defined(InspectorResourceAgent_h) | 186 #endif // !defined(InspectorResourceAgent_h) |
| OLD | NEW |