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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 public: | 206 public: |
207 PingLoaderImpl(LocalFrame*, ResourceRequest&, const AtomicString&, StoredCre
dentials, bool); | 207 PingLoaderImpl(LocalFrame*, ResourceRequest&, const AtomicString&, StoredCre
dentials, bool); |
208 ~PingLoaderImpl() override; | 208 ~PingLoaderImpl() override; |
209 | 209 |
210 DECLARE_VIRTUAL_TRACE(); | 210 DECLARE_VIRTUAL_TRACE(); |
211 | 211 |
212 private: | 212 private: |
213 void dispose(); | 213 void dispose(); |
214 | 214 |
215 // WebURLLoaderClient | 215 // WebURLLoaderClient |
216 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&
, int64_t encodedDataLength) override; | 216 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&
) override; |
217 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; | 217 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; |
218 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; | 218 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; |
219 void didFinishLoading(WebURLLoader*, double, int64_t) final; | 219 void didFinishLoading(WebURLLoader*, double, int64_t) final; |
220 void didFail(WebURLLoader*, const WebURLError&) final; | 220 void didFail(WebURLLoader*, const WebURLError&) final; |
221 | 221 |
222 void timeout(TimerBase*); | 222 void timeout(TimerBase*); |
223 | 223 |
224 void didFailLoading(LocalFrame*); | 224 void didFailLoading(LocalFrame*); |
225 | 225 |
226 std::unique_ptr<WebURLLoader> m_loader; | 226 std::unique_ptr<WebURLLoader> m_loader; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 void PingLoaderImpl::dispose() | 283 void PingLoaderImpl::dispose() |
284 { | 284 { |
285 if (m_loader) { | 285 if (m_loader) { |
286 m_loader->cancel(); | 286 m_loader->cancel(); |
287 m_loader = nullptr; | 287 m_loader = nullptr; |
288 } | 288 } |
289 m_timeout.stop(); | 289 m_timeout.stop(); |
290 m_keepAlive.clear(); | 290 m_keepAlive.clear(); |
291 } | 291 } |
292 | 292 |
293 void PingLoaderImpl::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR
equest, const WebURLResponse& passedRedirectResponse, int64_t encodedDataLength) | 293 void PingLoaderImpl::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR
equest, const WebURLResponse& passedRedirectResponse) |
294 { | 294 { |
295 if (!m_isBeacon) | 295 if (!m_isBeacon) |
296 return; | 296 return; |
297 | 297 |
298 // TODO(tyoshino): Check if setAllowStoredCredentials() should be called | 298 // TODO(tyoshino): Check if setAllowStoredCredentials() should be called |
299 // also for non beacon cases. | 299 // also for non beacon cases. |
300 passedNewRequest.setAllowStoredCredentials(true); | 300 passedNewRequest.setAllowStoredCredentials(true); |
301 if (m_corsMode == NotCORSEnabled) | 301 if (m_corsMode == NotCORSEnabled) |
302 return; | 302 return; |
303 | 303 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 496 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
497 } | 497 } |
498 | 498 |
499 bool PingLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beacon
URL, Blob* data, int& payloadLength) | 499 bool PingLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beacon
URL, Blob* data, int& payloadLength) |
500 { | 500 { |
501 BeaconBlob beacon(data); | 501 BeaconBlob beacon(data); |
502 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 502 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
503 } | 503 } |
504 | 504 |
505 } // namespace blink | 505 } // namespace blink |
OLD | NEW |