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 "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include "content/public/app/content_main.h" | 7 #include "content/public/app/content_main.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" |
11 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h" | |
12 | 11 |
13 #define DLLEXPORT __declspec(dllexport) | 12 #define DLLEXPORT __declspec(dllexport) |
14 | 13 |
15 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. | 14 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. |
16 extern "C" { | 15 extern "C" { |
17 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, | 16 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, |
18 sandbox::SandboxInterfaceInfo* sandbox_info); | 17 sandbox::SandboxInterfaceInfo* sandbox_info); |
19 } | 18 } |
20 #elif defined(OS_POSIX) | 19 #elif defined(OS_POSIX) |
21 extern "C" { | 20 extern "C" { |
(...skipping 10 matching lines...) Expand all Loading... |
32 #endif | 31 #endif |
33 ChromeMainDelegate chrome_main_delegate; | 32 ChromeMainDelegate chrome_main_delegate; |
34 content::ContentMainParams params(&chrome_main_delegate); | 33 content::ContentMainParams params(&chrome_main_delegate); |
35 | 34 |
36 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
37 // The process should crash when going through abnormal termination. | 36 // The process should crash when going through abnormal termination. |
38 base::win::SetShouldCrashOnProcessDetach(true); | 37 base::win::SetShouldCrashOnProcessDetach(true); |
39 base::win::SetAbortBehaviorForCrashReporting(); | 38 base::win::SetAbortBehaviorForCrashReporting(); |
40 params.instance = instance; | 39 params.instance = instance; |
41 params.sandbox_info = sandbox_info; | 40 params.sandbox_info = sandbox_info; |
42 | |
43 params.enable_termination_on_heap_corruption = | |
44 !ShouldExperimentallyDisableTerminateOnHeapCorruption(); | |
45 #else | 41 #else |
46 params.argc = argc; | 42 params.argc = argc; |
47 params.argv = argv; | 43 params.argv = argv; |
48 #endif | 44 #endif |
49 | 45 |
50 int rv = content::ContentMain(params); | 46 int rv = content::ContentMain(params); |
51 | 47 |
52 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
53 base::win::SetShouldCrashOnProcessDetach(false); | 49 base::win::SetShouldCrashOnProcessDetach(false); |
54 #endif | 50 #endif |
55 | 51 |
56 return rv; | 52 return rv; |
57 } | 53 } |
OLD | NEW |