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

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

Issue 2463703002: Optimize KURL protocols (Closed)
Patch Set: simplify Created 4 years, 1 month 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..acb7657b7288235fc1a8af2a27a6e3967a89aafa 100644
--- a/third_party/WebKit/Source/platform/weborigin/KURL.h
+++ b/third_party/WebKit/Source/platform/weborigin/KURL.h
@@ -196,6 +196,7 @@ 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;
@@ -203,10 +204,16 @@ class PLATFORM_EXPORT KURL {
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