| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 222 } |
| 223 | 223 |
| 224 bool Beacon::serialize(FormData* data, ResourceRequest& request, int allowance,
int& payloadLength) | 224 bool Beacon::serialize(FormData* data, ResourceRequest& request, int allowance,
int& payloadLength) |
| 225 { | 225 { |
| 226 ASSERT(data); | 226 ASSERT(data); |
| 227 RefPtr<EncodedFormData> entityBody = data->encodeMultiPartFormData(); | 227 RefPtr<EncodedFormData> entityBody = data->encodeMultiPartFormData(); |
| 228 unsigned long long entitySize = entityBody->sizeInBytes(); | 228 unsigned long long entitySize = entityBody->sizeInBytes(); |
| 229 if (allowance > 0 && static_cast<unsigned long long>(allowance) < entitySize
) | 229 if (allowance > 0 && static_cast<unsigned long long>(allowance) < entitySize
) |
| 230 return false; | 230 return false; |
| 231 | 231 |
| 232 AtomicString contentType = AtomicString("multipart/form-data; boundary=", At
omicString::ConstructFromLiteral) + entityBody->boundary().data(); | 232 AtomicString contentType = AtomicString("multipart/form-data; boundary=") +
entityBody->boundary().data(); |
| 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 |