| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 GenerateLogData(channel_id, message, &data, true); | 160 GenerateLogData(channel_id, message, &data, true); |
| 161 | 161 |
| 162 if (base::MessageLoop::current() == main_thread_) { | 162 if (base::MessageLoop::current() == main_thread_) { |
| 163 Log(data); | 163 Log(data); |
| 164 } else { | 164 } else { |
| 165 main_thread_->task_runner()->PostTask( | 165 main_thread_->task_runner()->PostTask( |
| 166 FROM_HERE, base::Bind(&Logging::Log, base::Unretained(this), data)); | 166 FROM_HERE, base::Bind(&Logging::Log, base::Unretained(this), data)); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 void Logging::GetMessageText(uint32 type, std::string* name, | 170 void Logging::GetMessageText(uint32_t type, std::string* name, |
| 171 const Message* message, | 171 const Message* message, |
| 172 std::string* params) { | 172 std::string* params) { |
| 173 if (!log_function_map_) | 173 if (!log_function_map_) |
| 174 return; | 174 return; |
| 175 | 175 |
| 176 LogFunctionMap::iterator it = log_function_map_->find(type); | 176 LogFunctionMap::iterator it = log_function_map_->find(type); |
| 177 if (it == log_function_map_->end()) { | 177 if (it == log_function_map_->end()) { |
| 178 if (name) { | 178 if (name) { |
| 179 *name = "[UNKNOWN MSG "; | 179 *name = "[UNKNOWN MSG "; |
| 180 *name += base::IntToString(type); | 180 *name += base::IntToString(type); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 data->receive = message.received_time(); | 306 data->receive = message.received_time(); |
| 307 data->dispatch = Time::Now().ToInternalValue(); | 307 data->dispatch = Time::Now().ToInternalValue(); |
| 308 data->params = params; | 308 data->params = params; |
| 309 data->message_name = message_name; | 309 data->message_name = message_name; |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 | 312 |
| 313 } | 313 } |
| 314 | 314 |
| 315 #endif // IPC_MESSAGE_LOG_ENABLED | 315 #endif // IPC_MESSAGE_LOG_ENABLED |
| OLD | NEW |