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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { | 285 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { |
286 base::FilePath crash_dumps_dir_path = | 286 base::FilePath crash_dumps_dir_path = |
287 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); | 287 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); |
288 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); | 288 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); |
289 } | 289 } |
290 | 290 |
291 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); | 291 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); |
292 } | 292 } |
293 | 293 |
294 size_t ChromeCrashReporterClient::RegisterCrashKeys() { | 294 size_t ChromeCrashReporterClient::RegisterCrashKeys() { |
| 295 // Note: On Windows this only affects the EXE. A separate invocation from |
| 296 // child_process_logging_win.cc registers crash keys for Chrome.dll. |
| 297 #if defined(OS_WIN) && defined(COMPONENT_BUILD) |
| 298 // On Windows, this is not called in a component build, as in that case a |
| 299 // single copy of 'base' is shared by the EXE and the various DLLs, and that |
| 300 // copy is configured by child_process_logging_win.cc. |
| 301 NOTREACHED(); |
| 302 return 0; |
| 303 #else |
295 return crash_keys::RegisterChromeCrashKeys(); | 304 return crash_keys::RegisterChromeCrashKeys(); |
| 305 #endif |
296 } | 306 } |
297 | 307 |
298 bool ChromeCrashReporterClient::IsRunningUnattended() { | 308 bool ChromeCrashReporterClient::IsRunningUnattended() { |
299 scoped_ptr<base::Environment> env(base::Environment::Create()); | 309 scoped_ptr<base::Environment> env(base::Environment::Create()); |
300 return env->HasVar(env_vars::kHeadless); | 310 return env->HasVar(env_vars::kHeadless); |
301 } | 311 } |
302 | 312 |
303 bool ChromeCrashReporterClient::GetCollectStatsConsent() { | 313 bool ChromeCrashReporterClient::GetCollectStatsConsent() { |
304 #if defined(GOOGLE_CHROME_BUILD) | 314 #if defined(GOOGLE_CHROME_BUILD) |
305 bool is_official_chrome_build = true; | 315 bool is_official_chrome_build = true; |
(...skipping 29 matching lines...) Expand all Loading... |
335 #endif | 345 #endif |
336 | 346 |
337 bool ChromeCrashReporterClient::EnableBreakpadForProcess( | 347 bool ChromeCrashReporterClient::EnableBreakpadForProcess( |
338 const std::string& process_type) { | 348 const std::string& process_type) { |
339 return process_type == switches::kRendererProcess || | 349 return process_type == switches::kRendererProcess || |
340 process_type == switches::kPluginProcess || | 350 process_type == switches::kPluginProcess || |
341 process_type == switches::kPpapiPluginProcess || | 351 process_type == switches::kPpapiPluginProcess || |
342 process_type == switches::kZygoteProcess || | 352 process_type == switches::kZygoteProcess || |
343 process_type == switches::kGpuProcess; | 353 process_type == switches::kGpuProcess; |
344 } | 354 } |
OLD | NEW |