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
3 // found in the LICENSE file.
5 #include "ipc/attachment_broker_win.h"
7 #include "ipc/attachment_broker_messages.h"
8 #include "ipc/brokerable_attachment.h"
9 #include "ipc/handle_attachment_win.h"
10 #include "ipc/ipc_sender.h"
14 AttachmentBrokerWin::AttachmentBrokerWin() {
17 AttachmentBrokerWin::~AttachmentBrokerWin() {
20 void AttachmentBrokerWin::OnReceiveDuplicatedHandle(
22 BrokerableAttachment::AttachmentId id
) {
23 // TODO(erikchen): Implement me. http://crbug.com/493414
26 bool AttachmentBrokerWin::SendAttachmentToProcess(
27 const BrokerableAttachment
* attachment
,
28 base::ProcessId destination_process
) {
29 switch (attachment
->GetBrokerableType()) {
30 case BrokerableAttachment::WIN_HANDLE
:
31 const internal::HandleAttachmentWin
* handle_attachment
=
32 static_cast<const internal::HandleAttachmentWin
*>(attachment
);
33 internal::HandleAttachmentWin::WireFormat format
=
34 handle_attachment
->GetWireFormat(destination_process
);
36 new AttachmentBrokerMsg_DuplicateWinHandle(format
));
41 bool AttachmentBrokerWin::GetAttachmentWithId(
42 BrokerableAttachment::AttachmentId id
,
43 BrokerableAttachment
* attachment
) {
44 // TODO(erikchen): Implement me. http://crbug.com/493414