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

Unified Diff: base/memory/shared_memory_handle.h

Issue 1422873002: Reland 1: "mac: Add auto-close and share-read-only functionality to SharedMemory." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix error. Created 5 years, 2 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 | « no previous file | base/memory/shared_memory_handle_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_handle.h
diff --git a/base/memory/shared_memory_handle.h b/base/memory/shared_memory_handle.h
index 43950a253ad8a9b521fd256a812dd6f1f11d46d0..b3dfc8fa380e220a62e8384dfb09000e975a1386 100644
--- a/base/memory/shared_memory_handle.h
+++ b/base/memory/shared_memory_handle.h
@@ -156,6 +156,9 @@ class BASE_EXPORT SharedMemoryHandle {
// Closes the underlying OS primitive.
void Close() const;
+ void SetOwnershipPassesToIPC(bool ownership_passes);
+ bool OwnershipPassesToIPC() const;
+
private:
// Shared code between copy constructor and operator=.
void CopyRelevantData(const SharedMemoryHandle& handle);
@@ -177,6 +180,12 @@ class BASE_EXPORT SharedMemoryHandle {
// The pid of the process in which |memory_object_| is usable. Only
// relevant if |memory_object_| is not |MACH_PORT_NULL|.
base::ProcessId pid_;
+
+ // Whether passing this object as a parameter to an IPC message passes
+ // ownership of |memory_object_| to the IPC stack. This is meant to mimic
+ // the behavior of the |auto_close| parameter of FileDescriptor.
+ // Defaults to |false|.
+ bool ownership_passes_to_ipc_;
};
};
};
« no previous file with comments | « no previous file | base/memory/shared_memory_handle_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698