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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // returns: an attachment, or nullptr on error | 54 // returns: an attachment, or nullptr on error |
55 scoped_refptr<MessageAttachment> GetAttachmentAt(unsigned index); | 55 scoped_refptr<MessageAttachment> GetAttachmentAt(unsigned index); |
56 | 56 |
57 // This must be called after transmitting the descriptors returned by | 57 // This must be called after transmitting the descriptors returned by |
58 // PeekDescriptors. It marks all the descriptors as consumed and closes those | 58 // PeekDescriptors. It marks all the descriptors as consumed and closes those |
59 // which are auto-close. | 59 // which are auto-close. |
60 void CommitAll(); | 60 void CommitAll(); |
61 | 61 |
62 // Returns a vector of all brokerable attachments. | 62 // Returns a vector of all brokerable attachments. |
63 std::vector<const BrokerableAttachment*> PeekBrokerableAttachments() const; | 63 std::vector<const BrokerableAttachment*> PeekBrokerableAttachments() const; |
64 | 64 std::vector<scoped_refptr<BrokerableAttachment>> |
65 // Replaces a placeholder brokerable attachment with |attachment|, matching | 65 GetBrokerableAttachmentsForUpdating(); |
66 // them by their id. | |
67 void ReplacePlaceholderWithAttachment( | |
68 const scoped_refptr<BrokerableAttachment>& attachment); | |
69 | 66 |
70 #if defined(OS_POSIX) | 67 #if defined(OS_POSIX) |
71 // This is the maximum number of descriptors per message. We need to know this | 68 // This is the maximum number of descriptors per message. We need to know this |
72 // because the control message kernel interface has to be given a buffer which | 69 // because the control message kernel interface has to be given a buffer which |
73 // is large enough to store all the descriptor numbers. Otherwise the kernel | 70 // is large enough to store all the descriptor numbers. Otherwise the kernel |
74 // tells us that it truncated the control data and the extra descriptors are | 71 // tells us that it truncated the control data and the extra descriptors are |
75 // lost. | 72 // lost. |
76 // | 73 // |
77 // In debugging mode, it's a fatal error to try and add more than this number | 74 // In debugging mode, it's a fatal error to try and add more than this number |
78 // of descriptors to a MessageAttachmentSet. | 75 // of descriptors to a MessageAttachmentSet. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // all the descriptors have been read (with GetNthDescriptor). Secondly, we | 117 // all the descriptors have been read (with GetNthDescriptor). Secondly, we |
121 // can check that they are read in order. | 118 // can check that they are read in order. |
122 mutable unsigned consumed_descriptor_highwater_; | 119 mutable unsigned consumed_descriptor_highwater_; |
123 | 120 |
124 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); | 121 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); |
125 }; | 122 }; |
126 | 123 |
127 } // namespace IPC | 124 } // namespace IPC |
128 | 125 |
129 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ | 126 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ |
OLD | NEW |