Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: content/child/web_url_request_util.cc

Issue 2537953003: WebString: makes string16 conversions explicit (part 1: blink, content) (Closed)
Patch Set: fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/child/webfileutilities_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/child/webfileutilities_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698