OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <tchar.h> | 7 #include <tchar.h> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "components/crash/tools/crash_service.h" | 13 #include "components/crash/content/tools/crash_service.h" |
14 | 14 |
15 int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line, | 15 int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line, |
16 int show_mode) { | 16 int show_mode) { |
17 // Manages the destruction of singletons. | 17 // Manages the destruction of singletons. |
18 base::AtExitManager exit_manager; | 18 base::AtExitManager exit_manager; |
19 | 19 |
20 base::CommandLine::Init(0, NULL); | 20 base::CommandLine::Init(0, NULL); |
21 | 21 |
22 // Logging to stderr. | 22 // Logging to stderr. |
23 logging::LoggingSettings settings; | 23 logging::LoggingSettings settings; |
24 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 24 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
25 logging::InitLogging(settings); | 25 logging::InitLogging(settings); |
26 // Logging with pid, tid and timestamp. | 26 // Logging with pid, tid and timestamp. |
27 logging::SetLogItems(true, true, true, false); | 27 logging::SetLogItems(true, true, true, false); |
28 | 28 |
29 VLOG(1) << "session start. cmdline is [" << cmd_line << "]"; | 29 VLOG(1) << "session start. cmdline is [" << cmd_line << "]"; |
30 | 30 |
31 breakpad::CrashService crash_service; | 31 breakpad::CrashService crash_service; |
32 if (!crash_service.Initialize(base::FilePath(), base::FilePath())) | 32 if (!crash_service.Initialize(base::FilePath(), base::FilePath())) |
33 return 1; | 33 return 1; |
34 | 34 |
35 VLOG(1) << "ready to process crash requests"; | 35 VLOG(1) << "ready to process crash requests"; |
36 | 36 |
37 // Enter the message loop. | 37 // Enter the message loop. |
38 int retv = crash_service.ProcessingLoop(); | 38 int retv = crash_service.ProcessingLoop(); |
39 // Time to exit. | 39 // Time to exit. |
40 VLOG(1) << "session end. return code is " << retv; | 40 VLOG(1) << "session end. return code is " << retv; |
41 return retv; | 41 return retv; |
42 } | 42 } |
OLD | NEW |