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_H_ | 5 #ifndef IPC_ATTACHMENT_BROKER_H_ |
6 #define IPC_ATTACHMENT_BROKER_H_ | 6 #define IPC_ATTACHMENT_BROKER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "ipc/brokerable_attachment.h" | 10 #include "ipc/brokerable_attachment.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // that support attachment brokering, every IPC channel should have a reference | 27 // that support attachment brokering, every IPC channel should have a reference |
28 // to a AttachmentBroker. | 28 // to a AttachmentBroker. |
29 class IPC_EXPORT AttachmentBroker { | 29 class IPC_EXPORT AttachmentBroker { |
30 public: | 30 public: |
31 AttachmentBroker() {} | 31 AttachmentBroker() {} |
32 virtual ~AttachmentBroker() {} | 32 virtual ~AttachmentBroker() {} |
33 | 33 |
34 // Sends |attachment| to |destination_process|. The implementation uses an | 34 // Sends |attachment| to |destination_process|. The implementation uses an |
35 // IPC::Channel to communicate with the broker process. This may be the same | 35 // IPC::Channel to communicate with the broker process. This may be the same |
36 // IPC::Channel that is requesting the brokering of an attachment. | 36 // IPC::Channel that is requesting the brokering of an attachment. |
37 virtual void SendAttachmentToProcess(BrokerableAttachment* attachment, | 37 // Returns true on success and false otherwise. |
| 38 virtual bool SendAttachmentToProcess(BrokerableAttachment* attachment, |
38 base::ProcessId destination_process) = 0; | 39 base::ProcessId destination_process) = 0; |
39 | 40 |
40 // Returns whether the attachment was available. If the attachment was | 41 // Returns whether the attachment was available. If the attachment was |
41 // available, populates the output parameter |attachment|. The caller then | 42 // available, populates the output parameter |attachment|. The caller then |
42 // becomes the owner of |attachment|. | 43 // becomes the owner of |attachment|. |
43 virtual bool GetAttachmentWithId(BrokerableAttachment::AttachmentId id, | 44 virtual bool GetAttachmentWithId(BrokerableAttachment::AttachmentId id, |
44 BrokerableAttachment* attachment) = 0; | 45 BrokerableAttachment* attachment) = 0; |
45 | 46 |
46 private: | 47 private: |
47 DISALLOW_COPY_AND_ASSIGN(AttachmentBroker); | 48 DISALLOW_COPY_AND_ASSIGN(AttachmentBroker); |
48 }; | 49 }; |
49 | 50 |
50 } // namespace IPC | 51 } // namespace IPC |
51 | 52 |
52 #endif // IPC_ATTACHMENT_BROKER_H_ | 53 #endif // IPC_ATTACHMENT_BROKER_H_ |
OLD | NEW |