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 to canonicalize "standard" URLs, which are ones that have an | 5 // Functions to canonicalize "standard" URLs, which are ones that have an |
6 // authority section including a host name. | 6 // authority section including a host name. |
7 | 7 |
8 #include "url/url_canon.h" | 8 #include "url/url_canon.h" |
9 #include "url/url_canon_internal.h" | 9 #include "url/url_canon_internal.h" |
10 #include "url/url_constants.h" | 10 #include "url/url_constants.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 CanonOutput* output, | 162 CanonOutput* output, |
163 Parsed* new_parsed) { | 163 Parsed* new_parsed) { |
164 URLComponentSource<char> source(base); | 164 URLComponentSource<char> source(base); |
165 Parsed parsed(base_parsed); | 165 Parsed parsed(base_parsed); |
166 SetupOverrideComponents(base, replacements, &source, &parsed); | 166 SetupOverrideComponents(base, replacements, &source, &parsed); |
167 return DoCanonicalizeStandardURL<char, unsigned char>( | 167 return DoCanonicalizeStandardURL<char, unsigned char>( |
168 source, parsed, query_converter, output, new_parsed); | 168 source, parsed, query_converter, output, new_parsed); |
169 } | 169 } |
170 | 170 |
171 // For 16-bit replacements, we turn all the replacements into UTF-8 so the | 171 // For 16-bit replacements, we turn all the replacements into UTF-8 so the |
172 // regular codepath can be used. | 172 // regular code path can be used. |
173 bool ReplaceStandardURL(const char* base, | 173 bool ReplaceStandardURL(const char* base, |
174 const Parsed& base_parsed, | 174 const Parsed& base_parsed, |
175 const Replacements<base::char16>& replacements, | 175 const Replacements<base::char16>& replacements, |
176 CharsetConverter* query_converter, | 176 CharsetConverter* query_converter, |
177 CanonOutput* output, | 177 CanonOutput* output, |
178 Parsed* new_parsed) { | 178 Parsed* new_parsed) { |
179 RawCanonOutput<1024> utf8; | 179 RawCanonOutput<1024> utf8; |
180 URLComponentSource<char> source(base); | 180 URLComponentSource<char> source(base); |
181 Parsed parsed(base_parsed); | 181 Parsed parsed(base_parsed); |
182 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); | 182 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); |
183 return DoCanonicalizeStandardURL<char, unsigned char>( | 183 return DoCanonicalizeStandardURL<char, unsigned char>( |
184 source, parsed, query_converter, output, new_parsed); | 184 source, parsed, query_converter, output, new_parsed); |
185 } | 185 } |
186 | 186 |
187 } // namespace url | 187 } // namespace url |
OLD | NEW |