Chromium Code Reviews| 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_crash_reporter_client.h" | 5 #include "chrome/app/chrome_crash_reporter_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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { | 314 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { |
| 315 base::FilePath crash_dumps_dir_path = | 315 base::FilePath crash_dumps_dir_path = |
| 316 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); | 316 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); |
| 317 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); | 317 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); |
| 318 } | 318 } |
| 319 | 319 |
| 320 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); | 320 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); |
| 321 } | 321 } |
| 322 | 322 |
| 323 size_t ChromeCrashReporterClient::RegisterCrashKeys() { | 323 size_t ChromeCrashReporterClient::RegisterCrashKeys() { |
| 324 // Note: This is not called on Windows because Breakpad is initialized in the | 324 // Note: On Windows this only affects the EXE. A separate invocation from |
| 325 // EXE module, but code that uses crash keys is in the DLL module. | 325 // child_process_logging_win.cc registers crash keys for Chrome.dll. |
| 326 // RegisterChromeCrashKeys() will be called after the DLL is loaded. | 326 // Also note that, on Windows, this is not called in a component build, as in |
| 327 // that case a single copy of 'base' is shared by the EXE and the various | |
| 328 // DLLs, and that copy is configured by child_process_logging_win.cc. | |
| 327 return crash_keys::RegisterChromeCrashKeys(); | 329 return crash_keys::RegisterChromeCrashKeys(); |
|
grt (UTC plus 2)
2015/03/17 02:59:31
for safety's sake, should this be
#if defined(COMP
erikwright (departed)
2015/03/17 14:40:03
I think a NOTREACHED is more appropriate?
The gua
| |
| 328 } | 330 } |
| 329 | 331 |
| 330 bool ChromeCrashReporterClient::IsRunningUnattended() { | 332 bool ChromeCrashReporterClient::IsRunningUnattended() { |
| 331 scoped_ptr<base::Environment> env(base::Environment::Create()); | 333 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 332 return env->HasVar(env_vars::kHeadless); | 334 return env->HasVar(env_vars::kHeadless); |
| 333 } | 335 } |
| 334 | 336 |
| 335 bool ChromeCrashReporterClient::GetCollectStatsConsent() { | 337 bool ChromeCrashReporterClient::GetCollectStatsConsent() { |
| 336 #if defined(GOOGLE_CHROME_BUILD) | 338 #if defined(GOOGLE_CHROME_BUILD) |
| 337 bool is_official_chrome_build = true; | 339 bool is_official_chrome_build = true; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 bool ChromeCrashReporterClient::EnableBreakpadForProcess( | 371 bool ChromeCrashReporterClient::EnableBreakpadForProcess( |
| 370 const std::string& process_type) { | 372 const std::string& process_type) { |
| 371 return process_type == switches::kRendererProcess || | 373 return process_type == switches::kRendererProcess || |
| 372 process_type == switches::kPluginProcess || | 374 process_type == switches::kPluginProcess || |
| 373 process_type == switches::kPpapiPluginProcess || | 375 process_type == switches::kPpapiPluginProcess || |
| 374 process_type == switches::kZygoteProcess || | 376 process_type == switches::kZygoteProcess || |
| 375 process_type == switches::kGpuProcess; | 377 process_type == switches::kGpuProcess; |
| 376 } | 378 } |
| 377 | 379 |
| 378 } // namespace chrome | 380 } // namespace chrome |
| OLD | NEW |