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

Unified Diff: ppapi/proxy/nacl_message_scanner.cc

Issue 2859843002: Add a GUID to base::SharedMemoryHandle. (Closed)
Patch Set: fix guid on android. 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
« no previous file with comments | « mojo/public/cpp/system/platform_handle.cc ('k') | sandbox/win/src/process_mitigations_win32k_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..79e6fa7e170d83a7b4c9c77032ecd34e7b39ce46 100644
--- a/ppapi/proxy/nacl_message_scanner.cc
+++ b/ppapi/proxy/nacl_message_scanner.cc
@@ -59,9 +59,23 @@ 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.
+ if (handle.shmem().IsValid()) {
+ msg->WriteBool(true); // valid == true
+ msg->WriteInt(handle_index);
+ msg->WriteUInt64(handle.shmem().GetGUID().GetHighForSerialization());
+ msg->WriteUInt64(handle.shmem().GetGUID().GetLowForSerialization());
+ } else {
+ msg->WriteBool(false); // valid == false
+ }
+ } 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);
}
« no previous file with comments | « mojo/public/cpp/system/platform_handle.cc ('k') | sandbox/win/src/process_mitigations_win32k_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698