| Index: ppapi/proxy/ppapi_param_traits.cc
|
| diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc
|
| index 23d2b727af3ecdd2866613ae70b13765fd5ba350..b6079322fa70214e27e90f8690107cba91cfb294 100644
|
| --- a/ppapi/proxy/ppapi_param_traits.cc
|
| +++ b/ppapi/proxy/ppapi_param_traits.cc
|
| @@ -10,8 +10,8 @@
|
| #include "ppapi/c/pp_resource.h"
|
| #include "ppapi/c/private/ppb_flash_tcp_socket.h"
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| -#include "ppapi/proxy/serialized_var.h"
|
| #include "ppapi/proxy/serialized_flash_menu.h"
|
| +#include "ppapi/proxy/serialized_var.h"
|
| #include "ppapi/shared_impl/host_resource.h"
|
|
|
| namespace IPC {
|
| @@ -137,6 +137,39 @@ bool ParamTraits<PP_FileInfo>::Read(const Message* m, void** iter,
|
| void ParamTraits<PP_FileInfo>::Log(const param_type& p, std::string* l) {
|
| }
|
|
|
| +// PP_HostResolver_Private_Hint ------------------------------------------------
|
| +// static
|
| +void ParamTraits<PP_HostResolver_Private_Hint>::Write(Message* m,
|
| + const param_type& p) {
|
| + ParamTraits<int>::Write(m, static_cast<int>(p.family));
|
| + ParamTraits<int>::Write(m, static_cast<int>(p.flags));
|
| +}
|
| +
|
| +// static
|
| +bool ParamTraits<PP_HostResolver_Private_Hint>::Read(const Message* m,
|
| + void** iter,
|
| + param_type* r) {
|
| + int family, flags;
|
| + if (!ParamTraits<int>::Read(m, iter, &family) ||
|
| + !ParamTraits<int>::Read(m, iter, &flags)) {
|
| + return false;
|
| + }
|
| +
|
| + if (family != PP_NETADDRESSFAMILY_UNSPECIFIED &&
|
| + family != PP_NETADDRESSFAMILY_IPV4 &&
|
| + family != PP_NETADDRESSFAMILY_IPV6) {
|
| + return false;
|
| + }
|
| + r->family = static_cast<PP_NetAddressFamily_Private>(family);
|
| + r->flags = static_cast<PP_HostResolver_Private_Flags>(flags);
|
| + return true;
|
| +}
|
| +
|
| +// static
|
| +void ParamTraits<PP_HostResolver_Private_Hint>::Log(const param_type& p,
|
| + std::string* l) {
|
| +}
|
| +
|
| // PP_NetAddress_Private -------------------------------------------------------
|
|
|
| // static
|
| @@ -399,6 +432,61 @@ void ParamTraits<ppapi::HostResource>::Log(const param_type& p,
|
| std::string* l) {
|
| }
|
|
|
| +// NameAndAddressPair ----------------------------------------------------------
|
| +
|
| +// static
|
| +void ParamTraits<ppapi::NameAndAddressPair>::Write(Message* m,
|
| + const param_type& p) {
|
| + ParamTraits<std::string>::Write(m, p.canonical_name);
|
| + ParamTraits<PP_NetAddress_Private>::Write(m, p.address);
|
| +}
|
| +
|
| +// static
|
| +bool ParamTraits<ppapi::NameAndAddressPair>::Read(const Message* m,
|
| + void** iter,
|
| + param_type* r) {
|
| + if (!ParamTraits<std::string>::Read(m, iter, &r->canonical_name) ||
|
| + !ParamTraits<PP_NetAddress_Private>::Read(m, iter, &r->address)) {
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +// static
|
| +void ParamTraits<ppapi::NameAndAddressPair>::Log(const param_type& p,
|
| + std::string* l) {
|
| +}
|
| +
|
| +// NetworkList -----------------------------------------------------------------
|
| +
|
| +// static
|
| +void ParamTraits<ppapi::NetworkList>::Write(Message* m, const param_type& p) {
|
| + ParamTraits<int>::Write(m, static_cast<int>(p.size()));
|
| + for (ppapi::NetworkList::const_iterator it = p.begin(); it != p.end(); ++it)
|
| + ParamTraits<ppapi::NameAndAddressPair>::Write(m, *it);
|
| +}
|
| +
|
| +// static
|
| +bool ParamTraits<ppapi::NetworkList>::Read(const Message* m,
|
| + void** iter,
|
| + param_type* r) {
|
| + int size;
|
| + if (!ParamTraits<int>::Read(m, iter, &size))
|
| + return false;
|
| +
|
| + r->resize(size);
|
| + for (int i = 0; i < size; ++i) {
|
| + if (!ParamTraits<ppapi::NameAndAddressPair>::Read(m, iter, &(*r)[i]))
|
| + return false;
|
| + }
|
| +
|
| + return true;
|
| +}
|
| +
|
| +// static
|
| +void ParamTraits<ppapi::NetworkList>::Log(const param_type& p, std::string* l) {
|
| +}
|
| +
|
| // SerializedVar ---------------------------------------------------------------
|
|
|
| // static
|
|
|