OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Functions for canonicalizing "path" URLs. Not to be confused with the path | 5 // Functions for canonicalizing "path" URLs. Not to be confused with the path |
6 // of a URL, these are URLs that have no authority section, only a path. For | 6 // of a URL, these are URLs that have no authority section, only a path. For |
7 // example, "javascript:" and "data:". | 7 // example, "javascript:" and "data:". |
8 | 8 |
| 9 #include "base/strings/string16.h" |
| 10 #include "url/third_party/mozilla/url_parse.h" |
9 #include "url/url_canon.h" | 11 #include "url/url_canon.h" |
10 #include "url/url_canon_internal.h" | 12 #include "url/url_canon_internal.h" |
11 | 13 |
12 namespace url { | 14 namespace url { |
13 | 15 |
14 namespace { | 16 namespace { |
15 | 17 |
16 // Canonicalize the given |component| from |source| into |output| and | 18 // Canonicalize the given |component| from |source| into |output| and |
17 // |new_component|. If |separator| is non-zero, it is pre-pended to |output| | 19 // |new_component|. If |separator| is non-zero, it is pre-pended to |output| |
18 // prior to the canonicalized component; i.e. for the '?' or '#' characters. | 20 // prior to the canonicalized component; i.e. for the '?' or '#' characters. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 Parsed* new_parsed) { | 114 Parsed* new_parsed) { |
113 RawCanonOutput<1024> utf8; | 115 RawCanonOutput<1024> utf8; |
114 URLComponentSource<char> source(base); | 116 URLComponentSource<char> source(base); |
115 Parsed parsed(base_parsed); | 117 Parsed parsed(base_parsed); |
116 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); | 118 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); |
117 return DoCanonicalizePathURL<char, unsigned char>( | 119 return DoCanonicalizePathURL<char, unsigned char>( |
118 source, parsed, output, new_parsed); | 120 source, parsed, output, new_parsed); |
119 } | 121 } |
120 | 122 |
121 } // namespace url | 123 } // namespace url |
OLD | NEW |