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

Unified Diff: remoting/host/plugin/host_plugin.cc

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_plugin.cc
diff --git a/remoting/host/plugin/host_plugin.cc b/remoting/host/plugin/host_plugin.cc
index 077637276f1768d00f579542df08f0139839ba7f..09ba802c03cca9927940cd5112f845f1e4116181 100644
--- a/remoting/host/plugin/host_plugin.cc
+++ b/remoting/host/plugin/host_plugin.cc
@@ -13,6 +13,7 @@
#include "base/logging.h"
#include "base/stringize_macros.h"
#include "remoting/base/plugin_message_loop_proxy.h"
+#include "remoting/host/plugin/host_log_handler.h"
#include "remoting/host/plugin/host_plugin_utils.h"
#include "remoting/host/plugin/host_script_object.h"
#include "third_party/npapi/bindings/npapi.h"
@@ -43,6 +44,7 @@ uint64_t __cdecl __udivdi3(uint64_t a, uint64_t b) {
#endif
using remoting::g_npnetscape_funcs;
+using remoting::HostLogHandler;
using remoting::HostNPScriptObject;
using remoting::StringFromNPIdentifier;
@@ -352,6 +354,10 @@ NPError CreatePlugin(NPMIMEType pluginType,
char** argv,
NPSavedData* saved) {
VLOG(2) << "CreatePlugin";
+
+ // Register a global log handler.
+ HostLogHandler::RegisterLogMessageHandler();
+
HostNPPlugin* plugin = new HostNPPlugin(instance, mode);
instance->pdata = plugin;
if (!plugin->Init(argc, argn, argv, saved)) {
@@ -366,6 +372,10 @@ NPError CreatePlugin(NPMIMEType pluginType,
NPError DestroyPlugin(NPP instance,
NPSavedData** save) {
VLOG(2) << "DestroyPlugin";
+
+ // Unregister a global log handler.
+ HostLogHandler::UnregisterLogMessageHandler();
Wez 2011/08/30 05:20:02 Can't do this here, in case there are threads doin
garykac 2011/08/31 00:59:00 Added comment, per our discussion. Plz review.
+
HostNPPlugin* plugin = PluginFromInstance(instance);
if (plugin) {
plugin->Save(save);

Powered by Google App Engine
This is Rietveld 408576698