summaryrefslogtreecommitdiffstats
path: root/chrome/common/pepper_messages.cc
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-31 20:30:28 +0100
committerKristian Monsen <kristianm@google.com>2011-06-14 20:31:41 -0700
commit72a454cd3513ac24fbdd0e0cb9ad70b86a99b801 (patch)
tree382278a54ce7a744d62fa510a9a80688cc12434b /chrome/common/pepper_messages.cc
parentc4becdd46e31d261b930e4b5a539cbc1d45c23a6 (diff)
downloadexternal_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.zip
external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.gz
external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.bz2
Merge Chromium.org at r11.0.672.0: Initial merge by git.
Change-Id: I8b4aaf611a2a405fe3fe10e8a94ea7658645c192
Diffstat (limited to 'chrome/common/pepper_messages.cc')
-rw-r--r--chrome/common/pepper_messages.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/chrome/common/pepper_messages.cc b/chrome/common/pepper_messages.cc
new file mode 100644
index 0000000..60dad0d
--- /dev/null
+++ b/chrome/common/pepper_messages.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/common_param_traits.h"
+#include "ppapi/c/private/ppb_flash.h"
+
+#define IPC_MESSAGE_IMPL
+#include "chrome/common/pepper_messages.h"
+
+namespace IPC {
+
+void ParamTraits<PP_Flash_NetAddress>::Write(Message* m, const param_type& p) {
+ WriteParam(m, p.size);
+ m->WriteBytes(p.data, static_cast<int>(p.size));
+}
+
+bool ParamTraits<PP_Flash_NetAddress>::Read(const Message* m,
+ void** iter,
+ param_type* p) {
+ uint16 size;
+ if (!ReadParam(m, iter, &size))
+ return false;
+ if (size > sizeof(p->data))
+ return false;
+ p->size = size;
+
+ const char* data;
+ if (!m->ReadBytes(iter, &data, size))
+ return false;
+ memcpy(p->data, data, size);
+ return true;
+}
+
+void ParamTraits<PP_Flash_NetAddress>::Log(const param_type& p,
+ std::string* l) {
+ l->append("<PP_Flash_NetAddress (");
+ LogParam(p.size, l);
+ l->append(" bytes)>");
+}
+
+} // namespace IPC