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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 std::string name; | 156 std::string name; |
157 Logging::GetInstance()->GetMessageText(m->type(), &name, m, NULL); | 157 Logging::GetInstance()->GetMessageText(m->type(), &name, m, NULL); |
158 TRACE_EVENT1("ipc,toplevel", "ChannelReader::DispatchInputData", "name", | 158 TRACE_EVENT1("ipc,toplevel", "ChannelReader::DispatchInputData", "name", |
159 name); | 159 name); |
160 #else | 160 #else |
161 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", "class", | 161 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", "class", |
162 IPC_MESSAGE_ID_CLASS(m->type()), "line", | 162 IPC_MESSAGE_ID_CLASS(m->type()), "line", |
163 IPC_MESSAGE_ID_LINE(m->type())); | 163 IPC_MESSAGE_ID_LINE(m->type())); |
164 #endif | 164 #endif |
165 m->TraceMessageEnd(); | 165 m->TraceMessageEnd(); |
166 | 166 if (IsInternalMessage(*m)) |
167 bool handled = false; | |
168 if (IsInternalMessage(*m)) { | |
169 HandleInternalMessage(*m); | 167 HandleInternalMessage(*m); |
170 handled = true; | 168 else |
171 } | |
172 #if USE_ATTACHMENT_BROKER | |
173 if (!handled && IsAttachmentBrokerEndpoint() && GetAttachmentBroker()) { | |
174 handled = GetAttachmentBroker()->OnMessageReceived(*m); | |
175 } | |
176 #endif // USE_ATTACHMENT_BROKER | |
177 if (!handled) | |
178 listener_->OnMessageReceived(*m); | 169 listener_->OnMessageReceived(*m); |
179 if (m->dispatch_error()) | 170 if (m->dispatch_error()) |
180 listener_->OnBadMessageReceived(*m); | 171 listener_->OnBadMessageReceived(*m); |
181 } | 172 } |
182 | 173 |
183 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( | 174 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( |
184 Message* msg) { | 175 Message* msg) { |
185 std::set<BrokerableAttachment::AttachmentId> blocked_ids; | 176 std::set<BrokerableAttachment::AttachmentId> blocked_ids; |
186 | 177 |
187 #if USE_ATTACHMENT_BROKER | 178 #if USE_ATTACHMENT_BROKER |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 219 } |
229 | 220 |
230 void ChannelReader::StopObservingAttachmentBroker() { | 221 void ChannelReader::StopObservingAttachmentBroker() { |
231 #if USE_ATTACHMENT_BROKER | 222 #if USE_ATTACHMENT_BROKER |
232 GetAttachmentBroker()->RemoveObserver(this); | 223 GetAttachmentBroker()->RemoveObserver(this); |
233 #endif // USE_ATTACHMENT_BROKER | 224 #endif // USE_ATTACHMENT_BROKER |
234 } | 225 } |
235 | 226 |
236 } // namespace internal | 227 } // namespace internal |
237 } // namespace IPC | 228 } // namespace IPC |
OLD | NEW |