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: On Windows this only affects the EXE. A separate invocation from | 324 // Note: This is not called on Windows because Breakpad is initialized in the |
325 // child_process_logging_win.cc registers crash keys for Chrome.dll. | 325 // EXE module, but code that uses crash keys is in the DLL module. |
326 #if defined(COMPONENT_BUILD) | 326 // RegisterChromeCrashKeys() will be called after the DLL is loaded. |
327 // On Windows, this is not called in a component build, as in that case a | |
328 // single copy of 'base' is shared by the EXE and the various DLLs, and that | |
329 // copy is configured by child_process_logging_win.cc. | |
330 NOTREACHED(); | |
331 return 0; | |
332 #else | |
333 return crash_keys::RegisterChromeCrashKeys(); | 327 return crash_keys::RegisterChromeCrashKeys(); |
334 #endif | |
335 } | 328 } |
336 | 329 |
337 bool ChromeCrashReporterClient::IsRunningUnattended() { | 330 bool ChromeCrashReporterClient::IsRunningUnattended() { |
338 scoped_ptr<base::Environment> env(base::Environment::Create()); | 331 scoped_ptr<base::Environment> env(base::Environment::Create()); |
339 return env->HasVar(env_vars::kHeadless); | 332 return env->HasVar(env_vars::kHeadless); |
340 } | 333 } |
341 | 334 |
342 bool ChromeCrashReporterClient::GetCollectStatsConsent() { | 335 bool ChromeCrashReporterClient::GetCollectStatsConsent() { |
343 #if defined(GOOGLE_CHROME_BUILD) | 336 #if defined(GOOGLE_CHROME_BUILD) |
344 bool is_official_chrome_build = true; | 337 bool is_official_chrome_build = true; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 bool ChromeCrashReporterClient::EnableBreakpadForProcess( | 369 bool ChromeCrashReporterClient::EnableBreakpadForProcess( |
377 const std::string& process_type) { | 370 const std::string& process_type) { |
378 return process_type == switches::kRendererProcess || | 371 return process_type == switches::kRendererProcess || |
379 process_type == switches::kPluginProcess || | 372 process_type == switches::kPluginProcess || |
380 process_type == switches::kPpapiPluginProcess || | 373 process_type == switches::kPpapiPluginProcess || |
381 process_type == switches::kZygoteProcess || | 374 process_type == switches::kZygoteProcess || |
382 process_type == switches::kGpuProcess; | 375 process_type == switches::kGpuProcess; |
383 } | 376 } |
384 | 377 |
385 } // namespace chrome | 378 } // namespace chrome |
OLD | NEW |