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_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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 // RegisterChromeCrashKeys() will be called after the DLL is loaded. | 327 // RegisterChromeCrashKeys() will be called after the DLL is loaded. |
| 328 return crash_keys::RegisterChromeCrashKeys(); | 328 return crash_keys::RegisterChromeCrashKeys(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool ChromeBreakpadClient::IsRunningUnattended() { | 331 bool ChromeBreakpadClient::IsRunningUnattended() { |
| 332 scoped_ptr<base::Environment> env(base::Environment::Create()); | 332 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 333 return env->HasVar(env_vars::kHeadless); | 333 return env->HasVar(env_vars::kHeadless); |
| 334 } | 334 } |
| 335 | 335 |
| 336 bool ChromeBreakpadClient::GetCollectStatsConsent() { | 336 bool ChromeBreakpadClient::GetCollectStatsConsent() { |
| 337 // Convert #define to a variable so that we can use if() rather than | 337 // Convert #define to a variable so that we can use if() rather than |
|
Mark Mentovai
2014/05/20 03:31:19
This comment is becoming kind of inaccurate, and i
Lei Zhang
2014/05/20 03:48:40
Done.
| |
| 338 // #if below and so at least compile-test the Chrome code in | 338 // #if below and so at least compile-test the Chrome code in |
| 339 // Chromium builds. | 339 // Chromium builds. |
| 340 #if defined(GOOGLE_CHROME_BUILD) | 340 #if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD) |
| 341 bool is_chrome_build = true; | 341 bool is_official_chrome_build = true; |
| 342 #else | 342 #else |
| 343 bool is_chrome_build = false; | 343 bool is_official_chrome_build = false; |
| 344 #endif | 344 #endif |
| 345 | 345 |
| 346 #if defined(OS_CHROMEOS) | 346 #if defined(OS_CHROMEOS) |
| 347 bool is_guest_session = CommandLine::ForCurrentProcess()->HasSwitch( | 347 bool is_guest_session = CommandLine::ForCurrentProcess()->HasSwitch( |
| 348 chromeos::switches::kGuestSession); | 348 chromeos::switches::kGuestSession); |
| 349 bool is_stable_channel = | 349 bool is_stable_channel = |
| 350 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE; | 350 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE; |
| 351 | 351 |
| 352 if (is_guest_session && is_stable_channel) | 352 if (is_guest_session && is_stable_channel) |
| 353 return false; | 353 return false; |
| 354 #endif // defined(OS_CHROMEOS) | 354 #endif // defined(OS_CHROMEOS) |
| 355 | 355 |
| 356 #if defined(OS_ANDROID) | 356 #if defined(OS_ANDROID) |
| 357 // TODO(jcivelli): we should not initialize the crash-reporter when it was not | 357 // TODO(jcivelli): we should not initialize the crash-reporter when it was not |
| 358 // enabled. Right now if it is disabled we still generate the minidumps but we | 358 // enabled. Right now if it is disabled we still generate the minidumps but we |
| 359 // do not upload them. | 359 // do not upload them. |
| 360 return is_chrome_build; | 360 return is_official_chrome_build; |
| 361 #else // !defined(OS_ANDROID) | 361 #else // !defined(OS_ANDROID) |
| 362 return is_chrome_build && GoogleUpdateSettings::GetCollectStatsConsent(); | 362 return is_official_chrome_build && |
| 363 GoogleUpdateSettings::GetCollectStatsConsent(); | |
| 363 #endif // defined(OS_ANDROID) | 364 #endif // defined(OS_ANDROID) |
| 364 } | 365 } |
| 365 | 366 |
| 366 #if defined(OS_ANDROID) | 367 #if defined(OS_ANDROID) |
| 367 int ChromeBreakpadClient::GetAndroidMinidumpDescriptor() { | 368 int ChromeBreakpadClient::GetAndroidMinidumpDescriptor() { |
| 368 return kAndroidMinidumpDescriptor; | 369 return kAndroidMinidumpDescriptor; |
| 369 } | 370 } |
| 370 #endif | 371 #endif |
| 371 | 372 |
| 372 bool ChromeBreakpadClient::EnableBreakpadForProcess( | 373 bool ChromeBreakpadClient::EnableBreakpadForProcess( |
| 373 const std::string& process_type) { | 374 const std::string& process_type) { |
| 374 return process_type == switches::kRendererProcess || | 375 return process_type == switches::kRendererProcess || |
| 375 process_type == switches::kPluginProcess || | 376 process_type == switches::kPluginProcess || |
| 376 process_type == switches::kPpapiPluginProcess || | 377 process_type == switches::kPpapiPluginProcess || |
| 377 process_type == switches::kZygoteProcess || | 378 process_type == switches::kZygoteProcess || |
| 378 process_type == switches::kGpuProcess; | 379 process_type == switches::kGpuProcess; |
| 379 } | 380 } |
| 380 | 381 |
| 381 } // namespace chrome | 382 } // namespace chrome |
| OLD | NEW |