OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // We're in the browser process. | 226 // We're in the browser process. |
227 consumer_->Log(data); | 227 consumer_->Log(data); |
228 } else { | 228 } else { |
229 // We're in the renderer or plugin processes. | 229 // We're in the renderer or plugin processes. |
230 if (sender_) { | 230 if (sender_) { |
231 queued_logs_.push_back(data); | 231 queued_logs_.push_back(data); |
232 if (!queue_invoke_later_pending_) { | 232 if (!queue_invoke_later_pending_) { |
233 queue_invoke_later_pending_ = true; | 233 queue_invoke_later_pending_ = true; |
234 MessageLoop::current()->PostDelayedTask( | 234 MessageLoop::current()->PostDelayedTask( |
235 FROM_HERE, base::Bind(&Logging::OnSendLogs, base::Unretained(this)), | 235 FROM_HERE, base::Bind(&Logging::OnSendLogs, base::Unretained(this)), |
236 kLogSendDelayMs); | 236 base::TimeDelta::FromMilliseconds(kLogSendDelayMs)); |
237 } | 237 } |
238 } | 238 } |
239 } | 239 } |
240 if (enabled_on_stderr_) { | 240 if (enabled_on_stderr_) { |
241 std::string message_name; | 241 std::string message_name; |
242 if (data.message_name.empty()) { | 242 if (data.message_name.empty()) { |
243 message_name = StringPrintf("[unknown type %d]", data.type); | 243 message_name = StringPrintf("[unknown type %d]", data.type); |
244 } else { | 244 } else { |
245 message_name = data.message_name; | 245 message_name = data.message_name; |
246 } | 246 } |
(...skipping 58 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 |