| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |