Index: ppapi/proxy/ppapi_param_traits.cc |
diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc |
index 763d05c4ade08aada8200118d528f82eb67050c5..ea792e6d30dfb77f8ac46ceaba46f8469febe575 100644 |
--- a/ppapi/proxy/ppapi_param_traits.cc |
+++ b/ppapi/proxy/ppapi_param_traits.cc |
@@ -346,6 +346,7 @@ void ParamTraits<ppapi::proxy::SerializedHandle>::Write(Message* m, |
break; |
case ppapi::proxy::SerializedHandle::SOCKET: |
case ppapi::proxy::SerializedHandle::CHANNEL_HANDLE: |
+ case ppapi::proxy::SerializedHandle::FILE: |
ParamTraits<IPC::PlatformFileForTransit>::Write(m, p.descriptor()); |
break; |
case ppapi::proxy::SerializedHandle::INVALID: |
@@ -386,6 +387,14 @@ bool ParamTraits<ppapi::proxy::SerializedHandle>::Read(const Message* m, |
} |
break; |
} |
+ case ppapi::proxy::SerializedHandle::FILE: { |
+ IPC::PlatformFileForTransit desc; |
+ if (ParamTraits<IPC::PlatformFileForTransit>::Read(m, iter, &desc)) { |
+ r->set_file_handle(desc); |
+ return true; |
+ } |
+ break; |
+ } |
case ppapi::proxy::SerializedHandle::INVALID: |
return true; |
// No default so the compiler will warn us if a new type is added. |
@@ -552,6 +561,41 @@ void ParamTraits<ppapi::proxy::SerializedFontDescription>::Log( |
std::string* l) { |
} |
+// ppapi::PepperFilePath ------------------------------------------------------- |
+ |
+// static |
+void ParamTraits<ppapi::PepperFilePath>::Write(Message* m, |
+ const param_type& p) { |
+ WriteParam(m, static_cast<unsigned>(p.domain())); |
+ WriteParam(m, p.path()); |
+} |
+ |
+// static |
+bool ParamTraits<ppapi::PepperFilePath>::Read(const Message* m, |
+ PickleIterator* iter, |
+ param_type* p) { |
+ unsigned domain; |
+ FilePath path; |
+ if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path)) |
+ return false; |
+ if (domain > ppapi::PepperFilePath::DOMAIN_MAX_VALID) |
+ return false; |
+ |
+ *p = ppapi::PepperFilePath( |
+ static_cast<ppapi::PepperFilePath::Domain>(domain), path); |
+ return true; |
+} |
+ |
+// static |
+void ParamTraits<ppapi::PepperFilePath>::Log(const param_type& p, |
+ std::string* l) { |
+ l->append("("); |
+ LogParam(static_cast<unsigned>(p.domain()), l); |
+ l->append(", "); |
+ LogParam(p.path(), l); |
+ l->append(")"); |
+} |
+ |
// SerializedFlashMenu --------------------------------------------------------- |
// static |