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

Side by Side Diff: ppapi/proxy/nacl_message_scanner.cc

Issue 2875453002: Add a size parameter to SharedMemoryHandle. (Closed)
Patch Set: Remove extraneous period. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/nacl_message_scanner.h" 5 #include "ppapi/proxy/nacl_message_scanner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <tuple> 9 #include <tuple>
10 #include <utility> 10 #include <utility>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (handle.type() == SerializedHandle::SHARED_MEMORY) { 62 if (handle.type() == SerializedHandle::SHARED_MEMORY) {
63 // Now write the handle itself in POSIX style. 63 // Now write the handle itself in POSIX style.
64 // This serialization must be kept in sync with 64 // This serialization must be kept in sync with
65 // ParamTraits<SharedMemoryHandle>::Write and 65 // ParamTraits<SharedMemoryHandle>::Write and
66 // ParamTraits<UnguessableToken>::Write. 66 // ParamTraits<UnguessableToken>::Write.
67 if (handle.shmem().IsValid()) { 67 if (handle.shmem().IsValid()) {
68 msg->WriteBool(true); // valid == true 68 msg->WriteBool(true); // valid == true
69 msg->WriteInt(handle_index); 69 msg->WriteInt(handle_index);
70 msg->WriteUInt64(handle.shmem().GetGUID().GetHighForSerialization()); 70 msg->WriteUInt64(handle.shmem().GetGUID().GetHighForSerialization());
71 msg->WriteUInt64(handle.shmem().GetGUID().GetLowForSerialization()); 71 msg->WriteUInt64(handle.shmem().GetGUID().GetLowForSerialization());
72 msg->WriteUInt64(handle.shmem().GetSize());
72 } else { 73 } else {
73 msg->WriteBool(false); // valid == false 74 msg->WriteBool(false); // valid == false
74 } 75 }
75 } else if (handle.type() != SerializedHandle::INVALID) { 76 } else if (handle.type() != SerializedHandle::INVALID) {
76 // Now write the handle itself in POSIX style. 77 // Now write the handle itself in POSIX style.
77 // This serialization must be kept in sync with 78 // This serialization must be kept in sync with
78 // ParamTraits<FileDescriptor>::Write. 79 // ParamTraits<FileDescriptor>::Write.
79 msg->WriteBool(true); // valid == true 80 msg->WriteBool(true); // valid == true
80 msg->WriteInt(handle_index); 81 msg->WriteInt(handle_index);
81 } 82 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 fio_it->second->SetMaxWrittenOffset(offset_it->second); 573 fio_it->second->SetMaxWrittenOffset(offset_it->second);
573 } 574 }
574 } 575 }
575 break; 576 break;
576 } 577 }
577 } 578 }
578 } 579 }
579 580
580 } // namespace proxy 581 } // namespace proxy
581 } // namespace ppapi 582 } // namespace ppapi
OLDNEW
« 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