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); |