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

Unified Diff: base/memory/shared_memory_win.cc

Issue 2849243002: Get rid of all pid references from base::SharedMemoryHandle. (Closed)
Patch Set: fix invalid handle Chrome IPC. 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_unittest.cc ('k') | base/metrics/field_trial.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_win.cc
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc
index bdb8244345e7bf94ab8ef63951ff5fef3a37f020..1dfa10fbe58b54b689d69c7ccde9e03015f9e758 100644
--- a/base/memory/shared_memory_win.cc
+++ b/base/memory/shared_memory_win.cc
@@ -156,7 +156,6 @@ SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only)
memory_(NULL),
read_only_(read_only),
requested_size_(0) {
- DCHECK(!handle.IsValid() || handle.BelongsToCurrentProcess());
mapped_file_.Set(handle.GetHandle());
}
@@ -334,8 +333,7 @@ SharedMemoryHandle SharedMemory::GetReadOnlyHandle() {
FILE_MAP_READ | SECTION_QUERY, FALSE, 0)) {
return SharedMemoryHandle();
}
- SharedMemoryHandle handle =
- SharedMemoryHandle(result, base::GetProcId(process));
+ SharedMemoryHandle handle = SharedMemoryHandle(result);
handle.SetOwnershipPassesToIPC(true);
return handle;
}
@@ -345,11 +343,11 @@ void SharedMemory::Close() {
}
SharedMemoryHandle SharedMemory::handle() const {
- return SharedMemoryHandle(mapped_file_.Get(), base::GetCurrentProcId());
+ return SharedMemoryHandle(mapped_file_.Get());
}
SharedMemoryHandle SharedMemory::TakeHandle() {
- SharedMemoryHandle handle(mapped_file_.Take(), base::GetCurrentProcId());
+ SharedMemoryHandle handle(mapped_file_.Take());
handle.SetOwnershipPassesToIPC(true);
memory_ = nullptr;
mapped_size_ = 0;
« no previous file with comments | « base/memory/shared_memory_unittest.cc ('k') | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698