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

Unified Diff: base/memory/shared_memory_nacl.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_nacl.cc
diff --git a/base/memory/shared_memory_nacl.cc b/base/memory/shared_memory_nacl.cc
index 6775ddc3e8e556a33ef3e73497daae22bd06ffe1..945fc61375a901187ced95dbc5ece779e479c4cf 100644
--- a/base/memory/shared_memory_nacl.cc
+++ b/base/memory/shared_memory_nacl.cc
@@ -122,6 +122,14 @@ SharedMemoryHandle SharedMemory::handle() const {
return FileDescriptor(mapped_file_, false);
}
+SharedMemoryHandle SharedMemory::TakeHandle() {
+ FileDescriptor handle(mapped_file_, true);
+ mapped_file_ = -1;
+ memory_ = nullptr;
+ mapped_size_ = 0;
+ return handle;
+}
+
void SharedMemory::Close() {
if (mapped_file_ > 0) {
if (close(mapped_file_) < 0)

Powered by Google App Engine
This is Rietveld 408576698