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

Unified Diff: url/url_canon_relative.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | url/url_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_relative.cc
diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc
index 9436245d3793d296b97964a72dbdf5710bd6f6e6..06ca99cbe68e40b281ce2bae4c665e96cb24154b 100644
--- a/url/url_canon_relative.cc
+++ b/url/url_canon_relative.cc
@@ -170,8 +170,8 @@ bool DoIsRelativeURL(const char* base,
// up until and including the last slash. There should be a slash in the
// range, if not, nothing will be copied.
//
-// The input is assumed to be canonical, so we search only for exact slashes
-// and not backslashes as well. We also know that it's ASCII.
+// For stardard URLs the input should be canonical, but when resolving relative
+// URLs on a non-standard base (like "data:") the input can be anything.
void CopyToLastSlash(const char* spec,
int begin,
int end,
@@ -179,7 +179,7 @@ void CopyToLastSlash(const char* spec,
// Find the last slash.
int last_slash = -1;
for (int i = end - 1; i >= begin; i--) {
- if (spec[i] == '/') {
+ if (spec[i] == '/' || spec[i] == '\\') {
last_slash = i;
break;
}
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | url/url_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698