| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // This must be called after transmitting the descriptors returned by | 87 // This must be called after transmitting the descriptors returned by |
| 88 // PeekDescriptors. It marks all the non-brokerable descriptors as consumed | 88 // PeekDescriptors. It marks all the non-brokerable descriptors as consumed |
| 89 // and closes those which are auto-close. | 89 // and closes those which are auto-close. |
| 90 void CommitAllDescriptors(); | 90 void CommitAllDescriptors(); |
| 91 | 91 |
| 92 // Returns a vector of all brokerable attachments. | 92 // Returns a vector of all brokerable attachments. |
| 93 std::vector<scoped_refptr<IPC::BrokerableAttachment>> | 93 std::vector<scoped_refptr<IPC::BrokerableAttachment>> |
| 94 GetBrokerableAttachments() const; | 94 GetBrokerableAttachments() const; |
| 95 | 95 |
| 96 // Replaces a placeholder brokerable attachment with |attachment|, matching | |
| 97 // them by their id. | |
| 98 void ReplacePlaceholderWithAttachment( | |
| 99 const scoped_refptr<BrokerableAttachment>& attachment); | |
| 100 | |
| 101 #if defined(OS_POSIX) | 96 #if defined(OS_POSIX) |
| 102 // This is the maximum number of descriptors per message. We need to know this | 97 // This is the maximum number of descriptors per message. We need to know this |
| 103 // because the control message kernel interface has to be given a buffer which | 98 // because the control message kernel interface has to be given a buffer which |
| 104 // is large enough to store all the descriptor numbers. Otherwise the kernel | 99 // is large enough to store all the descriptor numbers. Otherwise the kernel |
| 105 // tells us that it truncated the control data and the extra descriptors are | 100 // tells us that it truncated the control data and the extra descriptors are |
| 106 // lost. | 101 // lost. |
| 107 // | 102 // |
| 108 // In debugging mode, it's a fatal error to try and add more than this number | 103 // In debugging mode, it's a fatal error to try and add more than this number |
| 109 // of descriptors to a MessageAttachmentSet. | 104 // of descriptors to a MessageAttachmentSet. |
| 110 static const size_t kMaxDescriptorsPerMessage = 7; | 105 static const size_t kMaxDescriptorsPerMessage = 7; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // all the descriptors have been read (with GetNthDescriptor). Secondly, we | 149 // all the descriptors have been read (with GetNthDescriptor). Secondly, we |
| 155 // can check that they are read in order. | 150 // can check that they are read in order. |
| 156 mutable unsigned consumed_descriptor_highwater_; | 151 mutable unsigned consumed_descriptor_highwater_; |
| 157 | 152 |
| 158 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); | 153 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); |
| 159 }; | 154 }; |
| 160 | 155 |
| 161 } // namespace IPC | 156 } // namespace IPC |
| 162 | 157 |
| 163 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ | 158 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ |
| OLD | NEW |