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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 1382583002: Add toStdString methods to CString and WTF::String (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to String::toUTF8StdString Created 5 years, 2 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/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index 256abc6a131a9904461570997cf74da03650d099..d2045f8b6dab1fe1ff31262c886ec403d037c451 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -33,6 +33,7 @@
#include "wtf/text/StringView.h"
#include <algorithm>
#include <iosfwd>
+#include <string>
#ifdef __OBJC__
#include <objc/objc.h>
@@ -179,6 +180,10 @@ public:
CString latin1() const;
CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const;
+ // This method should be used ONLY to pass a WTFString to methods outside
+ // of blink which take a std::string as an argument.
+ std::string toUTF8StdString() const;
+
UChar operator[](unsigned index) const
{
if (!m_impl || index >= m_impl->length())
« no previous file with comments | « third_party/WebKit/Source/wtf/text/CStringTest.cpp ('k') | third_party/WebKit/Source/wtf/text/WTFString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698