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

Side by Side Diff: ipc/ipc_channel_reader.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_channel_posix.cc ('k') | ipc/ipc_channel_reader_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_channel_reader.h" 5 #include "ipc/ipc_channel_reader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ipc/ipc_listener.h" 9 #include "ipc/ipc_listener.h"
10 #include "ipc/ipc_logging.h" 10 #include "ipc/ipc_logging.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (m->dispatch_error()) 206 if (m->dispatch_error())
207 listener_->OnBadMessageReceived(*m); 207 listener_->OnBadMessageReceived(*m);
208 } 208 }
209 209
210 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( 210 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments(
211 Message* msg) { 211 Message* msg) {
212 std::set<BrokerableAttachment::AttachmentId> blocked_ids; 212 std::set<BrokerableAttachment::AttachmentId> blocked_ids;
213 213
214 #if USE_ATTACHMENT_BROKER 214 #if USE_ATTACHMENT_BROKER
215 MessageAttachmentSet* set = msg->attachment_set(); 215 MessageAttachmentSet* set = msg->attachment_set();
216 std::vector<const BrokerableAttachment*> brokerable_attachments_copy = 216 std::vector<BrokerableAttachment*> brokerable_attachments_copy =
217 set->PeekBrokerableAttachments(); 217 set->GetBrokerableAttachments();
218 for (const BrokerableAttachment* attachment : brokerable_attachments_copy) { 218 for (const BrokerableAttachment* attachment : brokerable_attachments_copy) {
219 if (attachment->NeedsBrokering()) { 219 if (attachment->NeedsBrokering()) {
220 AttachmentBroker* broker = GetAttachmentBroker(); 220 AttachmentBroker* broker = GetAttachmentBroker();
221 scoped_refptr<BrokerableAttachment> brokered_attachment; 221 scoped_refptr<BrokerableAttachment> brokered_attachment;
222 bool result = broker->GetAttachmentWithId(attachment->GetIdentifier(), 222 bool result = broker->GetAttachmentWithId(attachment->GetIdentifier(),
223 &brokered_attachment); 223 &brokered_attachment);
224 if (!result) { 224 if (!result) {
225 blocked_ids.insert(attachment->GetIdentifier()); 225 blocked_ids.insert(attachment->GetIdentifier());
226 continue; 226 continue;
227 } 227 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (size <= Channel::kMaximumMessageSize) { 265 if (size <= Channel::kMaximumMessageSize) {
266 return true; 266 return true;
267 } 267 }
268 input_overflow_buf_.clear(); 268 input_overflow_buf_.clear();
269 LOG(ERROR) << "IPC message is too big: " << size; 269 LOG(ERROR) << "IPC message is too big: " << size;
270 return false; 270 return false;
271 } 271 }
272 272
273 } // namespace internal 273 } // namespace internal
274 } // namespace IPC 274 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_channel_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698