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

Unified Diff: base/memory/shared_memory_handle.h

Issue 1643253003: Add member ownership_passes_to_ipc_ to SharedMemoryHandle on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minimal test. Created 4 years, 11 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_win.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 f90553e2fe733ddc9a5b9a4c483a3b3af4fc1b20..5befcdd6b59f42c50a4ca905c0da28291706b4ca 100644
--- a/base/memory/shared_memory_handle.h
+++ b/base/memory/shared_memory_handle.h
@@ -64,6 +64,9 @@ class BASE_EXPORT SharedMemoryHandle {
// an instance of this class is passed over a Chrome IPC channel.
bool NeedsBrokering() const;
+ void SetOwnershipPassesToIPC(bool ownership_passes);
+ bool OwnershipPassesToIPC() const;
+
HANDLE GetHandle() const;
base::ProcessId GetPID() const;
@@ -73,6 +76,13 @@ class BASE_EXPORT SharedMemoryHandle {
// The process in which |handle_| is valid and can be used. If |handle_| is
// invalid, this will be kNullProcessId.
base::ProcessId pid_;
+
+ // Whether passing this object as a parameter to an IPC message passes
+ // ownership of |handle_| to the IPC stack. This is meant to mimic the
+ // behavior of the |auto_close| parameter of FileDescriptor. This member only
+ // affects attachment-brokered SharedMemoryHandles.
+ // Defaults to |false|.
+ bool ownership_passes_to_ipc_;
};
#else
class BASE_EXPORT SharedMemoryHandle {
« no previous file with comments | « no previous file | base/memory/shared_memory_handle_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698