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

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

Issue 1458513002: Implement StringUTF8Adaptor::asStringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add //base to wtf's public_deps. Created 5 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
« no previous file with comments | « third_party/WebKit/Source/wtf/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
diff --git a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
index 567bb995d67b9eda9f0bc6849e168c447299dfba..10928b3c1af3bcc37e713ae2c9c0a1784c072177 100644
--- a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
+++ b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
@@ -31,6 +31,7 @@
#ifndef StringUTF8Adaptor_h
#define StringUTF8Adaptor_h
+#include "base/strings/string_piece.h"
#include "wtf/text/CString.h"
#include "wtf/text/TextEncoding.h"
#include "wtf/text/WTFString.h"
@@ -65,6 +66,8 @@ public:
const char* data() const { return m_data; }
size_t length() const { return m_length; }
+ base::StringPiece asStringPiece() const { return base::StringPiece(m_data, m_length); }
+
private:
CString m_utf8Buffer;
const char* m_data;
« no previous file with comments | « third_party/WebKit/Source/wtf/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698