diff options
Diffstat (limited to 'url/third_party/mozilla/url_parse.cc')
-rw-r--r-- | url/third_party/mozilla/url_parse.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/url/third_party/mozilla/url_parse.cc b/url/third_party/mozilla/url_parse.cc index 52c6196..fbc8a9b 100644 --- a/url/third_party/mozilla/url_parse.cc +++ b/url/third_party/mozilla/url_parse.cc @@ -792,6 +792,15 @@ int Parsed::CountCharactersBefore(ComponentType type, return cur; } +Component Parsed::GetContent() const { + const int begin = CountCharactersBefore(USERNAME, false); + const int len = Length() - begin; + // For compatability with the standard URL parser, we treat no content as + // -1, rather than having a length of 0 (we normally wouldn't care so + // much for these non-standard URLs). + return len ? Component(begin, len) : Component(); +} + bool ExtractScheme(const char* url, int url_len, Component* scheme) { return DoExtractScheme(url, url_len, scheme); } |