| Index: base/pickle.cc
|
| diff --git a/base/pickle.cc b/base/pickle.cc
|
| index d461f413dfd2e68a6e97c9f15d5d97dc68faacb3..c8ed7814811b08742af722490f3af29bf4cce187 100644
|
| --- a/base/pickle.cc
|
| +++ b/base/pickle.cc
|
| @@ -152,6 +152,18 @@ bool PickleIterator::ReadString(std::string* result) {
|
| return true;
|
| }
|
|
|
| +bool PickleIterator::ReadStringPiece(base::StringPiece* result) {
|
| + int len;
|
| + if (!ReadInt(&len))
|
| + return false;
|
| + const char* read_from = GetReadPointerAndAdvance(len);
|
| + if (!read_from)
|
| + return false;
|
| +
|
| + *result = base::StringPiece(read_from, len);
|
| + return true;
|
| +}
|
| +
|
| bool PickleIterator::ReadWString(std::wstring* result) {
|
| int len;
|
| if (!ReadInt(&len))
|
| @@ -271,7 +283,8 @@ Pickle& Pickle::operator=(const Pickle& other) {
|
| return *this;
|
| }
|
|
|
| -bool Pickle::WriteString(const std::string& value) {
|
| +bool Pickle::WriteString(const base::StringPiece& value)
|
| +{
|
| if (!WriteInt(static_cast<int>(value.size())))
|
| return false;
|
|
|
|
|