| 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 #ifndef IPC_IPC_LOGGING_H_ | 5 #ifndef IPC_IPC_LOGGING_H_ |
| 6 #define IPC_IPC_LOGGING_H_ | 6 #define IPC_IPC_LOGGING_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 9 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Enable and Disable are NOT cross-process; they only affect the | 52 // Enable and Disable are NOT cross-process; they only affect the |
| 53 // current thread/process. If you want to modify the value for all | 53 // current thread/process. If you want to modify the value for all |
| 54 // processes, perhaps your intent is to call | 54 // processes, perhaps your intent is to call |
| 55 // g_browser_process->SetIPCLoggingEnabled(). | 55 // g_browser_process->SetIPCLoggingEnabled(). |
| 56 void Enable(); | 56 void Enable(); |
| 57 void Disable(); | 57 void Disable(); |
| 58 bool Enabled() const { return enabled_; } | 58 bool Enabled() const { return enabled_; } |
| 59 | 59 |
| 60 // Called by child processes to give the logger object the channel to send | 60 // Called by child processes to give the logger object the channel to send |
| 61 // logging data to the browser process. | 61 // logging data to the browser process. |
| 62 void SetIPCSender(Message::Sender* sender); | 62 void SetIPCSender(Sender* sender); |
| 63 | 63 |
| 64 // Called in the browser process when logging data from a child process is | 64 // Called in the browser process when logging data from a child process is |
| 65 // received. | 65 // received. |
| 66 void OnReceivedLoggingMessage(const Message& message); | 66 void OnReceivedLoggingMessage(const Message& message); |
| 67 | 67 |
| 68 void OnSendMessage(Message* message, const std::string& channel_id); | 68 void OnSendMessage(Message* message, const std::string& channel_id); |
| 69 void OnPreDispatchMessage(const Message& message); | 69 void OnPreDispatchMessage(const Message& message); |
| 70 void OnPostDispatchMessage(const Message& message, | 70 void OnPostDispatchMessage(const Message& message, |
| 71 const std::string& channel_id); | 71 const std::string& channel_id); |
| 72 | 72 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void OnSendLogs(); | 105 void OnSendLogs(); |
| 106 void Log(const LogData& data); | 106 void Log(const LogData& data); |
| 107 | 107 |
| 108 bool enabled_; | 108 bool enabled_; |
| 109 bool enabled_on_stderr_; // only used on POSIX for now | 109 bool enabled_on_stderr_; // only used on POSIX for now |
| 110 bool enabled_color_; // only used on POSIX for now | 110 bool enabled_color_; // only used on POSIX for now |
| 111 | 111 |
| 112 std::vector<LogData> queued_logs_; | 112 std::vector<LogData> queued_logs_; |
| 113 bool queue_invoke_later_pending_; | 113 bool queue_invoke_later_pending_; |
| 114 | 114 |
| 115 Message::Sender* sender_; | 115 Sender* sender_; |
| 116 MessageLoop* main_thread_; | 116 MessageLoop* main_thread_; |
| 117 | 117 |
| 118 Consumer* consumer_; | 118 Consumer* consumer_; |
| 119 | 119 |
| 120 static LogFunctionMap* log_function_map_; | 120 static LogFunctionMap* log_function_map_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace IPC | 123 } // namespace IPC |
| 124 | 124 |
| 125 #endif // IPC_MESSAGE_LOG_ENABLED | 125 #endif // IPC_MESSAGE_LOG_ENABLED |
| 126 | 126 |
| 127 #endif // IPC_IPC_LOGGING_H_ | 127 #endif // IPC_IPC_LOGGING_H_ |
| OLD | NEW |