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_logging.h" | 5 #include "ipc/ipc_logging.h" |
6 | 6 |
7 #ifdef IPC_MESSAGE_LOG_ENABLED | 7 #ifdef IPC_MESSAGE_LOG_ENABLED |
8 #define IPC_MESSAGE_MACROS_LOG_ENABLED | 8 #define IPC_MESSAGE_MACROS_LOG_ENABLED |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 queued_logs_.clear(); | 102 queued_logs_.clear(); |
103 sender_->Send(msg); | 103 sender_->Send(msg); |
104 } | 104 } |
105 | 105 |
106 void Logging::SetIPCSender(IPC::Message::Sender* sender) { | 106 void Logging::SetIPCSender(IPC::Message::Sender* sender) { |
107 sender_ = sender; | 107 sender_ = sender; |
108 } | 108 } |
109 | 109 |
110 void Logging::OnReceivedLoggingMessage(const Message& message) { | 110 void Logging::OnReceivedLoggingMessage(const Message& message) { |
111 std::vector<LogData> data; | 111 std::vector<LogData> data; |
112 void* iter = NULL; | 112 PickleIterator iter(message); |
113 if (!ReadParam(&message, &iter, &data)) | 113 if (!ReadParam(&message, &iter, &data)) |
114 return; | 114 return; |
115 | 115 |
116 for (size_t i = 0; i < data.size(); ++i) { | 116 for (size_t i = 0; i < data.size(); ++i) { |
117 Log(data[i]); | 117 Log(data[i]); |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 void Logging::OnSendMessage(Message* message, const std::string& channel_id) { | 121 void Logging::OnSendMessage(Message* message, const std::string& channel_id) { |
122 if (!Enabled()) | 122 if (!Enabled()) |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 data->receive = message.received_time(); | 305 data->receive = message.received_time(); |
306 data->dispatch = Time::Now().ToInternalValue(); | 306 data->dispatch = Time::Now().ToInternalValue(); |
307 data->params = params; | 307 data->params = params; |
308 data->message_name = message_name; | 308 data->message_name = message_name; |
309 } | 309 } |
310 } | 310 } |
311 | 311 |
312 } | 312 } |
313 | 313 |
314 #endif // IPC_MESSAGE_LOG_ENABLED | 314 #endif // IPC_MESSAGE_LOG_ENABLED |
OLD | NEW |