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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2629393002: Measure URL resolution with raw newlines and braces. (Closed)
Patch Set: Formatting. 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 53800840da18868108784a81b1d4ec79cd4c6686..0ce8353bcba98c83637d02e84e56ad6a5b474a45 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4945,6 +4945,19 @@ void Document::setEncodingData(const DocumentEncodingData& newData) {
}
KURL Document::completeURL(const String& url) const {
+ String trimmed = url.stripWhiteSpace();
+ bool newline = trimmed.contains('\n') || trimmed.contains('\r');
+ bool brace = trimmed.contains('<');
+ if (newline)
+ UseCounter::count(*this, UseCounter::DocumentCompleteURLContainingNewline);
+ if (brace) {
+ UseCounter::count(*this,
+ UseCounter::DocumentCompleteURLContainingOpenBrace);
+ }
+ if (newline && brace) {
+ UseCounter::count(
+ *this, UseCounter::DocumentCompleteURLContainingNewlineAndOpenBrace);
+ }
return completeURLWithOverride(url, m_baseURL);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698