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

Unified Diff: url/url_util.cc

Issue 2643613002: Reduce the perf overhead of our dangling markup experiments. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
Index: url/url_util.cc
diff --git a/url/url_util.cc b/url/url_util.cc
index 867754ffd1dd22c82270ea8e3862630658d09d6a..2c8d6978cb72c5c7665135bcd9d7a36e7941be77 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -199,8 +199,13 @@ bool DoCanonicalize(const CHAR* spec,
// Remove any whitespace from the middle of the relative URL if necessary.
// Possibly this will result in copying to the new buffer.
RawCanonOutputT<CHAR> whitespace_buffer;
- if (whitespace_policy == REMOVE_WHITESPACE)
- spec = RemoveURLWhitespace(spec, spec_len, &whitespace_buffer, &spec_len);
+ if (whitespace_policy == REMOVE_WHITESPACE) {
+ int original_len = spec_len;
+ spec =
+ RemoveURLWhitespace(spec, original_len, &whitespace_buffer, &spec_len);
+ if (spec_len != original_len)
+ output_parsed->whitespace_removed = true;
+ }
Parsed parsed_input;
#ifdef WIN32
@@ -280,6 +285,9 @@ bool DoResolveRelative(const char* base_spec,
const CHAR* relative = RemoveURLWhitespace(in_relative, in_relative_length,
&whitespace_buffer,
&relative_length);
+ if (in_relative_length != relative_length)
+ output_parsed->whitespace_removed = true;
+
bool base_is_authority_based = false;
bool base_is_hierarchical = false;
if (base_spec &&
« third_party/WebKit/Source/platform/weborigin/KURL.h ('K') | « url/third_party/mozilla/url_parse.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698