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

Unified Diff: base/memory/shared_memory_win.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_win.cc
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc
index 7e39b45ff9740de3f3c424a2ce89642e64f3bf2c..e7a88a5f06b7b126a295e1e935da939c900624d9 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_ = nullptr;
+ mapped_size_ = 0;
+ return handle;
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698