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 "chrome_elf/chrome_elf_main.h" | 5 #include "chrome_elf/chrome_elf_main.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/win/iat_patch_function.h" | 12 #include "base/win/iat_patch_function.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/app/chrome_crash_reporter_client_win.h" | 14 #include "chrome/app/chrome_crash_reporter_client_win.h" |
15 #include "chrome/install_static/install_util.h" | 15 #include "chrome/install_static/install_util.h" |
16 #include "chrome_elf/blacklist/blacklist.h" | 16 #include "chrome_elf/blacklist/blacklist.h" |
17 #include "chrome_elf/blacklist/crashpad_helper.h" | 17 #include "chrome_elf/blacklist/crashpad_helper.h" |
18 #include "chrome_elf/chrome_elf_constants.h" | 18 #include "chrome_elf/chrome_elf_constants.h" |
19 #include "chrome_elf/chrome_elf_security.h" | |
20 #include "components/crash/content/app/crashpad.h" | 19 #include "components/crash/content/app/crashpad.h" |
21 #include "components/crash/core/common/crash_keys.h" | 20 #include "components/crash/core/common/crash_keys.h" |
22 | 21 |
23 namespace { | 22 namespace { |
24 | 23 |
25 base::LazyInstance<std::vector<crash_reporter::Report>>::Leaky g_crash_reports = | 24 base::LazyInstance<std::vector<crash_reporter::Report>>::Leaky g_crash_reports = |
26 LAZY_INSTANCE_INITIALIZER; | 25 LAZY_INSTANCE_INITIALIZER; |
27 | 26 |
28 // Gets the exe name from the full path of the exe. | 27 // Gets the exe name from the full path of the exe. |
29 base::string16 GetExeName() { | 28 base::string16 GetExeName() { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 108 |
110 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { | 109 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { |
111 if (reason == DLL_PROCESS_ATTACH) { | 110 if (reason == DLL_PROCESS_ATTACH) { |
112 InitializeCrashReportingForProcess(); | 111 InitializeCrashReportingForProcess(); |
113 // CRT on initialization installs an exception filter which calls | 112 // CRT on initialization installs an exception filter which calls |
114 // TerminateProcess. We need to hook CRT's attempt to set an exception | 113 // TerminateProcess. We need to hook CRT's attempt to set an exception |
115 // handler and ignore it. | 114 // handler and ignore it. |
116 DisableSetUnhandledExceptionFilter(); | 115 DisableSetUnhandledExceptionFilter(); |
117 | 116 |
118 install_static::InitializeProcessType(); | 117 install_static::InitializeProcessType(); |
119 if (install_static::g_process_type == | |
120 install_static::ProcessType::BROWSER_PROCESS) | |
121 EarlyBrowserSecurity(); | |
122 | 118 |
123 __try { | 119 __try { |
124 blacklist::Initialize(false); // Don't force, abort if beacon is present. | 120 blacklist::Initialize(false); // Don't force, abort if beacon is present. |
125 } __except(GenerateCrashDump(GetExceptionInformation())) { | 121 } __except(GenerateCrashDump(GetExceptionInformation())) { |
126 } | 122 } |
127 } | 123 } |
128 return TRUE; | 124 return TRUE; |
129 } | 125 } |
OLD | NEW |