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

Unified Diff: base/memory/shared_memory_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_posix.cc ('k') | base/memory/shared_memory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_unittest.cc
diff --git a/base/memory/shared_memory_unittest.cc b/base/memory/shared_memory_unittest.cc
index 2bae0e9d1a2cf01103889b650d926a59dceb5d38..36296f4de10072aa17daaf795e78bc60e6c9c92a 100644
--- a/base/memory/shared_memory_unittest.cc
+++ b/base/memory/shared_memory_unittest.cc
@@ -410,8 +410,8 @@ TEST(SharedMemoryTest, ShareToSelf) {
memcpy(shmem.memory(), contents.data(), contents.size());
EXPECT_TRUE(shmem.Unmap());
- SharedMemoryHandle shared_handle;
- ASSERT_TRUE(shmem.ShareToProcess(GetCurrentProcessHandle(), &shared_handle));
+ SharedMemoryHandle shared_handle = shmem.handle().Duplicate();
+ ASSERT_TRUE(shared_handle.IsValid());
#if defined(OS_WIN)
ASSERT_TRUE(shared_handle.OwnershipPassesToIPC());
#endif
@@ -422,8 +422,8 @@ TEST(SharedMemoryTest, ShareToSelf) {
contents,
StringPiece(static_cast<const char*>(shared.memory()), contents.size()));
- shared_handle = SharedMemoryHandle();
- ASSERT_TRUE(shmem.ShareToProcess(GetCurrentProcessHandle(), &shared_handle));
+ shared_handle = shmem.handle().Duplicate();
+ ASSERT_TRUE(shared_handle.IsValid());
#if defined(OS_WIN)
ASSERT_TRUE(shared_handle.OwnershipPassesToIPC());
#endif
« no previous file with comments | « base/memory/shared_memory_posix.cc ('k') | base/memory/shared_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698