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

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 comments, deque for listeners, reentrant test 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..f90a77d891830ee2a310e8bd5be5ae7d5914a5f1 100644
--- a/remoting/host/native_messaging/log_message_handler.h
+++ b/remoting/host/native_messaging/log_message_handler.h
@@ -15,22 +15,26 @@
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;
+ // logging::LogMessageHandler
+ bool 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);
@@ -41,7 +45,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