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

Unified Diff: base/pickle.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 112ddc33e7b5b85cd9f2db8f4ee722110818bd62..09d42c9deb0165b12e46d46b798e57b45f4f041a 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -8,10 +8,7 @@
#include <algorithm> // for max()
-//------------------------------------------------------------------------------
-
-using base::char16;
-using base::string16;
+namespace base {
// static
const int Pickle::kPayloadUnit = 64;
@@ -152,7 +149,7 @@ bool PickleIterator::ReadString(std::string* result) {
return true;
}
-bool PickleIterator::ReadStringPiece(base::StringPiece* result) {
+bool PickleIterator::ReadStringPiece(StringPiece* result) {
int len;
if (!ReadInt(&len))
return false;
@@ -160,7 +157,7 @@ bool PickleIterator::ReadStringPiece(base::StringPiece* result) {
if (!read_from)
return false;
- *result = base::StringPiece(read_from, len);
+ *result = StringPiece(read_from, len);
return true;
}
@@ -176,7 +173,7 @@ bool PickleIterator::ReadString16(string16* result) {
return true;
}
-bool PickleIterator::ReadStringPiece16(base::StringPiece16* result) {
+bool PickleIterator::ReadStringPiece16(StringPiece16* result) {
int len;
if (!ReadInt(&len))
return false;
@@ -184,8 +181,7 @@ bool PickleIterator::ReadStringPiece16(base::StringPiece16* result) {
if (!read_from)
return false;
- *result = base::StringPiece16(reinterpret_cast<const char16*>(read_from),
- len);
+ *result = StringPiece16(reinterpret_cast<const char16*>(read_from), len);
return true;
}
@@ -284,14 +280,14 @@ Pickle& Pickle::operator=(const Pickle& other) {
return *this;
}
-bool Pickle::WriteString(const base::StringPiece& value) {
+bool Pickle::WriteString(const StringPiece& value) {
if (!WriteInt(static_cast<int>(value.size())))
return false;
return WriteBytes(value.data(), static_cast<int>(value.size()));
}
-bool Pickle::WriteString16(const base::StringPiece16& value) {
+bool Pickle::WriteString16(const StringPiece16& value) {
if (!WriteInt(static_cast<int>(value.size())))
return false;
@@ -376,3 +372,5 @@ inline void Pickle::WriteBytesCommon(const void* data, size_t length) {
header_->payload_size = static_cast<uint32>(new_size);
write_offset_ = new_size;
}
+
+} // namespace base
« 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