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

Side by Side Diff: webkit/glue/multipart_response_delegate.cc

Issue 3968001: Update code that previously constructed strings from string iterators only to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/glue/multipart_response_delegate.h" 5 #include "webkit/glue/multipart_response_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 // Skip over the initial space. 336 // Skip over the initial space.
337 byte_range_lower_bound_start_offset++; 337 byte_range_lower_bound_start_offset++;
338 338
339 size_t byte_range_lower_bound_end_offset = 339 size_t byte_range_lower_bound_end_offset =
340 content_range.find("-", byte_range_lower_bound_start_offset); 340 content_range.find("-", byte_range_lower_bound_start_offset);
341 if (byte_range_lower_bound_end_offset == std::string::npos) { 341 if (byte_range_lower_bound_end_offset == std::string::npos) {
342 return false; 342 return false;
343 } 343 }
344 344
345 size_t byte_range_lower_bound_characters =
346 byte_range_lower_bound_end_offset - byte_range_lower_bound_start_offset;
347 std::string byte_range_lower_bound =
348 content_range.substr(byte_range_lower_bound_start_offset,
349 byte_range_lower_bound_characters);
350
351 size_t byte_range_upper_bound_start_offset = 345 size_t byte_range_upper_bound_start_offset =
352 byte_range_lower_bound_end_offset + 1; 346 byte_range_lower_bound_end_offset + 1;
353 347
354 size_t byte_range_upper_bound_end_offset = 348 size_t byte_range_upper_bound_end_offset =
355 content_range.find("/", byte_range_upper_bound_start_offset); 349 content_range.find("/", byte_range_upper_bound_start_offset);
356 if (byte_range_upper_bound_end_offset == std::string::npos) { 350 if (byte_range_upper_bound_end_offset == std::string::npos) {
357 return false; 351 return false;
358 } 352 }
359 353
360 size_t byte_range_upper_bound_characters = 354 if (!base::StringToInt(
361 byte_range_upper_bound_end_offset - byte_range_upper_bound_start_offset; 355 content_range.begin() + byte_range_lower_bound_start_offset,
356 content_range.begin() + byte_range_lower_bound_end_offset,
357 content_range_lower_bound))
358 return false;
362 359
363 std::string byte_range_upper_bound = 360 if (!base::StringToInt(
364 content_range.substr(byte_range_upper_bound_start_offset, 361 content_range.begin() + byte_range_upper_bound_start_offset,
365 byte_range_upper_bound_characters); 362 content_range.begin() + byte_range_upper_bound_end_offset,
366 363 content_range_upper_bound))
367 if (!base::StringToInt(byte_range_lower_bound, content_range_lower_bound))
368 return false;
369 if (!base::StringToInt(byte_range_upper_bound, content_range_upper_bound))
370 return false; 364 return false;
371 return true; 365 return true;
372 } 366 }
373 367
374 } // namespace webkit_glue 368 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698