| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/crash/content/app/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Allow the crash server to be overridden for testing. If the variable | 87 // Allow the crash server to be overridden for testing. If the variable |
| 88 // isn't present in the environment then the default URL will remain. | 88 // isn't present in the environment then the default URL will remain. |
| 89 env->GetVar(kServerUrlVar, &url); | 89 env->GetVar(kServerUrlVar, &url); |
| 90 | 90 |
| 91 wchar_t exe_file_path[MAX_PATH] = {}; | 91 wchar_t exe_file_path[MAX_PATH] = {}; |
| 92 CHECK( | 92 CHECK( |
| 93 ::GetModuleFileName(nullptr, exe_file_path, arraysize(exe_file_path))); | 93 ::GetModuleFileName(nullptr, exe_file_path, arraysize(exe_file_path))); |
| 94 | 94 |
| 95 base::FilePath exe_file(exe_file_path); | 95 base::FilePath exe_file(exe_file_path); |
| 96 | 96 |
| 97 bool is_per_user_install = | 97 if (crash_reporter_client->GetShouldDumpLargerDumps()) { |
| 98 crash_reporter_client->GetIsPerUserInstall(exe_file.value()); | |
| 99 if (crash_reporter_client->GetShouldDumpLargerDumps(is_per_user_install)) { | |
| 100 const uint32_t kIndirectMemoryLimit = 4 * 1024 * 1024; | 98 const uint32_t kIndirectMemoryLimit = 4 * 1024 * 1024; |
| 101 crashpad::CrashpadInfo::GetCrashpadInfo() | 99 crashpad::CrashpadInfo::GetCrashpadInfo() |
| 102 ->set_gather_indirectly_referenced_memory( | 100 ->set_gather_indirectly_referenced_memory( |
| 103 crashpad::TriState::kEnabled, kIndirectMemoryLimit); | 101 crashpad::TriState::kEnabled, kIndirectMemoryLimit); |
| 104 } | 102 } |
| 105 | 103 |
| 106 // If the handler is embedded in the binary (e.g. chrome, setup), we | 104 // If the handler is embedded in the binary (e.g. chrome, setup), we |
| 107 // reinvoke it with --type=crashpad-handler. Otherwise, we use the | 105 // reinvoke it with --type=crashpad-handler. Otherwise, we use the |
| 108 // standalone crashpad_handler.exe (for tests, etc.). | 106 // standalone crashpad_handler.exe (for tests, etc.). |
| 109 std::vector<std::string> arguments; | 107 std::vector<std::string> arguments; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( | 357 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( |
| 360 void* start) { | 358 void* start) { |
| 361 ExceptionHandlerRecord* record = | 359 ExceptionHandlerRecord* record = |
| 362 reinterpret_cast<ExceptionHandlerRecord*>(start); | 360 reinterpret_cast<ExceptionHandlerRecord*>(start); |
| 363 | 361 |
| 364 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 362 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
| 365 } | 363 } |
| 366 #endif // ARCH_CPU_X86_64 | 364 #endif // ARCH_CPU_X86_64 |
| 367 | 365 |
| 368 } // extern "C" | 366 } // extern "C" |
| OLD | NEW |