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

Side by Side Diff: ipc/ipc_message_attachment_set.cc

Issue 1385143002: ipc: Update MachPortMac ownership semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase errors. Created 5 years, 2 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_attachment_set.h ('k') | ipc/mach_port_attachment_mac.h » ('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 #include "ipc/ipc_message_attachment_set.h" 5 #include "ipc/ipc_message_attachment_set.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/posix/eintr_wrapper.h" 9 #include "base/posix/eintr_wrapper.h"
10 #include "ipc/brokerable_attachment.h" 10 #include "ipc/brokerable_attachment.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 consumed_descriptor_highwater_ = index + 1; 124 consumed_descriptor_highwater_ = index + 1;
125 125
126 return attachments_[index]; 126 return attachments_[index];
127 } 127 }
128 128
129 void MessageAttachmentSet::CommitAll() { 129 void MessageAttachmentSet::CommitAll() {
130 attachments_.clear(); 130 attachments_.clear();
131 consumed_descriptor_highwater_ = 0; 131 consumed_descriptor_highwater_ = 0;
132 } 132 }
133 133
134 std::vector<const BrokerableAttachment*> 134 std::vector<BrokerableAttachment*>
135 MessageAttachmentSet::PeekBrokerableAttachments() const { 135 MessageAttachmentSet::GetBrokerableAttachments() const {
136 std::vector<const BrokerableAttachment*> output; 136 std::vector<BrokerableAttachment*> output;
137 for (const scoped_refptr<MessageAttachment>& attachment : attachments_) { 137 for (const scoped_refptr<MessageAttachment>& attachment : attachments_) {
138 if (attachment->GetType() == 138 if (attachment->GetType() ==
139 MessageAttachment::TYPE_BROKERABLE_ATTACHMENT) { 139 MessageAttachment::TYPE_BROKERABLE_ATTACHMENT) {
140 output.push_back(static_cast<BrokerableAttachment*>(attachment.get())); 140 output.push_back(static_cast<BrokerableAttachment*>(attachment.get()));
141 } 141 }
142 } 142 }
143 return output; 143 return output;
144 } 144 }
145 145
146 void MessageAttachmentSet::ReplacePlaceholderWithAttachment( 146 void MessageAttachmentSet::ReplacePlaceholderWithAttachment(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 for (unsigned i = 0; i < count; ++i) 204 for (unsigned i = 0; i < count; ++i)
205 AddAttachment( 205 AddAttachment(
206 new internal::PlatformFileAttachment(base::ScopedFD(buffer[i]))); 206 new internal::PlatformFileAttachment(base::ScopedFD(buffer[i])));
207 } 207 }
208 208
209 #endif // OS_POSIX 209 #endif // OS_POSIX
210 210
211 } // namespace IPC 211 } // namespace IPC
212 212
213 213
OLDNEW
« no previous file with comments | « ipc/ipc_message_attachment_set.h ('k') | ipc/mach_port_attachment_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698