Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3023)

Unified Diff: chrome/installer/gcapi/gcapi_dll.cc

Issue 11280067: Refactor SetOmahaExperimentLabel out of gcpai and into install_util. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase; grt comments; unit tests Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..744321a516ae41b35dde5ab7c72dd06d784b4f4b 100644
--- a/chrome/installer/gcapi/gcapi_dll.cc
+++ b/chrome/installer/gcapi/gcapi_dll.cc
@@ -2,4 +2,37 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <windows.h>
+
+#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
+
+namespace {
+base::AtExitManager* g_exit_manager = NULL;
+}
+
+// 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 if (reason == DLL_PROCESS_DETACH) {
+ CommandLine::Reset();
+ delete g_exit_manager;
+ g_exit_manager = NULL;
+ }
+
+ return TRUE;
+}

Powered by Google App Engine
This is Rietveld 408576698