diff options
author | erikchen <erikchen@chromium.org> | 2015-08-11 14:17:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-11 21:18:44 +0000 |
commit | 959039d06c1677f2d90fc7d84cb9ad9d310842bd (patch) | |
tree | bf326c766e7d0b040bcbcf0110f73d3b7d0ddd5a /ipc/handle_attachment_win.cc | |
parent | 1d30631db4ff58e63c4ae4b7132cb136fb0c37b3 (diff) | |
download | chromium_src-959039d06c1677f2d90fc7d84cb9ad9d310842bd.zip chromium_src-959039d06c1677f2d90fc7d84cb9ad9d310842bd.tar.gz chromium_src-959039d06c1677f2d90fc7d84cb9ad9d310842bd.tar.bz2 |
ipc: Add the class HandleWin.
HandleWin is a wrapper around a Windows HANDLE that can be transported across
IPC channels that support attachment brokering. The attachment broker is
responsible for duplicating the HANDLE into the destination process.
BUG=493414
Review URL: https://codereview.chromium.org/1281083004
Cr-Commit-Position: refs/heads/master@{#342897}
Diffstat (limited to 'ipc/handle_attachment_win.cc')
-rw-r--r-- | ipc/handle_attachment_win.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ipc/handle_attachment_win.cc b/ipc/handle_attachment_win.cc index 994b22d..50e3e6d 100644 --- a/ipc/handle_attachment_win.cc +++ b/ipc/handle_attachment_win.cc @@ -9,17 +9,20 @@ namespace IPC { namespace internal { -HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle) - : handle_(handle) { -} +HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle, + HandleWin::Permissions permissions) + : handle_(handle), permissions_(permissions) {} HandleAttachmentWin::HandleAttachmentWin(const WireFormat& wire_format) : BrokerableAttachment(wire_format.attachment_id, false), - handle_(LongToHandle(wire_format.handle)) {} + handle_(LongToHandle(wire_format.handle)), + permissions_(wire_format.permissions) {} HandleAttachmentWin::HandleAttachmentWin( const BrokerableAttachment::AttachmentId& id) - : BrokerableAttachment(id, true), handle_(INVALID_HANDLE_VALUE) {} + : BrokerableAttachment(id, true), + handle_(INVALID_HANDLE_VALUE), + permissions_(HandleWin::INVALID) {} HandleAttachmentWin::~HandleAttachmentWin() { } @@ -48,6 +51,7 @@ HandleAttachmentWin::WireFormat HandleAttachmentWin::GetWireFormat( format.handle = HandleToLong(handle_); format.attachment_id = GetIdentifier(); format.destination_process = destination; + format.permissions = permissions_; return format; } |