Revert 264226 "Reduce dependency of TiclInvalidationService on P..."
[chromium-blink-merge.git] / remoting / host / plugin / host_log_handler.h
blobf044872e5255246a1dd3d8f941de8e7d9a0d261e
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.
5 #ifndef REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_
6 #define REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_
8 #include <string>
10 namespace remoting {
12 class HostNPScriptObject;
14 class HostLogHandler {
15 public:
16 // Register the log handler.
17 // These should be called from the plugin init/destroy methods so that they
18 // are only called once per plugin process (not once per plugin instance).
19 static void RegisterLogMessageHandler();
21 // We don't have the corresponding UnregisterLogMessageHandler because it
22 // is not safe to call it when there are multiple threads that might be
23 // logging.
25 static void RegisterLoggingScriptObject(HostNPScriptObject* script_object);
26 static void UnregisterLoggingScriptObject(HostNPScriptObject* script_object);
28 private:
29 // A Log Message Handler that is called after each LOG message has been
30 // processed. This must be of type LogMessageHandlerFunction defined in
31 // base/logging.h.
32 static bool LogToUI(int severity, const char* file, int line,
33 size_t message_start, const std::string& str);
36 } // namespace remoting
38 #endif // REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_