| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef InspectorResourceAgent_h | 31 #ifndef InspectorResourceAgent_h |
| 32 #define InspectorResourceAgent_h | 32 #define InspectorResourceAgent_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptString.h" | 34 #include "bindings/core/v8/ScriptString.h" |
| 35 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
| 36 #include "core/InspectorFrontend.h" | 36 #include "core/InspectorFrontend.h" |
| 37 #include "core/inspector/InspectorBaseAgent.h" | 37 #include "core/inspector/InspectorBaseAgent.h" |
| 38 #include "core/inspector/InspectorPageAgent.h" |
| 38 #include "platform/Timer.h" | 39 #include "platform/Timer.h" |
| 39 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
| 40 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
| 41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 class Resource; | 46 class Resource; |
| 46 struct FetchInitiatorInfo; | 47 struct FetchInitiatorInfo; |
| 47 class Document; | 48 class Document; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void didCommitLoad(LocalFrame*, DocumentLoader*); | 93 void didCommitLoad(LocalFrame*, DocumentLoader*); |
| 93 void scriptImported(unsigned long identifier, const String& sourceString); | 94 void scriptImported(unsigned long identifier, const String& sourceString); |
| 94 void didReceiveScriptResponse(unsigned long identifier); | 95 void didReceiveScriptResponse(unsigned long identifier); |
| 95 bool shouldForceCORSPreflight(); | 96 bool shouldForceCORSPreflight(); |
| 96 | 97 |
| 97 void documentThreadableLoaderStartedLoadingForClient(unsigned long identifie
r, ThreadableLoaderClient*); | 98 void documentThreadableLoaderStartedLoadingForClient(unsigned long identifie
r, ThreadableLoaderClient*); |
| 98 void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicStrin
g& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderM
ap& headers, bool includeCrendentials); | 99 void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicStrin
g& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderM
ap& headers, bool includeCrendentials); |
| 99 void didFailXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoaderC
lient*, const AtomicString&, const String&); | 100 void didFailXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoaderC
lient*, const AtomicString&, const String&); |
| 100 void didFinishXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoade
rClient*, const AtomicString&, const String&); | 101 void didFinishXHRLoading(ExecutionContext*, XMLHttpRequest*, ThreadableLoade
rClient*, const AtomicString&, const String&); |
| 101 | 102 |
| 103 void willStartFetch(ThreadableLoaderClient*); |
| 104 void didFailFetch(ThreadableLoaderClient*); |
| 105 void didFinishFetch(ExecutionContext*, ThreadableLoaderClient*, const Atomic
String& method, const String& url); |
| 106 |
| 102 void willSendEventSourceRequest(ThreadableLoaderClient*); | 107 void willSendEventSourceRequest(ThreadableLoaderClient*); |
| 103 void willDispachEventSourceEvent(ThreadableLoaderClient*, const AtomicString
& eventName, const AtomicString& eventId, const Vector<UChar>& data); | 108 void willDispachEventSourceEvent(ThreadableLoaderClient*, const AtomicString
& eventName, const AtomicString& eventId, const Vector<UChar>& data); |
| 104 void didFinishEventSourceRequest(ThreadableLoaderClient*); | 109 void didFinishEventSourceRequest(ThreadableLoaderClient*); |
| 105 | 110 |
| 106 void willDestroyResource(Resource*); | 111 void willDestroyResource(Resource*); |
| 107 | 112 |
| 108 void applyUserAgentOverride(String* userAgent); | 113 void applyUserAgentOverride(String* userAgent); |
| 109 | 114 |
| 110 // FIXME: InspectorResourceAgent should not be aware of style recalculation. | 115 // FIXME: InspectorResourceAgent should not be aware of style recalculation. |
| 111 void willRecalculateStyle(Document*); | 116 void willRecalculateStyle(Document*); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 160 |
| 156 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get
ResponseBodyCallback>); | 161 bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<Get
ResponseBodyCallback>); |
| 157 | 162 |
| 158 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 163 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 159 String m_userAgentOverride; | 164 String m_userAgentOverride; |
| 160 String m_hostId; | 165 String m_hostId; |
| 161 OwnPtr<NetworkResourcesData> m_resourcesData; | 166 OwnPtr<NetworkResourcesData> m_resourcesData; |
| 162 | 167 |
| 163 typedef HashMap<ThreadableLoaderClient*, unsigned long> ThreadableLoaderClie
ntRequestIdMap; | 168 typedef HashMap<ThreadableLoaderClient*, unsigned long> ThreadableLoaderClie
ntRequestIdMap; |
| 164 | 169 |
| 165 // Stores the data for replaying XHR until an identifier for the load is | 170 // Stores the pending ThreadableLoaderClient till an identifier for |
| 166 // generated by the loader and passed to the inspector via the | 171 // the load is generated by the loader and passed to the inspector |
| 167 // documentThreadableLoaderStartedLoadingForClient() method. | 172 // via the documentThreadableLoaderStartedLoadingForClient() method. |
| 168 ThreadableLoaderClient* m_pendingXHR; | 173 ThreadableLoaderClient* m_pendingRequest; |
| 174 InspectorPageAgent::ResourceType m_pendingRequestType; |
| 175 ThreadableLoaderClientRequestIdMap m_knownRequestIdMap; |
| 176 |
| 169 RefPtrWillBeMember<XHRReplayData> m_pendingXHRReplayData; | 177 RefPtrWillBeMember<XHRReplayData> m_pendingXHRReplayData; |
| 170 ThreadableLoaderClientRequestIdMap m_xhrRequestIdMap; | |
| 171 | |
| 172 // Stores the pointer to the ThreadableLoaderClient for an EventSource | |
| 173 // (actually, the EventSource instance itself) for which a loader is being | |
| 174 // initialized, until an identifier for the load is generated by the loader | |
| 175 // and passed to the inspector via the | |
| 176 // documentThreadableLoaderStartedLoadingForClient() method. | |
| 177 // | |
| 178 // Since the DocumentThreadableLoader may call | |
| 179 // documentThreadableLoaderStartedLoadingForClient() only synchronously to | |
| 180 // the creation of the loader, it's unnecessary to store the pointer to a | |
| 181 // map. | |
| 182 ThreadableLoaderClient* m_pendingEventSource; | |
| 183 ThreadableLoaderClientRequestIdMap m_eventSourceRequestIdMap; | |
| 184 | 178 |
| 185 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; | 179 typedef HashMap<String, RefPtr<TypeBuilder::Network::Initiator> > FrameNavig
ationInitiatorMap; |
| 186 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; | 180 FrameNavigationInitiatorMap m_frameNavigationInitiatorMap; |
| 187 | 181 |
| 188 // FIXME: InspectorResourceAgent should now be aware of style recalculation. | 182 // FIXME: InspectorResourceAgent should now be aware of style recalculation. |
| 189 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; | 183 RefPtr<TypeBuilder::Network::Initiator> m_styleRecalculationInitiator; |
| 190 bool m_isRecalculatingStyle; | 184 bool m_isRecalculatingStyle; |
| 191 | 185 |
| 192 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRs; | 186 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRs; |
| 193 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRsT
oBeDeleted; | 187 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRsT
oBeDeleted; |
| 194 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; | 188 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; |
| 195 }; | 189 }; |
| 196 | 190 |
| 197 } // namespace blink | 191 } // namespace blink |
| 198 | 192 |
| 199 | 193 |
| 200 #endif // !defined(InspectorResourceAgent_h) | 194 #endif // !defined(InspectorResourceAgent_h) |
| OLD | NEW |