| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 28 matching lines...) Expand all Loading... |
| 39 public: | 39 public: |
| 40 virtual void Log(const LogData& data) = 0; | 40 virtual void Log(const LogData& data) = 0; |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 virtual ~Consumer() {} | 43 virtual ~Consumer() {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 void SetConsumer(Consumer* consumer); | 46 void SetConsumer(Consumer* consumer); |
| 47 | 47 |
| 48 ~Logging(); | 48 ~Logging(); |
| 49 static Logging* current(); | 49 static Logging* GetInstance(); |
| 50 | 50 |
| 51 // Enable and Disable are NOT cross-process; they only affect the | 51 // Enable and Disable are NOT cross-process; they only affect the |
| 52 // current thread/process. If you want to modify the value for all | 52 // current thread/process. If you want to modify the value for all |
| 53 // processes, perhaps your intent is to call | 53 // processes, perhaps your intent is to call |
| 54 // g_browser_process->SetIPCLoggingEnabled(). | 54 // g_browser_process->SetIPCLoggingEnabled(). |
| 55 void Enable(); | 55 void Enable(); |
| 56 void Disable(); | 56 void Disable(); |
| 57 bool Enabled() const { return enabled_; } | 57 bool Enabled() const { return enabled_; } |
| 58 | 58 |
| 59 // Called by child processes to give the logger object the channel to send | 59 // Called by child processes to give the logger object the channel to send |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 Consumer* consumer_; | 107 Consumer* consumer_; |
| 108 | 108 |
| 109 static LogFunctionMap* log_function_map_; | 109 static LogFunctionMap* log_function_map_; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace IPC | 112 } // namespace IPC |
| 113 | 113 |
| 114 #endif // IPC_MESSAGE_LOG_ENABLED | 114 #endif // IPC_MESSAGE_LOG_ENABLED |
| 115 | 115 |
| 116 #endif // IPC_IPC_LOGGING_H_ | 116 #endif // IPC_IPC_LOGGING_H_ |
| OLD | NEW |