OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_ | |
6 #define REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_ | |
7 | |
8 // TODO remove unnecessary includes. | |
Wez
2011/08/30 05:20:02
Yes, please. ;)
garykac
2011/08/31 00:59:00
Done.
| |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/synchronization/cancellation_flag.h" | |
13 #include "base/synchronization/waitable_event.h" | |
14 #include "base/string16.h" | |
15 #include "base/threading/platform_thread.h" | |
16 #include "base/time.h" | |
17 #include "remoting/base/plugin_message_loop_proxy.h" | |
18 #include "remoting/host/chromoting_host_context.h" | |
19 #include "remoting/host/host_status_observer.h" | |
20 #include "remoting/host/plugin/host_plugin_utils.h" | |
21 #include "third_party/npapi/bindings/npapi.h" | |
22 #include "third_party/npapi/bindings/npfunctions.h" | |
23 #include "third_party/npapi/bindings/npruntime.h" | |
24 | |
25 namespace remoting { | |
26 | |
27 class HostNPScriptObject; | |
28 | |
29 class HostLogHandler { | |
30 public: | |
31 // Register/Unregister the log handler. | |
32 // These should be called from the plugin init/destroy methods so that they | |
33 // are only called once per plugin process (not once per plugin instance). | |
34 static void RegisterLogMessageHandler(); | |
35 static void UnregisterLogMessageHandler(); | |
Wez
2011/08/30 05:20:02
Let's not expose the unregister functionality, sin
garykac
2011/08/31 00:59:00
Done.
| |
36 | |
37 static void RegisterLoggingScriptObject(HostNPScriptObject* script_object); | |
38 static void UnregisterLoggingScriptObject(HostNPScriptObject* script_object); | |
39 | |
40 private: | |
41 // A Log Message Handler that is called after each LOG message has been | |
42 // processed. This must be of type LogMessageHandlerFunction defined in | |
43 // base/logging.h. | |
44 static bool LogToUI(int severity, const char* file, int line, | |
45 size_t message_start, const std::string& str); | |
46 }; | |
47 | |
48 } // namespace remoting | |
49 | |
50 #endif // REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_ | |
OLD | NEW |