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

Unified Diff: base/pickle.cc

Issue 981853002: Revert of Adding StringPiece read/write support to pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/pickle.h ('k') | base/pickle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle.cc
diff --git a/base/pickle.cc b/base/pickle.cc
index e66c5baca11bb382cea40489f7335f44b27254fd..d461f413dfd2e68a6e97c9f15d5d97dc68faacb3 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -152,18 +152,6 @@
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))
@@ -185,19 +173,6 @@
return false;
result->assign(reinterpret_cast<const char16*>(read_from), len);
- return true;
-}
-
-bool PickleIterator::ReadStringPiece16(base::StringPiece16* result) {
- int len;
- if (!ReadInt(&len))
- return false;
- const char* read_from = GetReadPointerAndAdvance(len, sizeof(char16));
- if (!read_from)
- return false;
-
- *result = base::StringPiece16(reinterpret_cast<const char16*>(read_from),
- len);
return true;
}
@@ -296,7 +271,7 @@
return *this;
}
-bool Pickle::WriteString(const base::StringPiece& value) {
+bool Pickle::WriteString(const std::string& value) {
if (!WriteInt(static_cast<int>(value.size())))
return false;
@@ -311,7 +286,7 @@
static_cast<int>(value.size() * sizeof(wchar_t)));
}
-bool Pickle::WriteString16(const base::StringPiece16& value) {
+bool Pickle::WriteString16(const string16& value) {
if (!WriteInt(static_cast<int>(value.size())))
return false;
« no previous file with comments | « base/pickle.h ('k') | base/pickle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698