| Index: url/third_party/mozilla/url_parse.cc
|
| diff --git a/url/third_party/mozilla/url_parse.cc b/url/third_party/mozilla/url_parse.cc
|
| index ba842b87b5db347ccc3bc5f5dccf7472ffc1aa40..ce1a604b9faece7f946fba6adacece855b98d70f 100644
|
| --- a/url/third_party/mozilla/url_parse.cc
|
| +++ b/url/third_party/mozilla/url_parse.cc
|
| @@ -564,6 +564,41 @@ void DoParseMailtoURL(const CHAR* spec, int spec_len, Parsed* parsed) {
|
| }
|
| }
|
|
|
| +template <typename CHAR>
|
| +void DoParseNonStandardURL(const CHAR* spec, int spec_len, Parsed* parsed) {
|
| + // Get the non-scheme parts of the URL out of the way, we don't know how to
|
| + // interpret them.
|
| + parsed->username.reset();
|
| + parsed->password.reset();
|
| + parsed->host.reset();
|
| + parsed->port.reset();
|
| + parsed->path.reset();
|
| + parsed->query.reset();
|
| + parsed->ref.reset();
|
| +
|
| + // Strip leading & trailing spaces and control characters.
|
| + int scheme_begin = 0;
|
| + TrimURL(spec, &scheme_begin, &spec_len);
|
| +
|
| + // Handle empty specs or ones that contain only whitespace or control chars.
|
| + if (scheme_begin == spec_len) {
|
| + parsed->scheme.reset();
|
| + parsed->path.reset();
|
| + return;
|
| + }
|
| +
|
| + // Extract the scheme. We also
|
| + // handle the case where there is no scheme.
|
| + if (ExtractScheme(&spec[scheme_begin], spec_len - scheme_begin,
|
| + &parsed->scheme)) {
|
| + // Offset the results since we gave ExtractScheme a substring.
|
| + parsed->scheme.begin += scheme_begin;
|
| + } else {
|
| + // No scheme case.
|
| + parsed->scheme.reset();
|
| + }
|
| +}
|
| +
|
| // Converts a port number in a string to an integer. We'd like to just call
|
| // sscanf but our input is not NULL-terminated, which sscanf requires. Instead,
|
| // we copy the digits to a small stack buffer (since we know the maximum number
|
| @@ -901,6 +936,14 @@ void ParseMailtoURL(const base::char16* url, int url_len, Parsed* parsed) {
|
| DoParseMailtoURL(url, url_len, parsed);
|
| }
|
|
|
| +void ParseNonStandardURL(const char* url, int url_len, Parsed* parsed) {
|
| + DoParseNonStandardURL(url, url_len, parsed);
|
| +}
|
| +
|
| +void ParseNonStandardURL(const base::char16* url, int url_len, Parsed* parsed) {
|
| + DoParseNonStandardURL(url, url_len, parsed);
|
| +}
|
| +
|
| void ParsePathInternal(const char* spec,
|
| const Component& path,
|
| Component* filepath,
|
|
|