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

Unified Diff: remoting/host/plugin/host_log_handler.h

Issue 340993002: Revert of Remove NPAPI plugin from chromoting webapp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « remoting/host/chromoting_host_context.h ('k') | remoting/host/plugin/host_log_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/plugin/host_log_handler.h
diff --git a/remoting/host/plugin/host_log_handler.h b/remoting/host/plugin/host_log_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..f044872e5255246a1dd3d8f941de8e7d9a0d261e
--- /dev/null
+++ b/remoting/host/plugin/host_log_handler.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_
+#define REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_
+
+#include <string>
+
+namespace remoting {
+
+class HostNPScriptObject;
+
+class HostLogHandler {
+ public:
+ // Register the log handler.
+ // These should be called from the plugin init/destroy methods so that they
+ // are only called once per plugin process (not once per plugin instance).
+ static void RegisterLogMessageHandler();
+
+ // We don't have the corresponding UnregisterLogMessageHandler because it
+ // is not safe to call it when there are multiple threads that might be
+ // logging.
+
+ static void RegisterLoggingScriptObject(HostNPScriptObject* script_object);
+ static void UnregisterLoggingScriptObject(HostNPScriptObject* script_object);
+
+ private:
+ // A Log Message Handler that is called after each LOG message has been
+ // processed. This must be of type LogMessageHandlerFunction defined in
+ // base/logging.h.
+ static bool LogToUI(int severity, const char* file, int line,
+ size_t message_start, const std::string& str);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_PLUGIN_HOST_LOG_HANDLER_H_
« no previous file with comments | « remoting/host/chromoting_host_context.h ('k') | remoting/host/plugin/host_log_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698