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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 | 60 |
61 class WebSocketHandshakeRequest; | 61 class WebSocketHandshakeRequest; |
62 class WebSocketHandshakeResponse; | 62 class WebSocketHandshakeResponse; |
63 | 63 |
64 class CORE_EXPORT InspectorNetworkAgent final | 64 class CORE_EXPORT InspectorNetworkAgent final |
65 : public InspectorBaseAgent<protocol::Network::Metainfo> { | 65 : public InspectorBaseAgent<protocol::Network::Metainfo> { |
66 public: | 66 public: |
67 static InspectorNetworkAgent* Create(InspectedFrames* inspected_frames) { | 67 static InspectorNetworkAgent* Create(InspectedFrames* inspected_frames) { |
68 return new InspectorNetworkAgent(inspected_frames); | 68 return new InspectorNetworkAgent(inspected_frames); |
69 } | 69 } |
70 static InspectorNetworkAgent* CreateForWorker( | |
71 ExecutionContext* worker_global_scope) { | |
72 return new InspectorNetworkAgent(worker_global_scope); | |
kinuko
2017/05/22 07:51:02
Could you update the parameter name as well?
horo
2017/05/22 10:42:39
Done.
| |
73 } | |
70 | 74 |
71 void Restore() override; | 75 void Restore() override; |
72 | 76 |
73 ~InspectorNetworkAgent() override; | 77 ~InspectorNetworkAgent() override; |
74 DECLARE_VIRTUAL_TRACE(); | 78 DECLARE_VIRTUAL_TRACE(); |
75 | 79 |
76 // Probes. | 80 // Probes. |
77 void DidBlockRequest(LocalFrame*, | 81 void DidBlockRequest(const ResourceRequest&, |
78 const ResourceRequest&, | |
79 DocumentLoader*, | 82 DocumentLoader*, |
80 const FetchInitiatorInfo&, | 83 const FetchInitiatorInfo&, |
81 ResourceRequestBlockedReason); | 84 ResourceRequestBlockedReason); |
82 void DidChangeResourcePriority(unsigned long identifier, | 85 void DidChangeResourcePriority(unsigned long identifier, |
83 ResourceLoadPriority); | 86 ResourceLoadPriority); |
84 void WillSendRequest(LocalFrame*, | 87 void WillSendRequest(unsigned long identifier, |
85 unsigned long identifier, | |
86 DocumentLoader*, | 88 DocumentLoader*, |
87 ResourceRequest&, | 89 ResourceRequest&, |
88 const ResourceResponse& redirect_response, | 90 const ResourceResponse& redirect_response, |
89 const FetchInitiatorInfo&); | 91 const FetchInitiatorInfo&); |
90 void MarkResourceAsCached(unsigned long identifier); | 92 void MarkResourceAsCached(unsigned long identifier); |
91 void DidReceiveResourceResponse(LocalFrame*, | 93 void DidReceiveResourceResponse(unsigned long identifier, |
92 unsigned long identifier, | |
93 DocumentLoader*, | 94 DocumentLoader*, |
94 const ResourceResponse&, | 95 const ResourceResponse&, |
95 Resource*); | 96 Resource*); |
96 void DidReceiveData(LocalFrame*, | 97 void DidReceiveData(unsigned long identifier, |
97 unsigned long identifier, | 98 DocumentLoader*, |
98 const char* data, | 99 const char* data, |
99 int data_length); | 100 int data_length); |
100 void DidReceiveEncodedDataLength(LocalFrame*, | 101 void DidReceiveEncodedDataLength(unsigned long identifier, |
101 unsigned long identifier, | |
102 int encoded_data_length); | 102 int encoded_data_length); |
103 void DidFinishLoading(LocalFrame*, | 103 void DidFinishLoading(unsigned long identifier, |
104 unsigned long identifier, | 104 DocumentLoader*, |
105 double monotonic_finish_time, | 105 double monotonic_finish_time, |
106 int64_t encoded_data_length, | 106 int64_t encoded_data_length, |
107 int64_t decoded_body_length); | 107 int64_t decoded_body_length); |
108 void DidReceiveCORSRedirectResponse(LocalFrame*, | 108 void DidReceiveCORSRedirectResponse(LocalFrame*, |
109 unsigned long identifier, | 109 unsigned long identifier, |
110 DocumentLoader*, | 110 DocumentLoader*, |
111 const ResourceResponse&, | 111 const ResourceResponse&, |
112 Resource*); | 112 Resource*); |
113 void DidFailLoading(unsigned long identifier, const ResourceError&); | 113 void DidFailLoading(unsigned long identifier, const ResourceError&); |
114 void DidCommitLoad(LocalFrame*, DocumentLoader*); | 114 void DidCommitLoad(LocalFrame*, DocumentLoader*); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 // Called from other agents. | 224 // Called from other agents. |
225 void SetHostId(const String&); | 225 void SetHostId(const String&); |
226 bool FetchResourceContent(Document*, | 226 bool FetchResourceContent(Document*, |
227 const KURL&, | 227 const KURL&, |
228 String* content, | 228 String* content, |
229 bool* base64_encoded); | 229 bool* base64_encoded); |
230 bool CacheDisabled(); | 230 bool CacheDisabled(); |
231 | 231 |
232 private: | 232 private: |
233 explicit InspectorNetworkAgent(InspectedFrames*); | 233 explicit InspectorNetworkAgent(InspectedFrames*); |
234 explicit InspectorNetworkAgent(ExecutionContext*); | |
234 | 235 |
235 void Enable(int total_buffer_size, int resource_buffer_size); | 236 void Enable(int total_buffer_size, int resource_buffer_size); |
236 void WillSendRequestInternal(LocalFrame*, | 237 void WillSendRequestInternal(unsigned long identifier, |
237 unsigned long identifier, | |
238 DocumentLoader*, | 238 DocumentLoader*, |
239 const ResourceRequest&, | 239 const ResourceRequest&, |
240 const ResourceResponse& redirect_response, | 240 const ResourceResponse& redirect_response, |
241 const FetchInitiatorInfo&); | 241 const FetchInitiatorInfo&); |
242 void DelayedRemoveReplayXHR(XMLHttpRequest*); | 242 void DelayedRemoveReplayXHR(XMLHttpRequest*); |
243 void RemoveFinishedReplayXHRFired(TimerBase*); | 243 void RemoveFinishedReplayXHRFired(TimerBase*); |
244 void DidFinishXHRInternal(ExecutionContext*, | 244 void DidFinishXHRInternal(ExecutionContext*, |
245 XMLHttpRequest*, | 245 XMLHttpRequest*, |
246 ThreadableLoaderClient*, | 246 ThreadableLoaderClient*, |
247 const AtomicString&, | 247 const AtomicString&, |
248 const String&, | 248 const String&, |
249 bool); | 249 bool); |
250 | 250 |
251 bool CanGetResponseBodyBlob(const String& request_id); | 251 bool CanGetResponseBodyBlob(const String& request_id); |
252 void GetResponseBodyBlob(const String& request_id, | 252 void GetResponseBodyBlob(const String& request_id, |
253 std::unique_ptr<GetResponseBodyCallback>); | 253 std::unique_ptr<GetResponseBodyCallback>); |
254 void ClearPendingRequestData(); | 254 void ClearPendingRequestData(); |
255 | 255 |
256 // This is null while inspecting workers. | |
256 Member<InspectedFrames> inspected_frames_; | 257 Member<InspectedFrames> inspected_frames_; |
258 // This is null while inspecting frames. | |
259 Member<ExecutionContext> worker_global_scope_; | |
kinuko
2017/05/22 07:51:02
execution_context_ ?
horo
2017/05/22 10:42:39
Done.
| |
257 String host_id_; | 260 String host_id_; |
258 Member<NetworkResourcesData> resources_data_; | 261 Member<NetworkResourcesData> resources_data_; |
259 | 262 |
260 typedef HashMap<ThreadableLoaderClient*, unsigned long> | 263 typedef HashMap<ThreadableLoaderClient*, unsigned long> |
261 ThreadableLoaderClientRequestIdMap; | 264 ThreadableLoaderClientRequestIdMap; |
262 | 265 |
263 // Stores the pending ThreadableLoaderClient till an identifier for | 266 // Stores the pending ThreadableLoaderClient till an identifier for |
264 // the load is generated by the loader and passed to the inspector | 267 // the load is generated by the loader and passed to the inspector |
265 // via the documentThreadableLoaderStartedLoadingForClient() method. | 268 // via the documentThreadableLoaderStartedLoadingForClient() method. |
266 ThreadableLoaderClient* pending_request_; | 269 ThreadableLoaderClient* pending_request_; |
267 InspectorPageAgent::ResourceType pending_request_type_; | 270 InspectorPageAgent::ResourceType pending_request_type_; |
268 ThreadableLoaderClientRequestIdMap known_request_id_map_; | 271 ThreadableLoaderClientRequestIdMap known_request_id_map_; |
269 | 272 |
270 Member<XHRReplayData> pending_xhr_replay_data_; | 273 Member<XHRReplayData> pending_xhr_replay_data_; |
271 | 274 |
272 typedef HashMap<String, std::unique_ptr<protocol::Network::Initiator>> | 275 typedef HashMap<String, std::unique_ptr<protocol::Network::Initiator>> |
273 FrameNavigationInitiatorMap; | 276 FrameNavigationInitiatorMap; |
274 FrameNavigationInitiatorMap frame_navigation_initiator_map_; | 277 FrameNavigationInitiatorMap frame_navigation_initiator_map_; |
275 HashSet<String> frames_with_scheduled_navigation_; | 278 HashSet<String> frames_with_scheduled_navigation_; |
276 HashSet<String> frames_with_scheduled_client_navigation_; | 279 HashSet<String> frames_with_scheduled_client_navigation_; |
277 | 280 |
278 HeapHashSet<Member<XMLHttpRequest>> replay_xhrs_; | 281 HeapHashSet<Member<XMLHttpRequest>> replay_xhrs_; |
279 HeapHashSet<Member<XMLHttpRequest>> replay_xhrs_to_be_deleted_; | 282 HeapHashSet<Member<XMLHttpRequest>> replay_xhrs_to_be_deleted_; |
280 TaskRunnerTimer<InspectorNetworkAgent> remove_finished_replay_xhr_timer_; | 283 TaskRunnerTimer<InspectorNetworkAgent> remove_finished_replay_xhr_timer_; |
281 }; | 284 }; |
282 | 285 |
283 } // namespace blink | 286 } // namespace blink |
284 | 287 |
285 #endif // !defined(InspectorNetworkAgent_h) | 288 #endif // !defined(InspectorNetworkAgent_h) |
OLD | NEW |