| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/loader/BeaconLoader.h" | 5 #include "core/loader/BeaconLoader.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMArrayBufferView.h" | 7 #include "core/dom/DOMArrayBufferView.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/fetch/CrossOriginAccessControl.h" | 9 #include "core/fetch/CrossOriginAccessControl.h" |
| 10 #include "core/fetch/FetchContext.h" | 10 #include "core/fetch/FetchContext.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool BeaconLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beac
onURL, Blob* data, int& payloadLength) | 125 bool BeaconLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beac
onURL, Blob* data, int& payloadLength) |
| 126 { | 126 { |
| 127 BeaconData<decltype(data)> beacon(data); | 127 BeaconData<decltype(data)> beacon(data); |
| 128 return Sender::send(frame, allowance, beaconURL, beacon, payloadLength); | 128 return Sender::send(frame, allowance, beaconURL, beacon, payloadLength); |
| 129 } | 129 } |
| 130 | 130 |
| 131 BeaconLoader::BeaconLoader(LocalFrame* frame, ResourceRequest& request, const Fe
tchInitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) | 131 BeaconLoader::BeaconLoader(LocalFrame* frame, ResourceRequest& request, const Fe
tchInitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) |
| 132 : PingLoader(frame, request, initiatorInfo, credentialsAllowed) | 132 : PingLoader(frame, request, initiatorInfo, credentialsAllowed) |
| 133 , m_beaconOrigin(frame->document()->securityOrigin()) | 133 , m_beaconOrigin(frame->document()->getSecurityOrigin()) |
| 134 { | 134 { |
| 135 } | 135 } |
| 136 | 136 |
| 137 void BeaconLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewReq
uest, const WebURLResponse& passedRedirectResponse) | 137 void BeaconLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewReq
uest, const WebURLResponse& passedRedirectResponse) |
| 138 { | 138 { |
| 139 passedNewRequest.setAllowStoredCredentials(true); | 139 passedNewRequest.setAllowStoredCredentials(true); |
| 140 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); | 140 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); |
| 141 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe
sponse()); | 141 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe
sponse()); |
| 142 | 142 |
| 143 ASSERT(!newRequest.isNull()); | 143 ASSERT(!newRequest.isNull()); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 request.setHTTPBody(entityBody.release()); | 233 request.setHTTPBody(entityBody.release()); |
| 234 request.setHTTPContentType(contentType); | 234 request.setHTTPContentType(contentType); |
| 235 | 235 |
| 236 payloadLength = entitySize; | 236 payloadLength = entitySize; |
| 237 return true; | 237 return true; |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace | 240 } // namespace |
| 241 | 241 |
| 242 } // namespace blink | 242 } // namespace blink |
| OLD | NEW |