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 52c619645d984aaeb98e2bbf85bb62c7316b7371..2a9491f045ce1667736daa190144166782004909 100644 |
--- a/url/third_party/mozilla/url_parse.cc |
+++ b/url/third_party/mozilla/url_parse.cc |
@@ -481,7 +481,6 @@ void DoParsePathURL(const CHAR* spec, int spec_len, Parsed* parsed) { |
if (ExtractScheme(&spec[begin], spec_len - begin, &parsed->scheme)) { |
// Offset the results since we gave ExtractScheme a substring. |
parsed->scheme.begin += begin; |
- |
joth
2013/09/19 22:50:02
unneeded edit
Kristian Monsen
2013/09/20 05:57:31
Done.
|
// For compatability with the standard URL parser, we treat no path as |
// -1, rather than having a length of 0 (we normally wouldn't care so |
// much for these non-standard URLs). |
@@ -792,6 +791,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); |
} |