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

Side by Side Diff: third_party/WebKit/Source/platform/weborigin/KURL.h

Issue 2586253004: Revert of Optimize KURL protocols (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 const KURL* innerURL() const { return m_innerURL.get(); } 190 const KURL* innerURL() const { return m_innerURL.get(); }
191 191
192 bool isSafeToSendToAnotherThread() const; 192 bool isSafeToSendToAnotherThread() const;
193 193
194 private: 194 private:
195 void init(const KURL& base, 195 void init(const KURL& base,
196 const String& relative, 196 const String& relative,
197 const WTF::TextEncoding* queryEncoding); 197 const WTF::TextEncoding* queryEncoding);
198 198
199 StringView componentStringView(const url::Component&) const;
200 String componentString(const url::Component&) const; 199 String componentString(const url::Component&) const;
201 StringView stringViewForInvalidComponent() const; 200 String stringForInvalidComponent() const;
202 201
203 template <typename CHAR> 202 template <typename CHAR>
204 void replaceComponents(const url::Replacements<CHAR>&); 203 void replaceComponents(const url::Replacements<CHAR>&);
205 204
206 void initInnerURL(); 205 void initInnerURL();
207 void initProtocolMetadata(); 206 void initProtocolIsInHTTPFamily();
208 207
209 bool m_isValid; 208 bool m_isValid;
210 bool m_protocolIsInHTTPFamily; 209 bool m_protocolIsInHTTPFamily;
211
212 // Keep a separate string for the protocol to avoid copious copies for
213 // protocol(). Normally this will be Atomic, except when constructed via
214 // KURL::copy(), which is deep.
215 String m_protocol;
216
217 url::Parsed m_parsed; 210 url::Parsed m_parsed;
218 String m_string; 211 String m_string;
219 std::unique_ptr<KURL> m_innerURL; 212 std::unique_ptr<KURL> m_innerURL;
220 }; 213 };
221 214
222 PLATFORM_EXPORT bool operator==(const KURL&, const KURL&); 215 PLATFORM_EXPORT bool operator==(const KURL&, const KURL&);
223 PLATFORM_EXPORT bool operator==(const KURL&, const String&); 216 PLATFORM_EXPORT bool operator==(const KURL&, const String&);
224 PLATFORM_EXPORT bool operator==(const String&, const KURL&); 217 PLATFORM_EXPORT bool operator==(const String&, const KURL&);
225 PLATFORM_EXPORT bool operator!=(const KURL&, const KURL&); 218 PLATFORM_EXPORT bool operator!=(const KURL&, const KURL&);
226 PLATFORM_EXPORT bool operator!=(const KURL&, const String&); 219 PLATFORM_EXPORT bool operator!=(const KURL&, const String&);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 281
289 // KURLHash is the default hash for String 282 // KURLHash is the default hash for String
290 template <> 283 template <>
291 struct DefaultHash<blink::KURL> { 284 struct DefaultHash<blink::KURL> {
292 typedef blink::KURLHash Hash; 285 typedef blink::KURLHash Hash;
293 }; 286 };
294 287
295 } // namespace WTF 288 } // namespace WTF
296 289
297 #endif // KURL_h 290 #endif // KURL_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698