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

Unified Diff: base/pickle.cc

Issue 6488010: Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address eroman's comments Created 9 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
Index: base/pickle.cc
diff --git a/base/pickle.cc b/base/pickle.cc
index e7d5768803d8eb02a9d2fbab86031978497e7aaf..116d3f1bf6ee94de811040d642cc04397708aab0 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -157,6 +157,20 @@ bool Pickle::ReadSize(void** iter, size_t* result) const {
return true;
}
+bool Pickle::ReadUInt16(void** iter, uint16* 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::ReadUInt32(void** iter, uint32* result) const {
DCHECK(iter);
if (!*iter)
« no previous file with comments | « base/pickle.h ('k') | base/pickle_unittest.cc » ('j') | net/http/http_response_info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698