OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_IPC_MESSAGE_ATTACHMENT_SET_H_ | 5 #ifndef IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ |
6 #define IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ | 6 #define IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 // Similar to GetNonBrokerableAttachmentAt, but there are no ordering | 80 // Similar to GetNonBrokerableAttachmentAt, but there are no ordering |
81 // requirements. | 81 // requirements. |
82 scoped_refptr<MessageAttachment> GetBrokerableAttachmentAt(unsigned index); | 82 scoped_refptr<MessageAttachment> GetBrokerableAttachmentAt(unsigned index); |
83 | 83 |
84 // This must be called after transmitting the descriptors returned by | 84 // This must be called after transmitting the descriptors returned by |
85 // PeekDescriptors. It marks all the non-brokerable descriptors as consumed | 85 // PeekDescriptors. It marks all the non-brokerable descriptors as consumed |
86 // and closes those which are auto-close. | 86 // and closes those which are auto-close. |
87 void CommitAllDescriptors(); | 87 void CommitAllDescriptors(); |
88 | 88 |
89 // Returns a vector of all brokerable attachments. | 89 // Returns a vector of all brokerable attachments. |
90 std::vector<BrokerableAttachment*> GetBrokerableAttachments() const; | 90 std::vector<scoped_refptr<IPC::BrokerableAttachment>> |
91 GetBrokerableAttachments() const; | |
91 | 92 |
92 // Replaces a placeholder brokerable attachment with |attachment|, matching | 93 // Replaces a placeholder brokerable attachment with |attachment|, matching |
93 // them by their id. | 94 // them by their id. |
94 void ReplacePlaceholderWithAttachment( | 95 void ReplacePlaceholderWithAttachment( |
95 const scoped_refptr<BrokerableAttachment>& attachment); | 96 scoped_refptr<BrokerableAttachment> attachment); |
Tom Sepez
2015/10/29 19:12:51
and here.
| |
96 | 97 |
97 #if defined(OS_POSIX) | 98 #if defined(OS_POSIX) |
98 // This is the maximum number of descriptors per message. We need to know this | 99 // This is the maximum number of descriptors per message. We need to know this |
99 // because the control message kernel interface has to be given a buffer which | 100 // because the control message kernel interface has to be given a buffer which |
100 // is large enough to store all the descriptor numbers. Otherwise the kernel | 101 // is large enough to store all the descriptor numbers. Otherwise the kernel |
101 // tells us that it truncated the control data and the extra descriptors are | 102 // tells us that it truncated the control data and the extra descriptors are |
102 // lost. | 103 // lost. |
103 // | 104 // |
104 // In debugging mode, it's a fatal error to try and add more than this number | 105 // In debugging mode, it's a fatal error to try and add more than this number |
105 // of descriptors to a MessageAttachmentSet. | 106 // of descriptors to a MessageAttachmentSet. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 // all the descriptors have been read (with GetNthDescriptor). Secondly, we | 151 // all the descriptors have been read (with GetNthDescriptor). Secondly, we |
151 // can check that they are read in order. | 152 // can check that they are read in order. |
152 mutable unsigned consumed_descriptor_highwater_; | 153 mutable unsigned consumed_descriptor_highwater_; |
153 | 154 |
154 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); | 155 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); |
155 }; | 156 }; |
156 | 157 |
157 } // namespace IPC | 158 } // namespace IPC |
158 | 159 |
159 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ | 160 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ |
OLD | NEW |