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 "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/common/features.h" | 8 #include "chrome/common/features.h" |
9 #include "content/public/app/content_main.h" | 9 #include "content/public/app/content_main.h" |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 base::win::SetShouldCrashOnProcessDetach(true); | 55 base::win::SetShouldCrashOnProcessDetach(true); |
56 base::win::SetAbortBehaviorForCrashReporting(); | 56 base::win::SetAbortBehaviorForCrashReporting(); |
57 params.instance = instance; | 57 params.instance = instance; |
58 params.sandbox_info = sandbox_info; | 58 params.sandbox_info = sandbox_info; |
59 | 59 |
60 // SetDumpWithoutCrashingFunction must be passed the DumpProcess function | 60 // SetDumpWithoutCrashingFunction must be passed the DumpProcess function |
61 // from the EXE and not from the DLL in order for DumpWithoutCrashing to | 61 // from the EXE and not from the DLL in order for DumpWithoutCrashing to |
62 // function correctly. | 62 // function correctly. |
63 typedef void (__cdecl *DumpProcessFunction)(); | 63 typedef void (__cdecl *DumpProcessFunction)(); |
64 DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>( | 64 DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>( |
65 ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName), | 65 ::GetProcAddress(::GetModuleHandle(chrome::kChromeElfDllName), |
66 "DumpProcessWithoutCrash")); | 66 "DumpProcessWithoutCrash")); |
| 67 CHECK(DumpProcess); |
67 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); | 68 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); |
68 #else | 69 #else |
69 params.argc = argc; | 70 params.argc = argc; |
70 params.argv = argv; | 71 params.argv = argv; |
71 #endif | 72 #endif |
72 | 73 |
73 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 74 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
74 #if !defined(OS_WIN) | 75 #if !defined(OS_WIN) |
75 base::CommandLine::Init(params.argc, params.argv); | 76 base::CommandLine::Init(params.argc, params.argv); |
76 #endif | 77 #endif |
77 const base::CommandLine& command_line = | 78 const base::CommandLine& command_line = |
78 *base::CommandLine::ForCurrentProcess(); | 79 *base::CommandLine::ForCurrentProcess(); |
79 // TODO(sky): only do this for dev builds and if on canary channel. | 80 // TODO(sky): only do this for dev builds and if on canary channel. |
80 if (command_line.HasSwitch("mash")) | 81 if (command_line.HasSwitch("mash")) |
81 return MashMain(); | 82 return MashMain(); |
82 #endif | 83 #endif |
83 | 84 |
84 int rv = content::ContentMain(params); | 85 int rv = content::ContentMain(params); |
85 | 86 |
86 #if defined(OS_WIN) | 87 #if defined(OS_WIN) |
87 base::win::SetShouldCrashOnProcessDetach(false); | 88 base::win::SetShouldCrashOnProcessDetach(false); |
88 #endif | 89 #endif |
89 | 90 |
90 return rv; | 91 return rv; |
91 } | 92 } |
OLD | NEW |