OLD | NEW |
---|---|
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 "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "ipc/ipc_listener.h" | 10 #include "ipc/ipc_listener.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 } | 243 } |
244 return DISPATCH_FINISHED; | 244 return DISPATCH_FINISHED; |
245 } | 245 } |
246 | 246 |
247 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( | 247 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( |
248 Message* msg) { | 248 Message* msg) { |
249 std::set<BrokerableAttachment::AttachmentId> blocked_ids; | 249 std::set<BrokerableAttachment::AttachmentId> blocked_ids; |
250 | 250 |
251 #if USE_ATTACHMENT_BROKER | 251 #if USE_ATTACHMENT_BROKER |
252 MessageAttachmentSet* set = msg->attachment_set(); | 252 MessageAttachmentSet* set = msg->attachment_set(); |
253 std::vector<BrokerableAttachment*> brokerable_attachments_copy = | 253 std::vector<scoped_refptr<IPC::BrokerableAttachment>> |
Tom Sepez
2015/10/29 19:12:51
Note: this is the first place you'll actually do a
erikchen
2015/10/29 19:53:54
Yes.
| |
254 set->GetBrokerableAttachments(); | 254 brokerable_attachments_copy(set->GetBrokerableAttachments()); |
255 for (const BrokerableAttachment* attachment : brokerable_attachments_copy) { | 255 for (const auto& attachment : brokerable_attachments_copy) { |
256 if (attachment->NeedsBrokering()) { | 256 if (attachment->NeedsBrokering()) { |
257 AttachmentBroker* broker = GetAttachmentBroker(); | 257 AttachmentBroker* broker = GetAttachmentBroker(); |
258 DCHECK(broker); | 258 DCHECK(broker); |
259 scoped_refptr<BrokerableAttachment> brokered_attachment; | 259 scoped_refptr<BrokerableAttachment> brokered_attachment; |
260 bool result = broker->GetAttachmentWithId(attachment->GetIdentifier(), | 260 bool result = broker->GetAttachmentWithId(attachment->GetIdentifier(), |
261 &brokered_attachment); | 261 &brokered_attachment); |
262 if (!result) { | 262 if (!result) { |
263 blocked_ids.insert(attachment->GetIdentifier()); | 263 blocked_ids.insert(attachment->GetIdentifier()); |
264 continue; | 264 continue; |
265 } | 265 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 if (size <= Channel::kMaximumMessageSize) { | 303 if (size <= Channel::kMaximumMessageSize) { |
304 return true; | 304 return true; |
305 } | 305 } |
306 input_overflow_buf_.clear(); | 306 input_overflow_buf_.clear(); |
307 LOG(ERROR) << "IPC message is too big: " << size; | 307 LOG(ERROR) << "IPC message is too big: " << size; |
308 return false; | 308 return false; |
309 } | 309 } |
310 | 310 |
311 } // namespace internal | 311 } // namespace internal |
312 } // namespace IPC | 312 } // namespace IPC |
OLD | NEW |