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

Side by Side Diff: ipc/attachment_broker_unprivileged_win.cc

Issue 1385143002: ipc: Update MachPortMac ownership semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase errors. 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 unified diff | Download patch
« no previous file with comments | « ipc/attachment_broker_unprivileged_win.h ('k') | ipc/ipc_channel_posix.cc » ('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/attachment_broker_unprivileged_win.h" 5 #include "ipc/attachment_broker_unprivileged_win.h"
6 6
7 #include "base/process/process.h" 7 #include "base/process/process.h"
8 #include "ipc/attachment_broker_messages.h" 8 #include "ipc/attachment_broker_messages.h"
9 #include "ipc/brokerable_attachment.h" 9 #include "ipc/brokerable_attachment.h"
10 #include "ipc/handle_attachment_win.h" 10 #include "ipc/handle_attachment_win.h"
11 #include "ipc/ipc_sender.h" 11 #include "ipc/ipc_sender.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 14
15 AttachmentBrokerUnprivilegedWin::AttachmentBrokerUnprivilegedWin() {} 15 AttachmentBrokerUnprivilegedWin::AttachmentBrokerUnprivilegedWin() {}
16 16
17 AttachmentBrokerUnprivilegedWin::~AttachmentBrokerUnprivilegedWin() {} 17 AttachmentBrokerUnprivilegedWin::~AttachmentBrokerUnprivilegedWin() {}
18 18
19 bool AttachmentBrokerUnprivilegedWin::SendAttachmentToProcess( 19 bool AttachmentBrokerUnprivilegedWin::SendAttachmentToProcess(
20 const BrokerableAttachment* attachment, 20 BrokerableAttachment* attachment,
21 base::ProcessId destination_process) { 21 base::ProcessId destination_process) {
22 switch (attachment->GetBrokerableType()) { 22 switch (attachment->GetBrokerableType()) {
23 case BrokerableAttachment::WIN_HANDLE: { 23 case BrokerableAttachment::WIN_HANDLE: {
24 const internal::HandleAttachmentWin* handle_attachment = 24 const internal::HandleAttachmentWin* handle_attachment =
25 static_cast<const internal::HandleAttachmentWin*>(attachment); 25 static_cast<const internal::HandleAttachmentWin*>(attachment);
26 internal::HandleAttachmentWin::WireFormat format = 26 internal::HandleAttachmentWin::WireFormat format =
27 handle_attachment->GetWireFormat(destination_process); 27 handle_attachment->GetWireFormat(destination_process);
28 return get_sender()->Send( 28 return get_sender()->Send(
29 new AttachmentBrokerMsg_DuplicateWinHandle(format)); 29 new AttachmentBrokerMsg_DuplicateWinHandle(format));
30 } 30 }
(...skipping 23 matching lines...) Expand all
54 return; 54 return;
55 } 55 }
56 56
57 scoped_refptr<BrokerableAttachment> attachment( 57 scoped_refptr<BrokerableAttachment> attachment(
58 new IPC::internal::HandleAttachmentWin(wire_format)); 58 new IPC::internal::HandleAttachmentWin(wire_format));
59 HandleReceivedAttachment(attachment); 59 HandleReceivedAttachment(attachment);
60 LogError(SUCCESS); 60 LogError(SUCCESS);
61 } 61 }
62 62
63 } // namespace IPC 63 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/attachment_broker_unprivileged_win.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698