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

Side by Side Diff: ipc/handle_attachment_win.cc

Issue 2473993003: Delete IPC::ChannelPosix, IPC::ChannelWin and IPC::AttachmentBroker. (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 unified diff | Download patch
« no previous file with comments | « ipc/handle_attachment_win.h ('k') | ipc/ipc_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/handle_attachment_win.h" 5 #include "ipc/handle_attachment_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 namespace IPC { 9 namespace IPC {
10 namespace internal { 10 namespace internal {
(...skipping 11 matching lines...) Expand all
22 handle_ = duplicated_handle; 22 handle_ = duplicated_handle;
23 permissions_ = permissions; 23 permissions_ = permissions;
24 } 24 }
25 } 25 }
26 26
27 HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle, 27 HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle,
28 FromWire from_wire) 28 FromWire from_wire)
29 : handle_(handle), permissions_(HandleWin::INVALID), owns_handle_(true) {} 29 : handle_(handle), permissions_(HandleWin::INVALID), owns_handle_(true) {}
30 30
31 HandleAttachmentWin::HandleAttachmentWin(const WireFormat& wire_format) 31 HandleAttachmentWin::HandleAttachmentWin(const WireFormat& wire_format)
32 : BrokerableAttachment(wire_format.attachment_id), 32 : handle_(LongToHandle(wire_format.handle)),
33 handle_(LongToHandle(wire_format.handle)),
34 permissions_(wire_format.permissions), 33 permissions_(wire_format.permissions),
35 owns_handle_(true) {} 34 owns_handle_(true) {}
36 35
37 HandleAttachmentWin::~HandleAttachmentWin() { 36 HandleAttachmentWin::~HandleAttachmentWin() {
38 if (handle_ != INVALID_HANDLE_VALUE && owns_handle_) 37 if (handle_ != INVALID_HANDLE_VALUE && owns_handle_)
39 ::CloseHandle(handle_); 38 ::CloseHandle(handle_);
40 } 39 }
41 40
42 HandleAttachmentWin::BrokerableType HandleAttachmentWin::GetBrokerableType() 41 HandleAttachmentWin::BrokerableType HandleAttachmentWin::GetBrokerableType()
43 const { 42 const {
44 return WIN_HANDLE; 43 return WIN_HANDLE;
45 } 44 }
46 45
47 HandleAttachmentWin::WireFormat HandleAttachmentWin::GetWireFormat( 46 HandleAttachmentWin::WireFormat HandleAttachmentWin::GetWireFormat(
48 const base::ProcessId& destination) const { 47 const base::ProcessId& destination) const {
49 return WireFormat(HandleToLong(handle_), destination, permissions_, 48 return WireFormat(HandleToLong(handle_), destination, permissions_);
50 GetIdentifier());
51 } 49 }
52 50
53 } // namespace internal 51 } // namespace internal
54 } // namespace IPC 52 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/handle_attachment_win.h ('k') | ipc/ipc_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698