| 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 "content/child/web_url_request_util.h" | 5 #include "content/child/web_url_request_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 http_body.initialize(); | 238 http_body.initialize(); |
| 239 http_body.setIdentifier(input->identifier()); | 239 http_body.setIdentifier(input->identifier()); |
| 240 http_body.setContainsPasswordData(input->contains_sensitive_info()); | 240 http_body.setContainsPasswordData(input->contains_sensitive_info()); |
| 241 for (const auto& element : *input->elements()) { | 241 for (const auto& element : *input->elements()) { |
| 242 switch (element.type()) { | 242 switch (element.type()) { |
| 243 case ResourceRequestBodyImpl::Element::TYPE_BYTES: | 243 case ResourceRequestBodyImpl::Element::TYPE_BYTES: |
| 244 http_body.appendData(WebData(element.bytes(), element.length())); | 244 http_body.appendData(WebData(element.bytes(), element.length())); |
| 245 break; | 245 break; |
| 246 case ResourceRequestBodyImpl::Element::TYPE_FILE: | 246 case ResourceRequestBodyImpl::Element::TYPE_FILE: |
| 247 http_body.appendFileRange( | 247 http_body.appendFileRange( |
| 248 element.path().AsUTF16Unsafe(), element.offset(), | 248 blink::FilePathToWebString(element.path()), element.offset(), |
| 249 (element.length() != std::numeric_limits<uint64_t>::max()) | 249 (element.length() != std::numeric_limits<uint64_t>::max()) |
| 250 ? element.length() | 250 ? element.length() |
| 251 : -1, | 251 : -1, |
| 252 element.expected_modification_time().ToDoubleT()); | 252 element.expected_modification_time().ToDoubleT()); |
| 253 break; | 253 break; |
| 254 case ResourceRequestBodyImpl::Element::TYPE_FILE_FILESYSTEM: | 254 case ResourceRequestBodyImpl::Element::TYPE_FILE_FILESYSTEM: |
| 255 http_body.appendFileSystemURLRange( | 255 http_body.appendFileSystemURLRange( |
| 256 element.filesystem_url(), element.offset(), | 256 element.filesystem_url(), element.offset(), |
| 257 (element.length() != std::numeric_limits<uint64_t>::max()) | 257 (element.length() != std::numeric_limits<uint64_t>::max()) |
| 258 ? element.length() | 258 ? element.length() |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 bool stale_copy_in_cache, | 509 bool stale_copy_in_cache, |
| 510 int reason, | 510 int reason, |
| 511 bool was_ignored_by_handler) { | 511 bool was_ignored_by_handler) { |
| 512 blink::WebURLError error = | 512 blink::WebURLError error = |
| 513 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 513 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
| 514 error.wasIgnoredByHandler = was_ignored_by_handler; | 514 error.wasIgnoredByHandler = was_ignored_by_handler; |
| 515 return error; | 515 return error; |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace content | 518 } // namespace content |
| OLD | NEW |