Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5430)

Unified Diff: chrome_elf/chrome_elf_main.cc

Issue 2279943002: Don't check for chrome.exe when initializing crash reporting (Closed)
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome_elf/elf_imports_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/chrome_elf_main.cc
diff --git a/chrome_elf/chrome_elf_main.cc b/chrome_elf/chrome_elf_main.cc
index e2b57aa56e34d6d911d29d8b1d9dea359507900c..c85d666058ed8c5faa67fabda1000ebb838a9e60 100644
--- a/chrome_elf/chrome_elf_main.cc
+++ b/chrome_elf/chrome_elf_main.cc
@@ -24,31 +24,6 @@ namespace {
base::LazyInstance<std::vector<crash_reporter::Report>>::Leaky g_crash_reports =
LAZY_INSTANCE_INITIALIZER;
-// Gets the exe name from the full path of the exe.
-base::string16 GetExeName() {
- wchar_t file_path[MAX_PATH] = {};
- if (!::GetModuleFileName(nullptr, file_path, arraysize(file_path))) {
- assert(false);
- return base::string16();
- }
- base::string16 file_name_string = file_path;
- size_t last_slash_pos = file_name_string.find_last_of(L'\\');
- if (last_slash_pos != base::string16::npos) {
- file_name_string = file_name_string.substr(
- last_slash_pos + 1, file_name_string.length() - last_slash_pos);
- }
- std::transform(file_name_string.begin(), file_name_string.end(),
- file_name_string.begin(), ::tolower);
- return file_name_string;
-}
-
-void InitializeCrashReportingForProcess() {
- // We want to initialize crash reporting only in chrome.exe
- if (GetExeName() != L"chrome.exe")
- return;
- ChromeCrashReporterClient::InitializeCrashReportingForProcess();
-}
-
#if !defined(ADDRESS_SANITIZER)
// chrome_elf loads early in the process and initializes Crashpad. That in turn
// uses the SetUnhandledExceptionFilter API to set a top level exception
@@ -110,7 +85,7 @@ extern "C" __declspec(dllexport) void SetMetricsClientId(
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
if (reason == DLL_PROCESS_ATTACH) {
- InitializeCrashReportingForProcess();
+ ChromeCrashReporterClient::InitializeCrashReportingForProcess();
// CRT on initialization installs an exception filter which calls
// TerminateProcess. We need to hook CRT's attempt to set an exception
// handler and ignore it. Don't do this when ASan is present, or ASan will
« no previous file with comments | « no previous file | chrome_elf/elf_imports_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698