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

Unified Diff: base/memory/shared_memory_mac_unittest.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. 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
« no previous file with comments | « base/memory/shared_memory_mac.cc ('k') | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_mac_unittest.cc
diff --git a/base/memory/shared_memory_mac_unittest.cc b/base/memory/shared_memory_mac_unittest.cc
index f5d239ff8201503eb264bc52552780078767ebe1..8a6f110215b0516edf7ee7a6b9d45daeba4deb90 100644
--- a/base/memory/shared_memory_mac_unittest.cc
+++ b/base/memory/shared_memory_mac_unittest.cc
@@ -373,16 +373,15 @@ TEST_F(SharedMemoryMacMultiProcessTest, MachReadOnly) {
ASSERT_DEATH(memset(shared_memory2.memory(), 'b', s_memory_size), "");
}
-// Tests that the method ShareToProcess() works.
-TEST_F(SharedMemoryMacMultiProcessTest, MachShareToProcess) {
+// Tests that duplication of the underlying handle works.
+TEST_F(SharedMemoryMacMultiProcessTest, MachDuplicate) {
mach_msg_type_number_t active_name_count = GetActiveNameCount();
{
std::unique_ptr<SharedMemory> shared_memory(
CreateSharedMemory(s_memory_size));
- SharedMemoryHandle shm2;
- ASSERT_TRUE(shared_memory->ShareToProcess(GetCurrentProcId(), &shm2));
+ SharedMemoryHandle shm2 = shared_memory->handle().Duplicate();
ASSERT_TRUE(shm2.IsValid());
SharedMemory shared_memory2(shm2, true);
shared_memory2.Map(s_memory_size);
@@ -396,7 +395,7 @@ TEST_F(SharedMemoryMacMultiProcessTest, MachShareToProcess) {
// Tests that the method GetReadOnlyHandle() creates a memory object that
// is read only.
-TEST_F(SharedMemoryMacMultiProcessTest, MachShareToProcessReadonly) {
+TEST_F(SharedMemoryMacMultiProcessTest, MachReadonly) {
std::unique_ptr<SharedMemory> shared_memory(
CreateSharedMemory(s_memory_size));
@@ -435,7 +434,7 @@ TEST_F(SharedMemoryMacMultiProcessTest, MachShareToProcessReadonly) {
}
// Tests that the method GetReadOnlyHandle() doesn't leak.
-TEST_F(SharedMemoryMacMultiProcessTest, MachShareToProcessReadonlyLeak) {
+TEST_F(SharedMemoryMacMultiProcessTest, MachReadonlyLeak) {
mach_msg_type_number_t active_name_count = GetActiveNameCount();
{
« no previous file with comments | « base/memory/shared_memory_mac.cc ('k') | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698