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

Unified Diff: base/memory/shared_memory_win.cc

Issue 2496783002: gpu: Reuse existing code for shared memory allocation. (Closed)
Patch Set: nacl 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_win.cc
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc
index 7e39b45ff9740de3f3c424a2ce89642e64f3bf2c..8eb6d066266ac19e1b4fa3533c99ae6b736bba2f 100644
--- a/base/memory/shared_memory_win.cc
+++ b/base/memory/shared_memory_win.cc
@@ -379,4 +379,12 @@ SharedMemoryHandle SharedMemory::handle() const {
return SharedMemoryHandle(mapped_file_.Get(), base::GetCurrentProcId());
}
+SharedMemoryHandle SharedMemory::TakeHandle() {
+ SharedMemoryHandle handle(mapped_file_.Take(), base::GetCurrentProcId());
+ handle.SetOwnershipPassesToIPC(true);
+ memory_ = NULL;
+ mapped_size_ = 0;
+ return handle;
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698