Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: ipc/ipc_message_attachment_set.h

Issue 1317093007: ipc: Make a new class PlaceholderBrokerableAttachment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebase errors. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_message.cc ('k') | ipc/ipc_message_attachment_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // returns: an attachment, or nullptr on error 53 // returns: an attachment, or nullptr on error
54 scoped_refptr<MessageAttachment> GetAttachmentAt(unsigned index); 54 scoped_refptr<MessageAttachment> GetAttachmentAt(unsigned index);
55 55
56 // This must be called after transmitting the descriptors returned by 56 // This must be called after transmitting the descriptors returned by
57 // PeekDescriptors. It marks all the descriptors as consumed and closes those 57 // PeekDescriptors. It marks all the descriptors as consumed and closes those
58 // which are auto-close. 58 // which are auto-close.
59 void CommitAll(); 59 void CommitAll();
60 60
61 // Returns a vector of all brokerable attachments. 61 // Returns a vector of all brokerable attachments.
62 std::vector<const BrokerableAttachment*> PeekBrokerableAttachments() const; 62 std::vector<const BrokerableAttachment*> PeekBrokerableAttachments() const;
63 std::vector<scoped_refptr<BrokerableAttachment>> 63
64 GetBrokerableAttachmentsForUpdating(); 64 // Replaces a placeholder brokerable attachment with |attachment|, matching
65 // them by their id.
66 void ReplacePlaceholderWithAttachment(
67 const scoped_refptr<BrokerableAttachment>& attachment);
65 68
66 #if defined(OS_POSIX) 69 #if defined(OS_POSIX)
67 // This is the maximum number of descriptors per message. We need to know this 70 // This is the maximum number of descriptors per message. We need to know this
68 // because the control message kernel interface has to be given a buffer which 71 // because the control message kernel interface has to be given a buffer which
69 // is large enough to store all the descriptor numbers. Otherwise the kernel 72 // is large enough to store all the descriptor numbers. Otherwise the kernel
70 // tells us that it truncated the control data and the extra descriptors are 73 // tells us that it truncated the control data and the extra descriptors are
71 // lost. 74 // lost.
72 // 75 //
73 // In debugging mode, it's a fatal error to try and add more than this number 76 // In debugging mode, it's a fatal error to try and add more than this number
74 // of descriptors to a MessageAttachmentSet. 77 // of descriptors to a MessageAttachmentSet.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // all the descriptors have been read (with GetNthDescriptor). Secondly, we 119 // all the descriptors have been read (with GetNthDescriptor). Secondly, we
117 // can check that they are read in order. 120 // can check that they are read in order.
118 mutable unsigned consumed_descriptor_highwater_; 121 mutable unsigned consumed_descriptor_highwater_;
119 122
120 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet); 123 DISALLOW_COPY_AND_ASSIGN(MessageAttachmentSet);
121 }; 124 };
122 125
123 } // namespace IPC 126 } // namespace IPC
124 127
125 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_ 128 #endif // IPC_IPC_MESSAGE_ATTACHMENT_SET_H_
OLDNEW
« no previous file with comments | « ipc/ipc_message.cc ('k') | ipc/ipc_message_attachment_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698