OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 REMOTING_HOST_NATIVE_MESSAGIN_LOG_HANDLER_H_ | 5 #ifndef REMOTING_HOST_NATIVE_MESSAGIN_LOG_HANDLER_H_ |
6 #define REMOTING_HOST_NATIVE_MESSAGIN_LOG_HANDLER_H_ | 6 #define REMOTING_HOST_NATIVE_MESSAGIN_LOG_HANDLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "base/values.h" | 15 #include "base/values.h" |
15 | 16 |
| 17 namespace base { |
| 18 class SingleThreadTaskRunner; |
| 19 } |
| 20 |
16 namespace remoting { | 21 namespace remoting { |
17 | 22 |
18 // Helper class for logging::SetLogMessageHandler to deliver log messages to | 23 // Helper class for logging::SetLogMessageHandler to deliver log messages to |
19 // a consistent thread in a thread-safe way and in a format suitable for sending | 24 // a consistent thread in a thread-safe way and in a format suitable for sending |
20 // over a Native Messaging channel. | 25 // over a Native Messaging channel. |
21 class LogMessageHandler { | 26 class LogMessageHandler { |
22 public: | 27 public: |
23 typedef base::Callback<void(std::unique_ptr<base::Value> message)> Delegate; | 28 typedef base::Callback<void(std::unique_ptr<base::Value> message)> Delegate; |
24 | 29 |
25 explicit LogMessageHandler(const Delegate& delegate); | 30 explicit LogMessageHandler(const Delegate& delegate); |
(...skipping 15 matching lines...) Expand all Loading... |
41 Delegate delegate_; | 46 Delegate delegate_; |
42 bool suppress_logging_; | 47 bool suppress_logging_; |
43 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 48 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
44 logging::LogMessageHandlerFunction previous_log_message_handler_; | 49 logging::LogMessageHandlerFunction previous_log_message_handler_; |
45 base::WeakPtrFactory<LogMessageHandler> weak_ptr_factory_; | 50 base::WeakPtrFactory<LogMessageHandler> weak_ptr_factory_; |
46 }; | 51 }; |
47 | 52 |
48 } // namespace remoting | 53 } // namespace remoting |
49 | 54 |
50 #endif | 55 #endif |
OLD | NEW |