summaryrefslogtreecommitdiffstats
path: root/base/pickle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/pickle.cc')
-rw-r--r--base/pickle.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/base/pickle.cc b/base/pickle.cc
index f6ed4cc..aac59df 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -144,6 +144,20 @@ bool Pickle::ReadSize(void** iter, size_t* result) const {
return true;
}
+bool Pickle::ReadUInt32(void** iter, uint32* result) const {
+ DCHECK(iter);
+ if (!*iter)
+ *iter = const_cast<char*>(payload());
+
+ if (!IteratorHasRoomFor(*iter, sizeof(*result)))
+ return false;
+
+ memcpy(result, *iter, sizeof(*result));
+
+ UpdateIter(iter, sizeof(*result));
+ return true;
+}
+
bool Pickle::ReadInt64(void** iter, int64* result) const {
DCHECK(iter);
if (!*iter)