summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppapi_param_traits.cc
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-30 17:19:02 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-30 17:19:02 +0000
commit24498a8e674e456f5d778f3e192d886fa4573ec9 (patch)
tree3a01d312cd4fc1bc5b329b05e04f4e21acd380d2 /ppapi/proxy/ppapi_param_traits.cc
parenta64ccdb0c5dbe674a3cdc368ab758fdde0b4a5d9 (diff)
downloadchromium_src-24498a8e674e456f5d778f3e192d886fa4573ec9.zip
chromium_src-24498a8e674e456f5d778f3e192d886fa4573ec9.tar.gz
chromium_src-24498a8e674e456f5d778f3e192d886fa4573ec9.tar.bz2
Define PPB_Flash_TCPSocket and PPB_Flash_SSLSocket.
TEST=None BUG=None Review URL: http://codereview.chromium.org/7191005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91150 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppapi_param_traits.cc')
-rw-r--r--ppapi/proxy/ppapi_param_traits.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc
index 20a00c8..aa21dc1 100644
--- a/ppapi/proxy/ppapi_param_traits.cc
+++ b/ppapi/proxy/ppapi_param_traits.cc
@@ -8,6 +8,7 @@
#include "ppapi/c/dev/pp_file_info_dev.h"
#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/private/ppb_flash_tcp_socket.h"
#include "ppapi/proxy/host_resource.h"
#include "ppapi/proxy/interface_proxy.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -136,6 +137,40 @@ bool ParamTraits<PP_FileInfo_Dev>::Read(const Message* m, void** iter,
void ParamTraits<PP_FileInfo_Dev>::Log(const param_type& p, std::string* l) {
}
+// PP_Flash_NetAddress ---------------------------------------------------------
+
+// static
+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));
+}
+
+// static
+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;
+}
+
+// static
+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)>");
+}
+
// PP_InputEvent ---------------------------------------------------------------
// static