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

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

Issue 7648042: Change Chromoting logger to be setup in plugin's NP_Initialize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove comment Created 9 years, 4 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
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..a064634529721bbb2c5fb0594899602104e3bd4b
--- /dev/null
+++ b/remoting/host/plugin/host_log_handler.h
@@ -0,0 +1,50 @@
+// 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_
+
+// TODO remove unnecessary includes.
Wez 2011/08/30 05:20:02 Yes, please. ;)
garykac 2011/08/31 00:59:00 Done.
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/cancellation_flag.h"
+#include "base/synchronization/waitable_event.h"
+#include "base/string16.h"
+#include "base/threading/platform_thread.h"
+#include "base/time.h"
+#include "remoting/base/plugin_message_loop_proxy.h"
+#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/host_status_observer.h"
+#include "remoting/host/plugin/host_plugin_utils.h"
+#include "third_party/npapi/bindings/npapi.h"
+#include "third_party/npapi/bindings/npfunctions.h"
+#include "third_party/npapi/bindings/npruntime.h"
+
+namespace remoting {
+
+class HostNPScriptObject;
+
+class HostLogHandler {
+ public:
+ // Register/Unregister 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();
+ 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.
+
+ 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_

Powered by Google App Engine
This is Rietveld 408576698