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

Unified Diff: base/memory/shared_memory_nacl.cc

Issue 2845113005: Replace base::SharedMemory read-only methods with GetReadOnlyHandle. (Closed)
Patch Set: comments from jyasskin Created 3 years, 8 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: base/memory/shared_memory_nacl.cc
diff --git a/base/memory/shared_memory_nacl.cc b/base/memory/shared_memory_nacl.cc
index 670ade5ff34273e719affa5c1ea030d4bb0f252b..32c321068158d5c3fa4e8228e9bdb8c91e27a78a 100644
--- a/base/memory/shared_memory_nacl.cc
+++ b/base/memory/shared_memory_nacl.cc
@@ -125,18 +125,16 @@ void SharedMemory::Close() {
}
}
-bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
- SharedMemoryHandle *new_handle,
- bool close_self,
- ShareMode share_mode) {
- if (share_mode == SHARE_READONLY) {
- // Untrusted code can't create descriptors or handles, which is needed to
- // drop permissions.
- return false;
- }
+SharedMemoryHandle SharedMemory::GetReadOnlyHandle() {
+ // Untrusted code can't create descriptors or handles, which is needed to
+ // drop permissions.
+ return SharedMemoryHandle();
+}
+bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
+ SharedMemoryHandle* new_handle,
+ bool close_self) {
*new_handle = shm_.Duplicate();
-
if (close_self) {
Unmap();
Close();

Powered by Google App Engine
This is Rietveld 408576698