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

Unified Diff: third_party/WebKit/Source/platform/weborigin/KURL.h

Issue 2463703002: Optimize KURL protocols (Closed)
Patch Set: add dchecks Created 4 years 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: third_party/WebKit/Source/platform/weborigin/KURL.h
diff --git a/third_party/WebKit/Source/platform/weborigin/KURL.h b/third_party/WebKit/Source/platform/weborigin/KURL.h
index e441f9e5f5d5ed34382b72d2bee95797734fae15..91c78515fdc24fb9fc0ab12cdea232dad75327b8 100644
--- a/third_party/WebKit/Source/platform/weborigin/KURL.h
+++ b/third_party/WebKit/Source/platform/weborigin/KURL.h
@@ -196,17 +196,24 @@ class PLATFORM_EXPORT KURL {
const String& relative,
const WTF::TextEncoding* queryEncoding);
+ StringView componentStringView(const url::Component&) const;
String componentString(const url::Component&) const;
- String stringForInvalidComponent() const;
+ StringView stringViewForInvalidComponent() const;
template <typename CHAR>
void replaceComponents(const url::Replacements<CHAR>&);
void initInnerURL();
- void initProtocolIsInHTTPFamily();
+ void initProtocolMetadata();
bool m_isValid;
bool m_protocolIsInHTTPFamily;
+
+ // Keep a separate string for the protocol to avoid copious copies for
+ // protocol(). Normally this will be Atomic, except when constructed via
+ // KURL::copy(), which is deep.
+ String m_protocol;
+
url::Parsed m_parsed;
String m_string;
std::unique_ptr<KURL> m_innerURL;

Powered by Google App Engine
This is Rietveld 408576698