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

Unified Diff: base/memory/shared_memory_posix.cc

Issue 2775423003: Add ownership edges between HostSharedBitmap and shared memory
Patch Set: Fix comments Created 3 years, 9 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 bf29e9f02a1ec5f188ef0f4ff10e12c037835bee..58d6c3146137d805bbef26b213a03e80073ab591 100644
--- a/base/memory/shared_memory_posix.cc
+++ b/base/memory/shared_memory_posix.cc
@@ -395,7 +395,9 @@ bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
return true;
}
-bool SharedMemory::GetUniqueId(SharedMemory::UniqueId* id) const {
+// static
+bool SharedMemory::GetUniqueId(const SharedMemoryHandle& handle,
+ SharedMemory::UniqueId* id) {
// 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:
@@ -406,7 +408,7 @@ bool SharedMemory::GetUniqueId(SharedMemory::UniqueId* id) const {
// crbug.com/604726#c41.
base::ThreadRestrictions::ScopedAllowIO allow_io;
struct stat file_stat;
- if (HANDLE_EINTR(::fstat(static_cast<int>(handle().fd), &file_stat)) != 0)
+ if (HANDLE_EINTR(::fstat(static_cast<int>(handle.fd), &file_stat)) != 0)
return false;
id->first = file_stat.st_dev;
id->second = file_stat.st_ino;
« 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