| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 class BeaconString final : public Beacon { | 39 class BeaconString final : public Beacon { |
| 40 public: | 40 public: |
| 41 explicit BeaconString(const String& data) | 41 explicit BeaconString(const String& data) |
| 42 : m_data(data) | 42 : m_data(data) |
| 43 { | 43 { |
| 44 } | 44 } |
| 45 | 45 |
| 46 unsigned long long size() const override | 46 unsigned long long size() const override |
| 47 { | 47 { |
| 48 return m_data.sizeInBytes(); | 48 return m_data.charactersSizeInBytes(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool serialize(ResourceRequest& request, int, int&) const override | 51 bool serialize(ResourceRequest& request, int, int&) const override |
| 52 { | 52 { |
| 53 RefPtr<EncodedFormData> entityBody = EncodedFormData::create(m_data.utf8
()); | 53 RefPtr<EncodedFormData> entityBody = EncodedFormData::create(m_data.utf8
()); |
| 54 request.setHTTPBody(entityBody); | 54 request.setHTTPBody(entityBody); |
| 55 request.setHTTPContentType(getContentType()); | 55 request.setHTTPContentType(getContentType()); |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 dispose(); | 266 dispose(); |
| 267 // Signal WebURLLoader that the redirect musn't be followed. | 267 // Signal WebURLLoader that the redirect musn't be followed. |
| 268 passedNewRequest = WebURLRequest(); | 268 passedNewRequest = WebURLRequest(); |
| 269 return; | 269 return; |
| 270 } | 270 } |
| 271 // FIXME: http://crbug.com/427429 is needed to correctly propagate | 271 // FIXME: http://crbug.com/427429 is needed to correctly propagate |
| 272 // updates of Origin: following this successful redirect. | 272 // updates of Origin: following this successful redirect. |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace blink | 275 } // namespace blink |
| OLD | NEW |