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

Unified Diff: third_party/WebKit/public/platform/WebString.h

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/public/platform/WebString.h
diff --git a/third_party/WebKit/public/platform/WebString.h b/third_party/WebKit/public/platform/WebString.h
index 8e4bbcc473ca4f4d985f70d943cf953a5734dfad..4948d0355ee585238f33d466013dd253c6f2435a 100644
--- a/third_party/WebKit/public/platform/WebString.h
+++ b/third_party/WebKit/public/platform/WebString.h
@@ -38,9 +38,9 @@
#if INSIDE_BLINK
#include "wtf/Forward.h"
#else
-#include <base/strings/latin1_string_conversions.h>
-#include <base/strings/nullable_string16.h>
-#include <base/strings/string16.h>
+#include "base/strings/latin1_string_conversions.h"
+#include "base/strings/nullable_string16.h"
+#include "base/strings/string16.h"
#endif
namespace WTF {
@@ -85,6 +85,8 @@ public:
bool isEmpty() const { return !length(); }
bool isNull() const { return m_private.isNull(); }
+ // See also WebStringUTF8Adaptor which will allow getting a UTF-8 buffer
+ // without copying when the string is ASCII.
BLINK_COMMON_EXPORT std::string utf8() const;
BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data, size_t length);
@@ -171,6 +173,8 @@ private:
BLINK_COMMON_EXPORT void assign(WTF::StringImpl*);
WebPrivatePtr<WTF::StringImpl> m_private;
+
+ friend class WebStringUTF8Adaptor;
esprehn 2016/01/13 02:02:31 you don't need friends.
};
inline bool operator==(const WebString& a, const char* b)

Powered by Google App Engine
This is Rietveld 408576698