| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 ~PingLoaderImpl() override; | 199 ~PingLoaderImpl() override; |
| 200 | 200 |
| 201 DECLARE_VIRTUAL_TRACE(); | 201 DECLARE_VIRTUAL_TRACE(); |
| 202 | 202 |
| 203 private: | 203 private: |
| 204 void dispose(); | 204 void dispose(); |
| 205 | 205 |
| 206 // WebURLLoaderClient | 206 // WebURLLoaderClient |
| 207 void willFollowRedirect(WebURLLoader*, | 207 void willFollowRedirect(WebURLLoader*, |
| 208 WebURLRequest&, | 208 WebURLRequest&, |
| 209 const WebURLResponse&, | 209 const WebURLResponse&) override; |
| 210 int64_t encodedDataLength) override; | |
| 211 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; | 210 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; |
| 212 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; | 211 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; |
| 213 void didFinishLoading(WebURLLoader*, double, int64_t) final; | 212 void didFinishLoading(WebURLLoader*, double, int64_t) final; |
| 214 void didFail(WebURLLoader*, const WebURLError&) final; | 213 void didFail(WebURLLoader*, const WebURLError&) final; |
| 215 | 214 |
| 216 void timeout(TimerBase*); | 215 void timeout(TimerBase*); |
| 217 | 216 |
| 218 void didFailLoading(LocalFrame*); | 217 void didFailLoading(LocalFrame*); |
| 219 | 218 |
| 220 std::unique_ptr<WebURLLoader> m_loader; | 219 std::unique_ptr<WebURLLoader> m_loader; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 m_loader->cancel(); | 284 m_loader->cancel(); |
| 286 m_loader = nullptr; | 285 m_loader = nullptr; |
| 287 } | 286 } |
| 288 m_timeout.stop(); | 287 m_timeout.stop(); |
| 289 m_keepAlive.clear(); | 288 m_keepAlive.clear(); |
| 290 } | 289 } |
| 291 | 290 |
| 292 void PingLoaderImpl::willFollowRedirect( | 291 void PingLoaderImpl::willFollowRedirect( |
| 293 WebURLLoader*, | 292 WebURLLoader*, |
| 294 WebURLRequest& passedNewRequest, | 293 WebURLRequest& passedNewRequest, |
| 295 const WebURLResponse& passedRedirectResponse, | 294 const WebURLResponse& passedRedirectResponse) { |
| 296 int64_t encodedDataLength) { | |
| 297 if (!m_isBeacon) | 295 if (!m_isBeacon) |
| 298 return; | 296 return; |
| 299 | 297 |
| 300 // TODO(tyoshino): Check if setAllowStoredCredentials() should be called also | 298 // TODO(tyoshino): Check if setAllowStoredCredentials() should be called also |
| 301 // for non beacon cases. | 299 // for non beacon cases. |
| 302 passedNewRequest.setAllowStoredCredentials(true); | 300 passedNewRequest.setAllowStoredCredentials(true); |
| 303 if (m_corsMode == NotCORSEnabled) | 301 if (m_corsMode == NotCORSEnabled) |
| 304 return; | 302 return; |
| 305 | 303 |
| 306 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); | 304 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 bool PingLoader::sendBeacon(LocalFrame* frame, | 550 bool PingLoader::sendBeacon(LocalFrame* frame, |
| 553 int allowance, | 551 int allowance, |
| 554 const KURL& beaconURL, | 552 const KURL& beaconURL, |
| 555 Blob* data, | 553 Blob* data, |
| 556 int& payloadLength) { | 554 int& payloadLength) { |
| 557 BeaconBlob beacon(data); | 555 BeaconBlob beacon(data); |
| 558 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 556 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
| 559 } | 557 } |
| 560 | 558 |
| 561 } // namespace blink | 559 } // namespace blink |
| OLD | NEW |