Index: chrome/installer/gcapi/gcapi_dll.cc |
diff --git a/chrome/installer/gcapi/gcapi_dll.cc b/chrome/installer/gcapi/gcapi_dll.cc |
index 26f4098447c89ef1f32ea87117b985f9328666ec..67b3aba45bcc9bb82ed11e0f708165da2c504dc5 100644 |
--- a/chrome/installer/gcapi/gcapi_dll.cc |
+++ b/chrome/installer/gcapi/gcapi_dll.cc |
@@ -2,4 +2,32 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
grt (UTC plus 2)
2012/12/20 19:45:33
#include <windows.h> for things like WINAPI, HINST
SteveT
2013/01/07 21:16:52
Done.
|
+#include "base/at_exit.h" |
+#include "base/command_line.h" |
+#include "base/logging.h" |
+ |
// Visual Studio needs at least one C++ file in project http://goo.gl/roro9 |
+ |
+base::AtExitManager* g_exit_manager = NULL; |
grt (UTC plus 2)
2012/12/20 19:45:33
put this in the unnamed namespace.
SteveT
2013/01/07 21:16:52
Done.
|
+ |
+// DLL Entry Point - This is necessary to initialize basic things like the |
+// CommandLine and Logging components needed by functions in the DLL. |
+extern "C" BOOL WINAPI DllMain(HINSTANCE instance, |
+ DWORD reason, |
+ LPVOID reserved) { |
+ if (reason == DLL_PROCESS_ATTACH) { |
+ g_exit_manager = new base::AtExitManager(); |
+ CommandLine::Init(0, NULL); |
+ logging::InitLogging( |
+ NULL, |
+ logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
+ logging::LOCK_LOG_FILE, |
+ logging::DELETE_OLD_LOG_FILE, |
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
+ } else { |
grt (UTC plus 2)
2012/12/20 19:45:33
} else if (reason == DLL_PROCESS_DETACH) {
(since
SteveT
2013/01/07 21:16:52
Done. Thanks for catching this.
|
+ delete g_exit_manager; |
grt (UTC plus 2)
2012/12/20 19:45:33
it seems prudent (although not required) to call C
SteveT
2013/01/07 21:16:52
Prudent, yes. I'll add it in.
(I am guessing that
grt (UTC plus 2)
2013/01/08 04:34:06
It doesn't appear that CommandLine uses the AtExit
|
+ g_exit_manager = NULL; |
+ } |
+ |
+ return TRUE; |
+} |