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

Unified Diff: base/memory/shared_memory_mac.cc

Issue 2496783002: gpu: Reuse existing code for shared memory allocation. (Closed)
Patch Set: . Created 4 years, 1 month 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
Index: base/memory/shared_memory_mac.cc
diff --git a/base/memory/shared_memory_mac.cc b/base/memory/shared_memory_mac.cc
index 0b3a62f0e7a44643c786fe239ec5862377e657e6..a8f09555d96de9b6ab420b2123f5999cd8bf9223 100644
--- a/base/memory/shared_memory_mac.cc
+++ b/base/memory/shared_memory_mac.cc
@@ -177,6 +177,12 @@ SharedMemoryHandle SharedMemory::handle() const {
return shm_;
}
+SharedMemoryHandle SharedMemory::TakeHandle() {
+ SharedMemoryHandle dup = DuplicateHandle(handle());
+ Close();
+ return dup;
+}
+
void SharedMemory::Close() {
shm_.Close();
shm_ = SharedMemoryHandle();

Powered by Google App Engine
This is Rietveld 408576698