Chromium Code Reviews| Index: ipc/attachment_broker_win.cc |
| diff --git a/ipc/attachment_broker_win.cc b/ipc/attachment_broker_win.cc |
| index caf80b8f488d03981bc86593542c3d74d6159fca..489fcdd4c52776abce96ecba32ac2471675cdb6f 100644 |
| --- a/ipc/attachment_broker_win.cc |
| +++ b/ipc/attachment_broker_win.cc |
| @@ -4,6 +4,11 @@ |
| #include "ipc/attachment_broker_win.h" |
| +#include "ipc/attachment_broker_messages.h" |
| +#include "ipc/brokerable_attachment.h" |
| +#include "ipc/handle_attachment_win.h" |
| +#include "ipc/ipc_sender.h" |
| + |
| namespace IPC { |
| AttachmentBrokerWin::AttachmentBrokerWin() { |
| @@ -18,10 +23,19 @@ void AttachmentBrokerWin::OnReceiveDuplicatedHandle( |
| // TODO(erikchen): Implement me. http://crbug.com/493414 |
| } |
| -void AttachmentBrokerWin::SendAttachmentToProcess( |
| +bool AttachmentBrokerWin::SendAttachmentToProcess( |
| BrokerableAttachment* attachment, |
| base::ProcessId destination_process) { |
| - // TODO(erikchen): Implement me. http://crbug.com/493414 |
| + switch (attachment->GetBrokerableType()) { |
| + case BrokerableAttachment::WIN_HANDLE: |
| + internal::HandleAttachmentWin* handle_attachment = |
| + static_cast<internal::HandleAttachmentWin*>(attachment); |
| + internal::HandleAttachmentWin::WireFormat format = |
| + handle_attachment->GetWireFormat(destination_process); |
| + Message* m = new AttachmentBrokerMsg_RequestBrokerageOfWinHandle(format); |
|
Tom Sepez
2015/06/19 18:04:10
nit: no need for |m|, the pattern is usually just
erikchen
2015/06/23 22:36:59
Done.
|
| + return sender_->Send(m); |
| + } |
| + return false; |
| } |
| bool AttachmentBrokerWin::GetAttachmentWithId( |
| @@ -31,4 +45,8 @@ bool AttachmentBrokerWin::GetAttachmentWithId( |
| return false; |
| } |
| +void AttachmentBrokerWin::SetSender(IPC::Sender* sender) { |
|
Tom Sepez
2015/06/19 18:04:10
nit: move trivial setter to header.
erikchen
2015/06/23 22:36:59
Done.
|
| + sender_ = sender; |
| +} |
| + |
| } // namespace IPC |