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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: webkit/glue/multipart_response_delegate.cc
===================================================================
--- webkit/glue/multipart_response_delegate.cc (revision 63369)
+++ webkit/glue/multipart_response_delegate.cc (working copy)
@@ -342,12 +342,6 @@
return false;
}
- size_t byte_range_lower_bound_characters =
- byte_range_lower_bound_end_offset - byte_range_lower_bound_start_offset;
- std::string byte_range_lower_bound =
- content_range.substr(byte_range_lower_bound_start_offset,
- byte_range_lower_bound_characters);
-
size_t byte_range_upper_bound_start_offset =
byte_range_lower_bound_end_offset + 1;
@@ -357,17 +351,17 @@
return false;
}
- size_t byte_range_upper_bound_characters =
- byte_range_upper_bound_end_offset - byte_range_upper_bound_start_offset;
+ if (!base::StringToInt(
+ content_range.begin() + byte_range_lower_bound_start_offset,
+ content_range.begin() + byte_range_lower_bound_end_offset,
+ content_range_lower_bound))
+ return false;
- std::string byte_range_upper_bound =
- content_range.substr(byte_range_upper_bound_start_offset,
- byte_range_upper_bound_characters);
-
- if (!base::StringToInt(byte_range_lower_bound, content_range_lower_bound))
+ if (!base::StringToInt(
+ content_range.begin() + byte_range_upper_bound_start_offset,
+ content_range.begin() + byte_range_upper_bound_end_offset,
+ content_range_upper_bound))
return false;
- if (!base::StringToInt(byte_range_upper_bound, content_range_upper_bound))
- return false;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698