Skip to content

Commit

Permalink
For Chrome builds, only upload crashes when the build is official.
Browse files Browse the repository at this point in the history
BUG=362783

Review URL: https://codereview.chromium.org/292933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271840 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed May 21, 2014
1 parent 7b4bff5 commit 69ca752
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
14 changes: 6 additions & 8 deletions chrome/app/chrome_breakpad_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,10 @@ bool ChromeBreakpadClient::IsRunningUnattended() {
}

bool ChromeBreakpadClient::GetCollectStatsConsent() {
// Convert #define to a variable so that we can use if() rather than
// #if below and so at least compile-test the Chrome code in
// Chromium builds.
#if defined(GOOGLE_CHROME_BUILD)
bool is_chrome_build = true;
#if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
bool is_official_chrome_build = true;
#else
bool is_chrome_build = false;
bool is_official_chrome_build = false;
#endif

#if defined(OS_CHROMEOS)
Expand All @@ -354,9 +351,10 @@ bool ChromeBreakpadClient::GetCollectStatsConsent() {
// TODO(jcivelli): we should not initialize the crash-reporter when it was not
// enabled. Right now if it is disabled we still generate the minidumps but we
// do not upload them.
return is_chrome_build;
return is_official_chrome_build;
#else // !defined(OS_ANDROID)
return is_chrome_build && GoogleUpdateSettings::GetCollectStatsConsent();
return is_official_chrome_build &&
GoogleUpdateSettings::GetCollectStatsConsent();
#endif // defined(OS_ANDROID)
}

Expand Down
16 changes: 7 additions & 9 deletions chrome_elf/breakpad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int GenerateCrashDump(EXCEPTION_POINTERS* exinfo) {

void InitializeCrashReporting() {
wchar_t exe_path[MAX_PATH] = {};
if(!::GetModuleFileName(NULL, exe_path, arraysize(exe_path)))
if (!::GetModuleFileName(NULL, exe_path, arraysize(exe_path)))
return;

// Disable the message box for assertions.
Expand All @@ -123,13 +123,10 @@ void InitializeCrashReporting() {
MiniDumpWithIndirectlyReferencedMemory); // Get memory referenced by
// stack.

// Convert #define to a variable so that we can use if() rather than
// #if below and so at least compile-test the Chrome code in
// Chromium builds.
#if defined(GOOGLE_CHROME_BUILD)
bool is_chrome_build = true;
#if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
bool is_official_chrome_build = true;
#else
bool is_chrome_build = false;
bool is_official_chrome_build = false;
#endif

base::string16 pipe_name;
Expand All @@ -139,8 +136,9 @@ void InitializeCrashReporting() {

if (!use_policy && IsHeadless()) {
pipe_name = kChromePipeName;
} else if (use_policy ? enabled_by_policy :
(is_chrome_build && AreUsageStatsEnabled(exe_path))) {
} else if (use_policy ?
enabled_by_policy :
(is_official_chrome_build && AreUsageStatsEnabled(exe_path))) {
// Build the pipe name. It can be one of:
// 32-bit system: \\.\pipe\GoogleCrashServices\S-1-5-18
// 32-bit user: \\.\pipe\GoogleCrashServices\<user SID>
Expand Down

0 comments on commit 69ca752

Please sign in to comment.