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::kChromeElfDllName), | 65 ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName), |
66 "DumpProcessWithoutCrash")); | 66 "DumpProcessWithoutCrash")); |
67 CHECK(DumpProcess); | |
68 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); | 67 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); |
69 #else | 68 #else |
70 params.argc = argc; | 69 params.argc = argc; |
71 params.argv = argv; | 70 params.argv = argv; |
72 #endif | 71 #endif |
73 | 72 |
74 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 73 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
75 #if !defined(OS_WIN) | 74 #if !defined(OS_WIN) |
76 base::CommandLine::Init(params.argc, params.argv); | 75 base::CommandLine::Init(params.argc, params.argv); |
77 #endif | 76 #endif |
78 const base::CommandLine& command_line = | 77 const base::CommandLine& command_line = |
79 *base::CommandLine::ForCurrentProcess(); | 78 *base::CommandLine::ForCurrentProcess(); |
80 // TODO(sky): only do this for dev builds and if on canary channel. | 79 // TODO(sky): only do this for dev builds and if on canary channel. |
81 if (command_line.HasSwitch("mash")) | 80 if (command_line.HasSwitch("mash")) |
82 return MashMain(); | 81 return MashMain(); |
83 #endif | 82 #endif |
84 | 83 |
85 int rv = content::ContentMain(params); | 84 int rv = content::ContentMain(params); |
86 | 85 |
87 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
88 base::win::SetShouldCrashOnProcessDetach(false); | 87 base::win::SetShouldCrashOnProcessDetach(false); |
89 #endif | 88 #endif |
90 | 89 |
91 return rv; | 90 return rv; |
92 } | 91 } |
OLD | NEW |