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_UNPRIVILEGED_H_ | 5 #ifndef IPC_ATTACHMENT_BROKER_UNPRIVILEGED_H_ |
6 #define IPC_ATTACHMENT_BROKER_UNPRIVILEGED_H_ | 6 #define IPC_ATTACHMENT_BROKER_UNPRIVILEGED_H_ |
7 | 7 |
8 #include "ipc/attachment_broker.h" | 8 #include "ipc/attachment_broker.h" |
9 #include "ipc/ipc_export.h" | 9 #include "ipc/ipc_export.h" |
10 | 10 |
11 namespace IPC { | 11 namespace IPC { |
12 | 12 |
13 class Channel; | 13 class Endpoint; |
14 class ChannelProxy; | |
15 class Sender; | 14 class Sender; |
16 | 15 |
17 // This abstract subclass of AttachmentBroker is intended for use in | 16 // This abstract subclass of AttachmentBroker is intended for use in |
18 // non-privileged processes. | 17 // non-privileged processes. |
19 class IPC_EXPORT AttachmentBrokerUnprivileged : public IPC::AttachmentBroker { | 18 class IPC_EXPORT AttachmentBrokerUnprivileged : public IPC::AttachmentBroker { |
20 public: | 19 public: |
21 AttachmentBrokerUnprivileged(); | 20 AttachmentBrokerUnprivileged(); |
22 ~AttachmentBrokerUnprivileged() override; | 21 ~AttachmentBrokerUnprivileged() override; |
23 | 22 |
24 // In each unprivileged process, exactly one channel should be used to | 23 // In each unprivileged process, exactly one channel should be used to |
25 // communicate brokerable attachments with the broker process. | 24 // communicate brokerable attachments with the broker process. |
26 void DesignateBrokerCommunicationChannel(IPC::Channel* channel); | 25 void DesignateBrokerCommunicationChannel(Endpoint* endpoint); |
27 void DesignateBrokerCommunicationChannel(IPC::ChannelProxy* proxy); | |
28 | 26 |
29 protected: | 27 protected: |
30 IPC::Sender* get_sender() { return sender_; } | 28 IPC::Sender* get_sender() { return sender_; } |
31 | 29 |
32 private: | 30 private: |
33 // |sender_| is used to send Messages to the privileged broker process. | 31 // |sender_| is used to send Messages to the privileged broker process. |
34 // |sender_| must live at least as long as this instance. | 32 // |sender_| must live at least as long as this instance. |
35 IPC::Sender* sender_; | 33 IPC::Sender* sender_; |
36 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerUnprivileged); | 34 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerUnprivileged); |
37 }; | 35 }; |
38 | 36 |
39 } // namespace IPC | 37 } // namespace IPC |
40 | 38 |
41 #endif // IPC_ATTACHMENT_BROKER_UNPRIVILEGED_H_ | 39 #endif // IPC_ATTACHMENT_BROKER_UNPRIVILEGED_H_ |
OLD | NEW |