Do not announce robot account token before account ID is available
[chromium-blink-merge.git] / chrome / installer / gcapi / gcapi_dll.cc
blob66e9bc1c29ac9f070feb336a54a0b329bd17c251
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include <windows.h>
7 #include "base/at_exit.h"
8 #include "base/command_line.h"
9 #include "base/logging.h"
11 // Visual Studio needs at least one C++ file in project http://goo.gl/roro9
13 namespace {
14 base::AtExitManager* g_exit_manager = NULL;
17 // DLL Entry Point - This is necessary to initialize basic things like the
18 // CommandLine and Logging components needed by functions in the DLL.
19 extern "C" BOOL WINAPI DllMain(HINSTANCE instance,
20 DWORD reason,
21 LPVOID reserved) {
22 if (reason == DLL_PROCESS_ATTACH) {
23 g_exit_manager = new base::AtExitManager();
24 base::CommandLine::Init(0, NULL);
25 logging::LoggingSettings settings;
26 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
27 logging::InitLogging(settings);
28 } else if (reason == DLL_PROCESS_DETACH) {
29 base::CommandLine::Reset();
30 delete g_exit_manager;
31 g_exit_manager = NULL;
34 return TRUE;