OLD | NEW |
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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/app/chrome_breakpad_client.h" | 8 #include "chrome/app/chrome_breakpad_client.h" |
9 #include "components/breakpad/app/breakpad_win.h" | 9 #include "components/breakpad/app/breakpad_win.h" |
10 #include "components/nacl/loader/nacl_helper_win_64.h" | 10 #include "components/nacl/loader/nacl_helper_win_64.h" |
11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky | 15 base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky |
16 g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER; | 16 g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER; |
17 | 17 |
18 } // namespace | 18 } // namespace |
19 | 19 |
20 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { | 20 #if !defined(FORCE_CONSOLE_SUBSYSTEM) |
| 21 int APIENTRY wWinMain(HINSTANCE, HINSTANCE, wchar_t*, int) { |
| 22 #else |
| 23 int main() { |
| 24 #endif |
21 base::AtExitManager exit_manager; | 25 base::AtExitManager exit_manager; |
22 CommandLine::Init(0, NULL); | 26 CommandLine::Init(0, NULL); |
23 | 27 |
24 std::string process_type = | 28 std::string process_type = |
25 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 29 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
26 switches::kProcessType); | 30 switches::kProcessType); |
27 breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer()); | 31 breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer()); |
28 breakpad::InitCrashReporter(process_type); | 32 breakpad::InitCrashReporter(process_type); |
29 | 33 |
30 return nacl::NaClWin64Main(); | 34 return nacl::NaClWin64Main(); |
31 } | 35 } |
OLD | NEW |