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/app/chrome_breakpad_client.h" | 5 #include "chrome/app/chrome_breakpad_client.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/installer/util/install_util.h" | 31 #include "chrome/installer/util/install_util.h" |
32 #include "policy/policy_constants.h" | 32 #include "policy/policy_constants.h" |
33 #endif | 33 #endif |
34 | 34 |
35 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) | 35 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) |
36 #include "chrome/browser/crash_upload_list.h" | 36 #include "chrome/browser/crash_upload_list.h" |
37 #include "chrome/common/chrome_version_info_posix.h" | 37 #include "chrome/common/chrome_version_info_posix.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_POSIX) | 40 #if defined(OS_POSIX) |
41 #include "chrome/common/dump_without_crashing.h" | 41 #include "base/debug/dump_without_crashing.h" |
42 #endif | 42 #endif |
43 | 43 |
44 #if defined(OS_ANDROID) | 44 #if defined(OS_ANDROID) |
45 #include "chrome/common/descriptors_android.h" | 45 #include "chrome/common/descriptors_android.h" |
46 #endif | 46 #endif |
47 | 47 |
48 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
49 #include "chrome/common/chrome_version_info.h" | 49 #include "chrome/common/chrome_version_info.h" |
50 #include "chromeos/chromeos_switches.h" | 50 #include "chromeos/chromeos_switches.h" |
51 #endif | 51 #endif |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 std::string alternate_crash_dump_location; | 319 std::string alternate_crash_dump_location; |
320 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { | 320 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { |
321 base::FilePath crash_dumps_dir_path = | 321 base::FilePath crash_dumps_dir_path = |
322 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); | 322 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); |
323 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); | 323 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); |
324 } | 324 } |
325 | 325 |
326 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); | 326 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); |
327 } | 327 } |
328 | 328 |
329 #if defined(OS_POSIX) | |
330 void ChromeBreakpadClient::SetDumpWithoutCrashingFunction(void (*function)()) { | |
331 logging::SetDumpWithoutCrashingFunction(function); | |
332 } | |
333 #endif | |
334 | |
335 size_t ChromeBreakpadClient::RegisterCrashKeys() { | 329 size_t ChromeBreakpadClient::RegisterCrashKeys() { |
336 // Note: This is not called on Windows because Breakpad is initialized in the | 330 // Note: This is not called on Windows because Breakpad is initialized in the |
337 // EXE module, but code that uses crash keys is in the DLL module. | 331 // EXE module, but code that uses crash keys is in the DLL module. |
338 // RegisterChromeCrashKeys() will be called after the DLL is loaded. | 332 // RegisterChromeCrashKeys() will be called after the DLL is loaded. |
339 return crash_keys::RegisterChromeCrashKeys(); | 333 return crash_keys::RegisterChromeCrashKeys(); |
340 } | 334 } |
341 | 335 |
342 bool ChromeBreakpadClient::IsRunningUnattended() { | 336 bool ChromeBreakpadClient::IsRunningUnattended() { |
343 scoped_ptr<base::Environment> env(base::Environment::Create()); | 337 scoped_ptr<base::Environment> env(base::Environment::Create()); |
344 return env->HasVar(env_vars::kHeadless); | 338 return env->HasVar(env_vars::kHeadless); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 bool ChromeBreakpadClient::EnableBreakpadForProcess( | 377 bool ChromeBreakpadClient::EnableBreakpadForProcess( |
384 const std::string& process_type) { | 378 const std::string& process_type) { |
385 return process_type == switches::kRendererProcess || | 379 return process_type == switches::kRendererProcess || |
386 process_type == switches::kPluginProcess || | 380 process_type == switches::kPluginProcess || |
387 process_type == switches::kPpapiPluginProcess || | 381 process_type == switches::kPpapiPluginProcess || |
388 process_type == switches::kZygoteProcess || | 382 process_type == switches::kZygoteProcess || |
389 process_type == switches::kGpuProcess; | 383 process_type == switches::kGpuProcess; |
390 } | 384 } |
391 | 385 |
392 } // namespace chrome | 386 } // namespace chrome |
OLD | NEW |