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

Unified Diff: base/memory/shared_memory_posix.cc

Issue 2873433004: Replace SharedMemory::UniqueID usages with SharedMemoryHandle's guid (Closed)
Patch Set: Address on reviews Created 3 years, 7 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.h ('k') | base/memory/shared_memory_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_posix.cc
diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc
index 91fd3529e0f7dae080b558de42bee6de77193740..e3f333d657eb76e70d224251420e0931139747fe 100644
--- a/base/memory/shared_memory_posix.cc
+++ b/base/memory/shared_memory_posix.cc
@@ -359,23 +359,4 @@ SharedMemoryHandle SharedMemory::GetReadOnlyHandle() {
return readonly_shm_.Duplicate();
}
-bool SharedMemory::GetUniqueId(SharedMemory::UniqueId* id) const {
- // This function is called just after mmap. fstat is a system call that might
- // cause I/O. It's safe to call fstat here because mmap for shared memory is
- // called in two cases:
- // 1) To handle file-mapped memory
- // 2) To handle annonymous shared memory
- // In 1), I/O is already permitted. In 2), the backend is on page cache and
- // fstat doesn't cause I/O access to the disk. See the discussion at
- // crbug.com/604726#c41.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- struct stat file_stat;
- if (HANDLE_EINTR(
- ::fstat(static_cast<int>(handle().GetHandle()), &file_stat)) != 0)
- return false;
- id->first = file_stat.st_dev;
- id->second = file_stat.st_ino;
- return true;
-}
-
} // namespace base
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698