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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return DISPATCH_WAITING_ON_BROKER; | 143 return DISPATCH_WAITING_ON_BROKER; |
144 } | 144 } |
145 | 145 |
146 DispatchMessage(m); | 146 DispatchMessage(m); |
147 queued_messages_.erase(queued_messages_.begin()); | 147 queued_messages_.erase(queued_messages_.begin()); |
148 } | 148 } |
149 return DISPATCH_FINISHED; | 149 return DISPATCH_FINISHED; |
150 } | 150 } |
151 | 151 |
152 void ChannelReader::DispatchMessage(Message* m) { | 152 void ChannelReader::DispatchMessage(Message* m) { |
| 153 m->set_sender_pid(GetSenderPID()); |
| 154 |
153 #ifdef IPC_MESSAGE_LOG_ENABLED | 155 #ifdef IPC_MESSAGE_LOG_ENABLED |
154 std::string name; | 156 std::string name; |
155 Logging::GetInstance()->GetMessageText(m->type(), &name, m, NULL); | 157 Logging::GetInstance()->GetMessageText(m->type(), &name, m, NULL); |
156 TRACE_EVENT1("ipc,toplevel", "ChannelReader::DispatchInputData", "name", | 158 TRACE_EVENT1("ipc,toplevel", "ChannelReader::DispatchInputData", "name", |
157 name); | 159 name); |
158 #else | 160 #else |
159 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", "class", | 161 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", "class", |
160 IPC_MESSAGE_ID_CLASS(m->type()), "line", | 162 IPC_MESSAGE_ID_CLASS(m->type()), "line", |
161 IPC_MESSAGE_ID_LINE(m->type())); | 163 IPC_MESSAGE_ID_LINE(m->type())); |
162 #endif | 164 #endif |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 219 } |
218 | 220 |
219 void ChannelReader::StopObservingAttachmentBroker() { | 221 void ChannelReader::StopObservingAttachmentBroker() { |
220 #if USE_ATTACHMENT_BROKER | 222 #if USE_ATTACHMENT_BROKER |
221 GetAttachmentBroker()->RemoveObserver(this); | 223 GetAttachmentBroker()->RemoveObserver(this); |
222 #endif // USE_ATTACHMENT_BROKER | 224 #endif // USE_ATTACHMENT_BROKER |
223 } | 225 } |
224 | 226 |
225 } // namespace internal | 227 } // namespace internal |
226 } // namespace IPC | 228 } // namespace IPC |
OLD | NEW |