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 20 matching lines...) Expand all Loading... |
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 "core/inspector/InspectorPageAgent.h" |
39 #include "platform/Timer.h" | 39 #include "platform/Timer.h" |
40 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
| 41 #include "platform/network/ResourceRequest.h" |
41 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
42 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
45 | 46 |
46 class Resource; | 47 class Resource; |
47 struct FetchInitiatorInfo; | 48 struct FetchInitiatorInfo; |
48 class Document; | 49 class Document; |
49 class DocumentLoader; | 50 class DocumentLoader; |
50 class ExecutionContext; | 51 class ExecutionContext; |
51 class FormData; | 52 class FormData; |
52 class LocalFrame; | 53 class LocalFrame; |
53 class HTTPHeaderMap; | 54 class HTTPHeaderMap; |
54 class InspectorFrontend; | 55 class InspectorFrontend; |
55 class InspectorPageAgent; | 56 class InspectorPageAgent; |
56 class JSONObject; | 57 class JSONObject; |
57 class KURL; | 58 class KURL; |
58 class NetworkResourcesData; | 59 class NetworkResourcesData; |
59 class ResourceError; | 60 class ResourceError; |
60 class ResourceLoader; | 61 class ResourceLoader; |
61 class ResourceRequest; | |
62 class ResourceResponse; | 62 class ResourceResponse; |
63 class ThreadableLoaderClient; | 63 class ThreadableLoaderClient; |
64 class XHRReplayData; | 64 class XHRReplayData; |
65 class XMLHttpRequest; | 65 class XMLHttpRequest; |
66 | 66 |
67 class WebSocketHandshakeRequest; | 67 class WebSocketHandshakeRequest; |
68 class WebSocketHandshakeResponse; | 68 class WebSocketHandshakeResponse; |
69 | 69 |
70 typedef String ErrorString; | 70 typedef String ErrorString; |
71 | 71 |
72 class CORE_EXPORT InspectorResourceAgent final : public InspectorBaseAgent<Inspe
ctorResourceAgent, InspectorFrontend::Network>, public InspectorBackendDispatche
r::NetworkCommandHandler { | 72 class CORE_EXPORT InspectorResourceAgent final : public InspectorBaseAgent<Inspe
ctorResourceAgent, InspectorFrontend::Network>, public InspectorBackendDispatche
r::NetworkCommandHandler { |
73 public: | 73 public: |
74 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg
ent* pageAgent) | 74 static PassOwnPtrWillBeRawPtr<InspectorResourceAgent> create(InspectorPageAg
ent* pageAgent) |
75 { | 75 { |
76 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent)); | 76 return adoptPtrWillBeNoop(new InspectorResourceAgent(pageAgent)); |
77 } | 77 } |
78 | 78 |
79 void disable(ErrorString*) override; | 79 void disable(ErrorString*) override; |
80 void restore() override; | 80 void restore() override; |
81 | 81 |
82 ~InspectorResourceAgent() override; | 82 ~InspectorResourceAgent() override; |
83 DECLARE_VIRTUAL_TRACE(); | 83 DECLARE_VIRTUAL_TRACE(); |
84 | 84 |
85 // Called from instrumentation. | 85 // Called from instrumentation. |
| 86 void didBlockRequest(LocalFrame*, const ResourceRequest&, DocumentLoader*, c
onst FetchInitiatorInfo&, ResourceRequestBlockedReason); |
86 void willSendRequest(LocalFrame*, unsigned long identifier, DocumentLoader*,
ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiato
rInfo&); | 87 void willSendRequest(LocalFrame*, unsigned long identifier, DocumentLoader*,
ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiato
rInfo&); |
87 void markResourceAsCached(unsigned long identifier); | 88 void markResourceAsCached(unsigned long identifier); |
88 void didReceiveResourceResponse(LocalFrame*, unsigned long identifier, Docum
entLoader*, const ResourceResponse&, ResourceLoader*); | 89 void didReceiveResourceResponse(LocalFrame*, unsigned long identifier, Docum
entLoader*, const ResourceResponse&, ResourceLoader*); |
89 void didReceiveData(LocalFrame*, unsigned long identifier, const char* data,
int dataLength, int encodedDataLength); | 90 void didReceiveData(LocalFrame*, unsigned long identifier, const char* data,
int dataLength, int encodedDataLength); |
90 void didFinishLoading(unsigned long identifier, double monotonicFinishTime,
int64_t encodedDataLength); | 91 void didFinishLoading(unsigned long identifier, double monotonicFinishTime,
int64_t encodedDataLength); |
91 void didReceiveCORSRedirectResponse(LocalFrame*, unsigned long identifier, D
ocumentLoader*, const ResourceResponse&, ResourceLoader*); | 92 void didReceiveCORSRedirectResponse(LocalFrame*, unsigned long identifier, D
ocumentLoader*, const ResourceResponse&, ResourceLoader*); |
92 void didFailLoading(unsigned long identifier, const ResourceError&); | 93 void didFailLoading(unsigned long identifier, const ResourceError&); |
93 void didCommitLoad(LocalFrame*, DocumentLoader*); | 94 void didCommitLoad(LocalFrame*, DocumentLoader*); |
94 void scriptImported(unsigned long identifier, const String& sourceString); | 95 void scriptImported(unsigned long identifier, const String& sourceString); |
95 void didReceiveScriptResponse(unsigned long identifier); | 96 void didReceiveScriptResponse(unsigned long identifier); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void canClearBrowserCache(ErrorString*, bool*) override; | 145 void canClearBrowserCache(ErrorString*, bool*) override; |
145 void canClearBrowserCookies(ErrorString*, bool*) override; | 146 void canClearBrowserCookies(ErrorString*, bool*) override; |
146 void emulateNetworkConditions(ErrorString*, bool, double, double, double) ov
erride; | 147 void emulateNetworkConditions(ErrorString*, bool, double, double, double) ov
erride; |
147 void setCacheDisabled(ErrorString*, bool cacheDisabled) override; | 148 void setCacheDisabled(ErrorString*, bool cacheDisabled) override; |
148 | 149 |
149 void setDataSizeLimitsForTest(ErrorString*, int maxTotal, int maxResource) o
verride; | 150 void setDataSizeLimitsForTest(ErrorString*, int maxTotal, int maxResource) o
verride; |
150 | 151 |
151 // Called from other agents. | 152 // Called from other agents. |
152 void setHostId(const String&); | 153 void setHostId(const String&); |
153 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); | 154 bool fetchResourceContent(Document*, const KURL&, String* content, bool* bas
e64Encoded); |
154 bool shouldBlockRequest(LocalFrame*, const ResourceRequest&, DocumentLoader*
, const FetchInitiatorInfo&); | 155 bool shouldBlockRequest(const ResourceRequest&); |
155 | 156 |
156 private: | 157 private: |
157 explicit InspectorResourceAgent(InspectorPageAgent*); | 158 explicit InspectorResourceAgent(InspectorPageAgent*); |
158 | 159 |
159 void enable(); | 160 void enable(); |
160 void willSendRequestInternal(LocalFrame*, unsigned long identifier, Document
Loader*, const ResourceRequest&, const ResourceResponse& redirectResponse, const
FetchInitiatorInfo&); | 161 void willSendRequestInternal(LocalFrame*, unsigned long identifier, Document
Loader*, const ResourceRequest&, const ResourceResponse& redirectResponse, const
FetchInitiatorInfo&); |
161 void delayedRemoveReplayXHR(XMLHttpRequest*); | 162 void delayedRemoveReplayXHR(XMLHttpRequest*); |
162 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); | 163 void removeFinishedReplayXHRFired(Timer<InspectorResourceAgent>*); |
163 void didFinishXHRInternal(ExecutionContext*, XMLHttpRequest*, ThreadableLoad
erClient*, const AtomicString&, const String&, bool); | 164 void didFinishXHRInternal(ExecutionContext*, XMLHttpRequest*, ThreadableLoad
erClient*, const AtomicString&, const String&, bool); |
164 | 165 |
(...skipping 24 matching lines...) Expand all Loading... |
189 | 190 |
190 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRs; | 191 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRs; |
191 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRsT
oBeDeleted; | 192 PersistentHeapHashSetWillBeHeapHashSet<Member<XMLHttpRequest>> m_replayXHRsT
oBeDeleted; |
192 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; | 193 Timer<InspectorResourceAgent> m_removeFinishedReplayXHRTimer; |
193 }; | 194 }; |
194 | 195 |
195 } // namespace blink | 196 } // namespace blink |
196 | 197 |
197 | 198 |
198 #endif // !defined(InspectorResourceAgent_h) | 199 #endif // !defined(InspectorResourceAgent_h) |
OLD | NEW |