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_
12 class HostNPScriptObject
;
14 class HostLogHandler
{
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
25 static void RegisterLoggingScriptObject(HostNPScriptObject
* script_object
);
26 static void UnregisterLoggingScriptObject(HostNPScriptObject
* script_object
);
29 // A Log Message Handler that is called after each LOG message has been
30 // processed. This must be of type LogMessageHandlerFunction defined in
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_