summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/activex_shim_dll/activex_shim_dll.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/webkit/activex_shim_dll/activex_shim_dll.cc b/webkit/activex_shim_dll/activex_shim_dll.cc
index 832df11..74deff3 100644
--- a/webkit/activex_shim_dll/activex_shim_dll.cc
+++ b/webkit/activex_shim_dll/activex_shim_dll.cc
@@ -4,14 +4,20 @@
#include <windows.h>
+#include "base/at_exit.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "webkit/activex_shim/npp_impl.h"
+base::AtExitManager* g_exit_manager = NULL;
// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason,
LPVOID reserved) {
if (reason == DLL_PROCESS_ATTACH) {
+ g_exit_manager = new base::AtExitManager();
#ifdef TRACK_INTERFACE
+ CommandLine::Init(0, NULL);
+
// TODO(ruijiang): Ugly hard-coded path is not good. But we only do it
// for debug build now to trace interface use. Try to find a better place
// later.
@@ -20,6 +26,9 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason,
logging::DONT_LOCK_LOG_FILE,
logging::DELETE_OLD_LOG_FILE);
#endif
+ } else if (reason == DLL_PROCESS_DETACH) {
+ delete g_exit_manager;
+ g_exit_manager = NULL;
}
return TRUE;
}