| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 void Logging::Disable() { | 90 void Logging::Disable() { |
| 91 enabled_ = false; | 91 enabled_ = false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void Logging::OnSendLogs() { | 94 void Logging::OnSendLogs() { |
| 95 queue_invoke_later_pending_ = false; | 95 queue_invoke_later_pending_ = false; |
| 96 if (!sender_) | 96 if (!sender_) |
| 97 return; | 97 return; |
| 98 | 98 |
| 99 Message* msg = new Message( | 99 Message* msg = new Message(MSG_ROUTING_CONTROL, IPC_LOGGING_ID); |
| 100 MSG_ROUTING_CONTROL, IPC_LOGGING_ID, Message::PRIORITY_NORMAL); | |
| 101 WriteParam(msg, queued_logs_); | 100 WriteParam(msg, queued_logs_); |
| 102 queued_logs_.clear(); | 101 queued_logs_.clear(); |
| 103 sender_->Send(msg); | 102 sender_->Send(msg); |
| 104 } | 103 } |
| 105 | 104 |
| 106 void Logging::SetIPCSender(IPC::Sender* sender) { | 105 void Logging::SetIPCSender(IPC::Sender* sender) { |
| 107 sender_ = sender; | 106 sender_ = sender; |
| 108 } | 107 } |
| 109 | 108 |
| 110 void Logging::OnReceivedLoggingMessage(const Message& message) { | 109 void Logging::OnReceivedLoggingMessage(const Message& message) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 data->receive = message.received_time(); | 305 data->receive = message.received_time(); |
| 307 data->dispatch = Time::Now().ToInternalValue(); | 306 data->dispatch = Time::Now().ToInternalValue(); |
| 308 data->params = params; | 307 data->params = params; |
| 309 data->message_name = message_name; | 308 data->message_name = message_name; |
| 310 } | 309 } |
| 311 } | 310 } |
| 312 | 311 |
| 313 } | 312 } |
| 314 | 313 |
| 315 #endif // IPC_MESSAGE_LOG_ENABLED | 314 #endif // IPC_MESSAGE_LOG_ENABLED |
| OLD | NEW |