| Index: url/url_canon_etc.cc
|
| diff --git a/url/url_canon_etc.cc b/url/url_canon_etc.cc
|
| index e9da94cca39061c2daf0b7d076993657613ecc6b..cb460037f6b4235018e7ec2d9d9af66919afdded 100644
|
| --- a/url/url_canon_etc.cc
|
| +++ b/url/url_canon_etc.cc
|
| @@ -272,6 +272,27 @@ void DoCanonicalizeRef(const CHAR* spec,
|
| out_ref->len = output->length() - out_ref->begin;
|
| }
|
|
|
| +template <typename CHAR, typename UCHAR>
|
| +bool DoCanonicalizeNonStandardURL(const URLComponentSource<CHAR>& source,
|
| + const Parsed& parsed,
|
| + CharsetConverter* query_converter,
|
| + CanonOutput* output,
|
| + Parsed* new_parsed) {
|
| + // Scheme: this will append the colon.
|
| + bool success = CanonicalizeScheme(source.scheme, parsed.scheme, output,
|
| + &new_parsed->scheme);
|
| +
|
| + new_parsed->username.reset();
|
| + new_parsed->password.reset();
|
| + new_parsed->host.reset();
|
| + new_parsed->port.reset();
|
| + new_parsed->path.reset();
|
| + new_parsed->query.reset();
|
| + new_parsed->ref.reset();
|
| +
|
| + return success;
|
| +}
|
| +
|
| } // namespace
|
|
|
| const char* RemoveURLWhitespace(const char* input, int input_len,
|
| @@ -364,4 +385,26 @@ void CanonicalizeRef(const base::char16* spec,
|
| DoCanonicalizeRef<base::char16, base::char16>(spec, ref, output, out_ref);
|
| }
|
|
|
| +bool CanonicalizeNonStandardURL(const char* spec,
|
| + int spec_len,
|
| + const Parsed& parsed,
|
| + CharsetConverter* query_converter,
|
| + CanonOutput* output,
|
| + Parsed* new_parsed) {
|
| + return DoCanonicalizeNonStandardURL<char, unsigned char>(
|
| + URLComponentSource<char>(spec), parsed, query_converter, output,
|
| + new_parsed);
|
| +}
|
| +
|
| +bool CanonicalizeNonStandardURL(const base::char16* spec,
|
| + int spec_len,
|
| + const Parsed& parsed,
|
| + CharsetConverter* query_converter,
|
| + CanonOutput* output,
|
| + Parsed* new_parsed) {
|
| + return DoCanonicalizeNonStandardURL<base::char16, base::char16>(
|
| + URLComponentSource<base::char16>(spec), parsed, query_converter, output,
|
| + new_parsed);
|
| +}
|
| +
|
| } // namespace url
|
|
|