[go: nahoru, domu]

[URL] Canonicalize non-special URLs

Add CanonicalizeNonSpecialURL functions, putting the followings into
together:

- https://crrev.com/c/5028539 (Parser for non-special URLs)
- https://crrev.com/c/5092012 (Canonicalize non-special hosts)
- https://crrev.com/c/5095842 (Canonicalize non-special paths)

This CL is separate from the main CL (https://crrev.com/c/4929491).

Bug: 1416006
Change-Id: If7125ff5f052e465dcaa5876061690697899872b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5114580
Reviewed-by: Timothy Gu <timothygu@chromium.org>
Commit-Queue: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1236752}
diff --git a/url/url_canon_fileurl.cc b/url/url_canon_fileurl.cc
index 802fe42..a5af5fbe 100644
--- a/url/url_canon_fileurl.cc
+++ b/url/url_canon_fileurl.cc
@@ -127,6 +127,8 @@
                            CharsetConverter* query_converter,
                            CanonOutput* output,
                            Parsed* new_parsed) {
+  DCHECK(!parsed.has_opaque_path);
+
   // Things we don't set in file: URLs.
   new_parsed->username = Component();
   new_parsed->password = Component();