OLD | NEW |
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 #ifndef IPC_ATTACHMENT_BROKER_WIN_H_ | 5 #ifndef IPC_ATTACHMENT_BROKER_UNPRIVILEGED_WIN_H_ |
6 #define IPC_ATTACHMENT_BROKER_WIN_H_ | 6 #define IPC_ATTACHMENT_BROKER_UNPRIVILEGED_WIN_H_ |
7 | 7 |
8 #include <vector> | 8 #include "ipc/attachment_broker_unprivileged.h" |
9 | |
10 #include "base/memory/ref_counted.h" | |
11 #include "ipc/attachment_broker.h" | |
12 #include "ipc/brokerable_attachment.h" | |
13 #include "ipc/handle_attachment_win.h" | 9 #include "ipc/handle_attachment_win.h" |
14 #include "ipc/ipc_export.h" | 10 #include "ipc/ipc_export.h" |
15 | 11 |
16 namespace IPC { | 12 namespace IPC { |
17 | 13 |
18 class Sender; | 14 class BrokerableAttachment; |
19 | 15 |
20 // This class is an implementation of AttachmentBroker for the Windows platform | 16 // This class is an implementation of AttachmentBroker for the Windows platform |
21 // for non-privileged processes. | 17 // for non-privileged processes. |
22 class IPC_EXPORT AttachmentBrokerWin : public IPC::AttachmentBroker { | 18 class IPC_EXPORT AttachmentBrokerUnprivilegedWin |
| 19 : public IPC::AttachmentBrokerUnprivileged { |
23 public: | 20 public: |
24 AttachmentBrokerWin(); | 21 AttachmentBrokerUnprivilegedWin(); |
25 ~AttachmentBrokerWin() override; | 22 ~AttachmentBrokerUnprivilegedWin() override; |
26 | 23 |
27 // IPC::AttachmentBroker overrides. | 24 // IPC::AttachmentBroker overrides. |
28 bool SendAttachmentToProcess(const BrokerableAttachment* attachment, | 25 bool SendAttachmentToProcess(const BrokerableAttachment* attachment, |
29 base::ProcessId destination_process) override; | 26 base::ProcessId destination_process) override; |
30 | 27 |
31 // IPC::Listener overrides. | 28 // IPC::Listener overrides. |
32 bool OnMessageReceived(const Message& message) override; | 29 bool OnMessageReceived(const Message& message) override; |
33 | 30 |
34 // |sender_| is used to send Messages to the broker. |sender_| must live at | |
35 // least as long as this instance. | |
36 void set_sender(IPC::Sender* sender) { sender_ = sender; } | |
37 | |
38 private: | 31 private: |
39 // IPC message handlers. | 32 // IPC message handlers. |
40 void OnWinHandleHasBeenDuplicated( | 33 void OnWinHandleHasBeenDuplicated( |
41 const IPC::internal::HandleAttachmentWin::WireFormat& wire_format); | 34 const IPC::internal::HandleAttachmentWin::WireFormat& wire_format); |
42 | 35 |
43 // |sender_| is used to send Messages to the broker. |sender_| must live at | 36 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerUnprivilegedWin); |
44 // least as long as this instance. | |
45 IPC::Sender* sender_; | |
46 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerWin); | |
47 }; | 37 }; |
48 | 38 |
49 } // namespace IPC | 39 } // namespace IPC |
50 | 40 |
51 #endif // IPC_ATTACHMENT_BROKER_WIN_H_ | 41 #endif // IPC_ATTACHMENT_BROKER_UNPRIVILEGED_WIN_H_ |
OLD | NEW |