| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |