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

Unified Diff: base/memory/shared_memory_unittest.cc

Issue 1200473003: Revert of Make SharedMemoryHandle a class on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_make_class3_base
Patch Set: Created 5 years, 6 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 c129e18d4c3049961ee1462cb93870c2485e594e..7ed8955525ec972392536e3369b0d0657632194b 100644
--- a/base/memory/shared_memory_unittest.cc
+++ b/base/memory/shared_memory_unittest.cc
@@ -360,13 +360,12 @@
// http://crbug.com/320865
(void)handle;
#elif defined(OS_POSIX)
- int handle_fd = SharedMemory::GetFdFromSharedMemoryHandle(handle);
- EXPECT_EQ(O_RDONLY, fcntl(handle_fd, F_GETFL) & O_ACCMODE)
+ EXPECT_EQ(O_RDONLY, fcntl(handle.fd, F_GETFL) & O_ACCMODE)
<< "The descriptor itself should be read-only.";
errno = 0;
- void* writable = mmap(NULL, contents.size(), PROT_READ | PROT_WRITE,
- MAP_SHARED, handle_fd, 0);
+ void* writable = mmap(
+ NULL, contents.size(), PROT_READ | PROT_WRITE, MAP_SHARED, handle.fd, 0);
int mmap_errno = errno;
EXPECT_EQ(MAP_FAILED, writable)
<< "It shouldn't be possible to re-mmap the descriptor writable.";
@@ -520,8 +519,7 @@
EXPECT_TRUE(shared_memory.Create(options));
- int shm_fd =
- SharedMemory::GetFdFromSharedMemoryHandle(shared_memory.handle());
+ int shm_fd = shared_memory.handle().fd;
struct stat shm_stat;
EXPECT_EQ(0, fstat(shm_fd, &shm_stat));
// Neither the group, nor others should be able to read the shared memory
@@ -547,8 +545,7 @@
// Clean-up the backing file name immediately, we don't need it.
EXPECT_TRUE(shared_memory.Delete(shared_mem_name));
- int shm_fd =
- SharedMemory::GetFdFromSharedMemoryHandle(shared_memory.handle());
+ int shm_fd = shared_memory.handle().fd;
struct stat shm_stat;
EXPECT_EQ(0, fstat(shm_fd, &shm_stat));
// Neither the group, nor others should have been able to open the shared
« 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