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

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: address grt's comments Created 4 years, 4 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
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 201c7ba77cf9df592ece0827b0a17e79bfcbaa82..563d82384f95d38a74d71b6cc01d853db1ef8490 100644
--- a/remoting/host/native_messaging/log_message_handler.h
+++ b/remoting/host/native_messaging/log_message_handler.h
@@ -15,22 +15,24 @@
namespace remoting {
-// Helper class for logging::SetLogMessageHandler to deliver log messages to
+// Helper class for logging::LogMessageHandler 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 LogMessageHandler : logging::LogMessageHandler {
public:
typedef base::Callback<void(std::unique_ptr<base::Value> message)> Delegate;
explicit LogMessageHandler(const Delegate& delegate);
- ~LogMessageHandler();
+ ~LogMessageHandler() override;
static const char* kDebugMessageTypeName;
- private:
- static bool OnLogMessage(
+ // logging::LogMessageHandler
+ bool OnMessage(
int severity, const char* file, int line,
- size_t message_start, const std::string& str);
+ size_t message_start, const std::string& str) override;
+
+ private:
void PostLogMessageToCorrectThread(
int severity, const char* file, int line,
size_t message_start, const std::string& str);
@@ -41,7 +43,6 @@ 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_;
};

Powered by Google App Engine
This is Rietveld 408576698