Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: remoting/host/native_messaging/log_message_handler.h

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/logging_mac.cc ('k') | remoting/host/native_messaging/log_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/native_messaging/log_message_handler.h
diff --git a/remoting/host/native_messaging/log_message_handler.h b/remoting/host/native_messaging/log_message_handler.h
index 7c5cea08c1256471d4a47889fb17f0d7efa74b75..ac8f01e46fed4038a8f4c5f421442c1dcea141b4 100644
--- a/remoting/host/native_messaging/log_message_handler.h
+++ b/remoting/host/native_messaging/log_message_handler.h
@@ -20,22 +20,26 @@ class SingleThreadTaskRunner;
namespace remoting {
-// Helper class for logging::SetLogMessageHandler to deliver log messages to
+// Helper class for logging::LogMessageListener to deliver log messages to
// a consistent thread in a thread-safe way and in a format suitable for sending
// over a Native Messaging channel.
-class LogMessageHandler {
+class LogMessageListener : logging::LogMessageListener {
public:
typedef base::Callback<void(std::unique_ptr<base::Value> message)> Delegate;
- explicit LogMessageHandler(const Delegate& delegate);
- ~LogMessageHandler();
+ explicit LogMessageListener(const Delegate& delegate);
+ ~LogMessageListener() override;
static const char* kDebugMessageTypeName;
+ // logging::LogMessageListener
+ void OnMessage(int severity,
+ const char* file,
+ int line,
+ size_t message_start,
+ const std::string& str) override;
+
private:
- static bool OnLogMessage(
- int severity, const char* file, int line,
- size_t message_start, const std::string& str);
void PostLogMessageToCorrectThread(
int severity, const char* file, int line,
size_t message_start, const std::string& str);
@@ -46,8 +50,7 @@ class LogMessageHandler {
Delegate delegate_;
bool suppress_logging_;
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
- logging::LogMessageHandlerFunction previous_log_message_handler_;
- base::WeakPtrFactory<LogMessageHandler> weak_ptr_factory_;
+ base::WeakPtrFactory<LogMessageListener> weak_ptr_factory_;
};
} // namespace remoting
« no previous file with comments | « remoting/host/logging_mac.cc ('k') | remoting/host/native_messaging/log_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698