| Index: ppapi/proxy/nacl_message_scanner.cc
|
| diff --git a/ppapi/proxy/nacl_message_scanner.cc b/ppapi/proxy/nacl_message_scanner.cc
|
| index 19edce26768e4ef656cec321ae7acdb3a71d1a6d..c098c6624aa75a3fc5a8711a74abcf4b45e1f936 100644
|
| --- a/ppapi/proxy/nacl_message_scanner.cc
|
| +++ b/ppapi/proxy/nacl_message_scanner.cc
|
| @@ -59,9 +59,19 @@ void WriteHandle(int handle_index,
|
| base::Pickle* msg) {
|
| SerializedHandle::WriteHeader(handle.header(), msg);
|
|
|
| - if (handle.type() != SerializedHandle::INVALID) {
|
| + if (handle.type() == SerializedHandle::SHARED_MEMORY) {
|
| // Now write the handle itself in POSIX style.
|
| - // See ParamTraits<FileDescriptor>::Read for where these values are read.
|
| + // This serialization must be kept in sync with
|
| + // ParamTraits<SharedMemoryHandle>::Write and
|
| + // ParamTraits<UnguessableToken>::Write.
|
| + msg->WriteBool(true); // valid == true
|
| + msg->WriteInt(handle_index);
|
| + msg->WriteUInt64(handle.shmem().GetGUID().GetHighForSerialization());
|
| + msg->WriteUInt64(handle.shmem().GetGUID().GetLowForSerialization());
|
| + } else if (handle.type() != SerializedHandle::INVALID) {
|
| + // Now write the handle itself in POSIX style.
|
| + // This serialization must be kept in sync with
|
| + // ParamTraits<FileDescriptor>::Write.
|
| msg->WriteBool(true); // valid == true
|
| msg->WriteInt(handle_index);
|
| }
|
|
|