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

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

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 months 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/blink_platform_impl.cc ('k') | content/child/npapi/plugin_host.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/multipart_response_delegate.h" 5 #include "content/child/multipart_response_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 : client_(client), 64 : client_(client),
65 loader_(loader), 65 loader_(loader),
66 original_response_(response), 66 original_response_(response),
67 encoded_data_length_(0), 67 encoded_data_length_(0),
68 boundary_("--"), 68 boundary_("--"),
69 first_received_data_(true), 69 first_received_data_(true),
70 processing_headers_(false), 70 processing_headers_(false),
71 stop_sending_(false), 71 stop_sending_(false),
72 has_sent_first_response_(false) { 72 has_sent_first_response_(false) {
73 // Some servers report a boundary prefixed with "--". See bug 5786. 73 // Some servers report a boundary prefixed with "--". See bug 5786.
74 if (base::StartsWithASCII(boundary, "--", true)) { 74 if (base::StartsWith(boundary, "--", base::CompareCase::SENSITIVE)) {
75 boundary_.assign(boundary); 75 boundary_.assign(boundary);
76 } else { 76 } else {
77 boundary_.append(boundary); 77 boundary_.append(boundary);
78 } 78 }
79 } 79 }
80 80
81 void MultipartResponseDelegate::OnReceivedData(const char* data, 81 void MultipartResponseDelegate::OnReceivedData(const char* data,
82 int data_len, 82 int data_len,
83 int encoded_data_length) { 83 int encoded_data_length) {
84 // stop_sending_ means that we've already received the final boundary token. 84 // stop_sending_ means that we've already received the final boundary token.
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 if (!base::StringToInt64(byte_range_upper_bound, content_range_upper_bound)) 385 if (!base::StringToInt64(byte_range_upper_bound, content_range_upper_bound))
386 return false; 386 return false;
387 if (!base::StringToInt64(byte_range_instance_size, 387 if (!base::StringToInt64(byte_range_instance_size,
388 content_range_instance_size)) { 388 content_range_instance_size)) {
389 return false; 389 return false;
390 } 390 }
391 return true; 391 return true;
392 } 392 }
393 393
394 } // namespace content 394 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/child/npapi/plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698