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

Unified Diff: base/memory/shared_memory_handle_mac.cc

Issue 1421933002: Revert of mac: Add auto-close and share-read-only functionality to SharedMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « base/memory/shared_memory_handle.h ('k') | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_handle_mac.cc
diff --git a/base/memory/shared_memory_handle_mac.cc b/base/memory/shared_memory_handle_mac.cc
index 12f2f6893e016e9513e61a72596cd5e9f5a31630..13af82dbd952263bc36d023a736eea808717a654 100644
--- a/base/memory/shared_memory_handle_mac.cc
+++ b/base/memory/shared_memory_handle_mac.cc
@@ -8,7 +8,6 @@
#include <sys/mman.h>
#include <unistd.h>
-#include "base/mac/mac_util.h"
#include "base/posix/eintr_wrapper.h"
namespace base {
@@ -45,17 +44,12 @@
memory_object_ = named_right;
size_ = size;
pid_ = GetCurrentProcId();
- ownership_passes_to_ipc_ = false;
}
SharedMemoryHandle::SharedMemoryHandle(mach_port_t memory_object,
mach_vm_size_t size,
base::ProcessId pid)
- : type_(MACH),
- memory_object_(memory_object),
- size_(size),
- pid_(pid),
- ownership_passes_to_ipc_(false) {}
+ : type_(MACH), memory_object_(memory_object), size_(size), pid_(pid) {}
SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle)
: type_(handle.type_) {
@@ -177,9 +171,6 @@
return *memory && *memory != reinterpret_cast<void*>(-1);
case SharedMemoryHandle::MACH:
- // The flag VM_PROT_IS_MASK is only supported on OSX 10.7+.
- DCHECK(mac::IsOSLionOrLater());
-
DCHECK_EQ(pid_, GetCurrentProcId());
kern_return_t kr = mach_vm_map(
mach_task_self(),
@@ -191,7 +182,7 @@
offset,
FALSE, // Copy
VM_PROT_READ | (read_only ? 0 : VM_PROT_WRITE), // Current protection
- VM_PROT_WRITE | VM_PROT_READ | VM_PROT_IS_MASK, // Maximum protection
+ VM_PROT_READ | VM_PROT_WRITE, // Maximum protection
VM_INHERIT_NONE);
return kr == KERN_SUCCESS;
}
@@ -214,16 +205,6 @@
}
}
-void SharedMemoryHandle::SetOwnershipPassesToIPC(bool ownership_passes) {
- DCHECK_EQ(type_, MACH);
- ownership_passes_to_ipc_ = ownership_passes;
-}
-
-bool SharedMemoryHandle::OwnershipPassesToIPC() const {
- DCHECK_EQ(type_, MACH);
- return ownership_passes_to_ipc_;
-}
-
void SharedMemoryHandle::CopyRelevantData(const SharedMemoryHandle& handle) {
switch (type_) {
case POSIX:
@@ -233,7 +214,6 @@
memory_object_ = handle.memory_object_;
size_ = handle.size_;
pid_ = handle.pid_;
- ownership_passes_to_ipc_ = handle.ownership_passes_to_ipc_;
break;
}
}
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698