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

Unified Diff: url/url_parse_internal.h

Issue 23835019: Support URL fragment resolution againt non-hierarchical schemes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: brettw2 Created 7 years, 1 month 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
« no previous file with comments | « url/url_canon_unittest.cc ('k') | url/url_parse_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_parse_internal.h
diff --git a/url/url_parse_internal.h b/url/url_parse_internal.h
index 9c2b2b6889a93d50ad4a4e2f2a5473c42361c61a..e61379ceb1bb8e949fc7428cdacff2908b7d1302 100644
--- a/url/url_parse_internal.h
+++ b/url/url_parse_internal.h
@@ -28,15 +28,19 @@ inline bool ShouldTrimFromURL(base::char16 ch) {
// in the input string (so the string starts at character |*begin| in the spec,
// and goes until |*len|).
template<typename CHAR>
-inline void TrimURL(const CHAR* spec, int* begin, int* len) {
+inline void TrimURL(const CHAR* spec, int* begin, int* len,
+ bool trim_path_end = true) {
// Strip leading whitespace and control characters.
while (*begin < *len && ShouldTrimFromURL(spec[*begin]))
(*begin)++;
- // Strip trailing whitespace and control characters. We need the >i test for
- // when the input string is all blanks; we don't want to back past the input.
- while (*len > *begin && ShouldTrimFromURL(spec[*len - 1]))
- (*len)--;
+ if (trim_path_end) {
+ // Strip trailing whitespace and control characters. We need the >i test
+ // for when the input string is all blanks; we don't want to back past the
+ // input.
+ while (*len > *begin && ShouldTrimFromURL(spec[*len - 1]))
+ (*len)--;
+ }
}
// Counts the number of consecutive slashes starting at the given offset
« no previous file with comments | « url/url_canon_unittest.cc ('k') | url/url_parse_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698