Index: remoting/host/plugin/host_plugin.cc |
diff --git a/remoting/host/plugin/host_plugin.cc b/remoting/host/plugin/host_plugin.cc |
index f901a03db816b0f117c9a2c183b97c9130a5d48f..62d35c45cee2464b6b0f0c74d98d9e2aba732201 100644 |
--- a/remoting/host/plugin/host_plugin.cc |
+++ b/remoting/host/plugin/host_plugin.cc |
@@ -421,6 +421,9 @@ EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnetscape_funcs |
if(((npnetscape_funcs->version & 0xff00) >> 8) > NP_VERSION_MAJOR) |
return NPERR_INCOMPATIBLE_VERSION_ERROR; |
+ // Register a global log handler. |
+ HostNPScriptObject::RegisterLogger(); |
+ |
g_at_exit_manager = new base::AtExitManager; |
g_npnetscape_funcs = npnetscape_funcs; |
#if defined(OS_POSIX) && !defined(OS_MACOSX) |
@@ -433,6 +436,10 @@ EXPORT NPError API_CALL NP_Shutdown() { |
VLOG(2) << "NP_Shutdown"; |
delete g_at_exit_manager; |
g_at_exit_manager = NULL; |
+ |
+ // Remove the global log handler. |
+ HostNPScriptObject::UnregisterLogger(); |
+ |
return NPERR_NO_ERROR; |
} |