summaryrefslogtreecommitdiffstats
path: root/base/pickle.cc
diff options
context:
space:
mode:
authorklink@google.com <klink@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 23:24:54 +0000
committerklink@google.com <klink@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 23:24:54 +0000
commit43beaef40b42c3afb4870043ab5720286e786ae4 (patch)
tree3abd0dd136552ad3055abfa2ca9a476463d8711c /base/pickle.cc
parent77c40528d35beef9559b2e3412f04b472b995c4e (diff)
downloadchromium_src-43beaef40b42c3afb4870043ab5720286e786ae4.zip
chromium_src-43beaef40b42c3afb4870043ab5720286e786ae4.tar.gz
chromium_src-43beaef40b42c3afb4870043ab5720286e786ae4.tar.bz2
Adds capabilities for IPC messages of type long, for the primary purpose of accessibility related communication.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/pickle.cc')
-rw-r--r--base/pickle.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/base/pickle.cc b/base/pickle.cc
index 73a764a..83efaf1 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -130,6 +130,22 @@ bool Pickle::ReadInt(void** iter, int* result) const {
return true;
}
+bool Pickle::ReadLong(void** iter, long* result) const {
+ DCHECK(iter);
+ if (!*iter)
+ *iter = const_cast<char*>(payload());
+
+ if (!IteratorHasRoomFor(*iter, sizeof(*result)))
+ return false;
+
+ // TODO(jar) bug 1129285: Pickle should be cleaned up, and not dependent on
+ // alignment.
+ memcpy(result, *iter, sizeof(*result));
+
+ UpdateIter(iter, sizeof(*result));
+ return true;
+}
+
bool Pickle::ReadLength(void** iter, int* result) const {
if (!ReadInt(iter, result))
return false;