summaryrefslogtreecommitdiffstats
path: root/webkit/activex_shim_dll/activex_shim_dll.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-09 18:56:16 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-09 18:56:16 +0000
commit22ef2b177713a1206814cde489ba7fc7cbd6e05d (patch)
tree0f043df3cbd3abe67dd3c2b57e1a9052f09e429f /webkit/activex_shim_dll/activex_shim_dll.cc
parent30cdf1b498549d19a9b39388831d5ac1a5c93b98 (diff)
downloadchromium_src-22ef2b177713a1206814cde489ba7fc7cbd6e05d.zip
chromium_src-22ef2b177713a1206814cde489ba7fc7cbd6e05d.tar.gz
chromium_src-22ef2b177713a1206814cde489ba7fc7cbd6e05d.tar.bz2
Initialize the command line object before initializing the logger. Also
register/unregister the AtExitManager for the shim. TBR=joshia Review URL: http://codereview.chromium.org/40283 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/activex_shim_dll/activex_shim_dll.cc')
-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;
}