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

Unified Diff: base/pickle.h

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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
« no previous file with comments | « base/pending_task.h ('k') | base/pickle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle.h
diff --git a/base/pickle.h b/base/pickle.h
index f2a198e3f2da9e13be0b4e20f1fcf8460133327b..e6b9d812b494e11922eb3ed1ba80ac59211320e9 100644
--- a/base/pickle.h
+++ b/base/pickle.h
@@ -13,6 +13,7 @@
#include "base/gtest_prod_util.h"
#include "base/logging.h"
#include "base/strings/string16.h"
+#include "base/strings/string_piece.h"
class Pickle;
@@ -39,8 +40,11 @@ class BASE_EXPORT PickleIterator {
bool ReadFloat(float* result) WARN_UNUSED_RESULT;
bool ReadDouble(double* result) WARN_UNUSED_RESULT;
bool ReadString(std::string* result) WARN_UNUSED_RESULT;
- bool ReadWString(std::wstring* result) WARN_UNUSED_RESULT;
+ // The StringPiece data will only be valid for the lifetime of the message.
+ bool ReadStringPiece(base::StringPiece* result) WARN_UNUSED_RESULT;
bool ReadString16(base::string16* result) WARN_UNUSED_RESULT;
+ // The StringPiece16 data will only be valid for the lifetime of the message.
+ bool ReadStringPiece16(base::StringPiece16* result) WARN_UNUSED_RESULT;
// A pointer to the data will be placed in |*data|, and the length will be
// placed in |*length|. The pointer placed into |*data| points into the
@@ -195,9 +199,8 @@ class BASE_EXPORT Pickle {
bool WriteDouble(double value) {
return WritePOD(value);
}
- bool WriteString(const std::string& value);
- bool WriteWString(const std::wstring& value);
- bool WriteString16(const base::string16& value);
+ bool WriteString(const base::StringPiece& value);
+ bool WriteString16(const base::StringPiece16& value);
// "Data" is a blob with a length. When you read it out you will be given the
// length. See also WriteBytes.
bool WriteData(const char* data, int length);
« no previous file with comments | « base/pending_task.h ('k') | base/pickle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698