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

Side by Side Diff: chrome/installer/gcapi/gcapi_dll.cc

Issue 16519003: Define a LoggingSettings struct to use for InitLogging() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/logging_chrome.cc ('k') | chrome/installer/tools/validate_installation_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <windows.h> 5 #include <windows.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 // Visual Studio needs at least one C++ file in project http://goo.gl/roro9 11 // Visual Studio needs at least one C++ file in project http://goo.gl/roro9
12 12
13 namespace { 13 namespace {
14 base::AtExitManager* g_exit_manager = NULL; 14 base::AtExitManager* g_exit_manager = NULL;
15 } 15 }
16 16
17 // DLL Entry Point - This is necessary to initialize basic things like the 17 // DLL Entry Point - This is necessary to initialize basic things like the
18 // CommandLine and Logging components needed by functions in the DLL. 18 // CommandLine and Logging components needed by functions in the DLL.
19 extern "C" BOOL WINAPI DllMain(HINSTANCE instance, 19 extern "C" BOOL WINAPI DllMain(HINSTANCE instance,
20 DWORD reason, 20 DWORD reason,
21 LPVOID reserved) { 21 LPVOID reserved) {
22 if (reason == DLL_PROCESS_ATTACH) { 22 if (reason == DLL_PROCESS_ATTACH) {
23 g_exit_manager = new base::AtExitManager(); 23 g_exit_manager = new base::AtExitManager();
24 CommandLine::Init(0, NULL); 24 CommandLine::Init(0, NULL);
25 logging::InitLogging( 25 logging::LoggingSettings settings;
26 NULL, 26 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
27 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, 27 logging::InitLogging(settings);
28 logging::LOCK_LOG_FILE,
29 logging::DELETE_OLD_LOG_FILE,
30 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
31 } else if (reason == DLL_PROCESS_DETACH) { 28 } else if (reason == DLL_PROCESS_DETACH) {
32 CommandLine::Reset(); 29 CommandLine::Reset();
33 delete g_exit_manager; 30 delete g_exit_manager;
34 g_exit_manager = NULL; 31 g_exit_manager = NULL;
35 } 32 }
36 33
37 return TRUE; 34 return TRUE;
38 } 35 }
OLDNEW
« no previous file with comments | « chrome/common/logging_chrome.cc ('k') | chrome/installer/tools/validate_installation_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698