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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 ~PingLoaderImpl() override; | 201 ~PingLoaderImpl() override; |
202 | 202 |
203 DECLARE_VIRTUAL_TRACE(); | 203 DECLARE_VIRTUAL_TRACE(); |
204 | 204 |
205 private: | 205 private: |
206 void dispose(); | 206 void dispose(); |
207 | 207 |
208 // WebURLLoaderClient | 208 // WebURLLoaderClient |
209 bool willFollowRedirect(WebURLRequest&, const WebURLResponse&) override; | 209 bool willFollowRedirect(WebURLRequest&, const WebURLResponse&) override; |
210 void didReceiveResponse(const WebURLResponse&) final; | 210 void didReceiveResponse(const WebURLResponse&) final; |
211 void didReceiveData(const char*, int, int) final; | 211 void didReceiveData(const char*, int) final; |
212 void didFinishLoading(double, int64_t, int64_t) final; | 212 void didFinishLoading(double, int64_t, int64_t) final; |
213 void didFail(const WebURLError&, int64_t, int64_t) final; | 213 void didFail(const WebURLError&, int64_t, int64_t) final; |
214 | 214 |
215 void timeout(TimerBase*); | 215 void timeout(TimerBase*); |
216 | 216 |
217 void didFailLoading(LocalFrame*); | 217 void didFailLoading(LocalFrame*); |
218 | 218 |
219 std::unique_ptr<WebURLLoader> m_loader; | 219 std::unique_ptr<WebURLLoader> m_loader; |
220 Timer<PingLoaderImpl> m_timeout; | 220 Timer<PingLoaderImpl> m_timeout; |
221 String m_url; | 221 String m_url; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", | 335 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", |
336 InspectorResourceFinishEvent::data(m_identifier, 0, true)); | 336 InspectorResourceFinishEvent::data(m_identifier, 0, true)); |
337 const ResourceResponse& resourceResponse = response.toResourceResponse(); | 337 const ResourceResponse& resourceResponse = response.toResourceResponse(); |
338 InspectorInstrumentation::didReceiveResourceResponse(frame, m_identifier, 0, | 338 InspectorInstrumentation::didReceiveResourceResponse(frame, m_identifier, 0, |
339 resourceResponse, 0); | 339 resourceResponse, 0); |
340 didFailLoading(frame); | 340 didFailLoading(frame); |
341 } | 341 } |
342 dispose(); | 342 dispose(); |
343 } | 343 } |
344 | 344 |
345 void PingLoaderImpl::didReceiveData(const char*, int, int) { | 345 void PingLoaderImpl::didReceiveData(const char*, int) { |
346 if (LocalFrame* frame = this->frame()) { | 346 if (LocalFrame* frame = this->frame()) { |
347 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", | 347 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", |
348 InspectorResourceFinishEvent::data(m_identifier, 0, true)); | 348 InspectorResourceFinishEvent::data(m_identifier, 0, true)); |
349 didFailLoading(frame); | 349 didFailLoading(frame); |
350 } | 350 } |
351 dispose(); | 351 dispose(); |
352 } | 352 } |
353 | 353 |
354 void PingLoaderImpl::didFinishLoading(double, int64_t, int64_t) { | 354 void PingLoaderImpl::didFinishLoading(double, int64_t, int64_t) { |
355 if (LocalFrame* frame = this->frame()) { | 355 if (LocalFrame* frame = this->frame()) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 bool PingLoader::sendBeacon(LocalFrame* frame, | 553 bool PingLoader::sendBeacon(LocalFrame* frame, |
554 int allowance, | 554 int allowance, |
555 const KURL& beaconURL, | 555 const KURL& beaconURL, |
556 Blob* data, | 556 Blob* data, |
557 int& payloadLength) { | 557 int& payloadLength) { |
558 BeaconBlob beacon(data); | 558 BeaconBlob beacon(data); |
559 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 559 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
560 } | 560 } |
561 | 561 |
562 } // namespace blink | 562 } // namespace blink |
OLD | NEW |