OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This will cause render_messages.h etc to define ViewMsgLog and friends. | 8 // This will cause render_messages.h etc to define ViewMsgLog and friends. |
9 #define IPC_MESSAGE_MACROS_LOG_ENABLED | 9 #define IPC_MESSAGE_MACROS_LOG_ENABLED |
10 #endif | 10 #endif |
11 | 11 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void Logging::GetMessageText(uint32 type, std::string* name, | 164 void Logging::GetMessageText(uint32 type, std::string* name, |
165 const Message* message, | 165 const Message* message, |
166 std::string* params) { | 166 std::string* params) { |
167 if (!log_function_mapping_) | 167 if (!log_function_mapping_) |
168 return; | 168 return; |
169 | 169 |
170 int message_class = type >> 16; | 170 int message_class = type >> 16; |
171 if (log_function_mapping_[message_class] != NULL) { | 171 if (log_function_mapping_[message_class] != NULL) { |
172 log_function_mapping_[message_class](type, name, message, params); | 172 log_function_mapping_[message_class](type, name, message, params); |
173 } else { | 173 } else { |
174 DLOG(INFO) << "No logger function associated with message class " << | 174 DVLOG(1) << "No logger function associated with message class " |
175 message_class; | 175 << message_class; |
176 } | 176 } |
177 } | 177 } |
178 | 178 |
179 void Logging::Log(const LogData& data) { | 179 void Logging::Log(const LogData& data) { |
180 if (consumer_) { | 180 if (consumer_) { |
181 // We're in the browser process. | 181 // We're in the browser process. |
182 consumer_->Log(data); | 182 consumer_->Log(data); |
183 } else { | 183 } else { |
184 // We're in the renderer or plugin processes. | 184 // We're in the renderer or plugin processes. |
185 if (sender_) { | 185 if (sender_) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 data->receive = message.received_time(); | 242 data->receive = message.received_time(); |
243 data->dispatch = Time::Now().ToInternalValue(); | 243 data->dispatch = Time::Now().ToInternalValue(); |
244 data->params = params; | 244 data->params = params; |
245 data->message_name = message_name; | 245 data->message_name = message_name; |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 } | 249 } |
250 | 250 |
251 #endif // IPC_MESSAGE_LOG_ENABLED | 251 #endif // IPC_MESSAGE_LOG_ENABLED |
OLD | NEW |