Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: url/url_canon_etc.cc

Issue 2159203002: Fix inconsistent values of anchor element IDL attributes compare to other vendors Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « url/url_canon.h ('k') | url/url_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « url/url_canon.h ('k') | url/url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698