Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: ppapi/proxy/nacl_message_scanner.cc

Issue 2859843002: Add a GUID to base::SharedMemoryHandle. (Closed)
Patch Set: accidentally dupicated line Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698