Commit 69ca7520 authored by thestig@chromium.org's avatar thestig@chromium.org

For Chrome builds, only upload crashes when the build is official.

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
parent 7b4bff53
...@@ -331,13 +331,10 @@ bool ChromeBreakpadClient::IsRunningUnattended() { ...@@ -331,13 +331,10 @@ bool ChromeBreakpadClient::IsRunningUnattended() {
} }
bool ChromeBreakpadClient::GetCollectStatsConsent() { bool ChromeBreakpadClient::GetCollectStatsConsent() {
// Convert #define to a variable so that we can use if() rather than #if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
// #if below and so at least compile-test the Chrome code in bool is_official_chrome_build = true;
// Chromium builds.
#if defined(GOOGLE_CHROME_BUILD)
bool is_chrome_build = true;
#else #else
bool is_chrome_build = false; bool is_official_chrome_build = false;
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
...@@ -354,9 +351,10 @@ bool ChromeBreakpadClient::GetCollectStatsConsent() { ...@@ -354,9 +351,10 @@ bool ChromeBreakpadClient::GetCollectStatsConsent() {
// TODO(jcivelli): we should not initialize the crash-reporter when it was not // 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 // enabled. Right now if it is disabled we still generate the minidumps but we
// do not upload them. // do not upload them.
return is_chrome_build; return is_official_chrome_build;
#else // !defined(OS_ANDROID) #else // !defined(OS_ANDROID)
return is_chrome_build && GoogleUpdateSettings::GetCollectStatsConsent(); return is_official_chrome_build &&
GoogleUpdateSettings::GetCollectStatsConsent();
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
} }
......
...@@ -102,7 +102,7 @@ int GenerateCrashDump(EXCEPTION_POINTERS* exinfo) { ...@@ -102,7 +102,7 @@ int GenerateCrashDump(EXCEPTION_POINTERS* exinfo) {
void InitializeCrashReporting() { void InitializeCrashReporting() {
wchar_t exe_path[MAX_PATH] = {}; wchar_t exe_path[MAX_PATH] = {};
if(!::GetModuleFileName(NULL, exe_path, arraysize(exe_path))) if (!::GetModuleFileName(NULL, exe_path, arraysize(exe_path)))
return; return;
// Disable the message box for assertions. // Disable the message box for assertions.
...@@ -123,13 +123,10 @@ void InitializeCrashReporting() { ...@@ -123,13 +123,10 @@ void InitializeCrashReporting() {
MiniDumpWithIndirectlyReferencedMemory); // Get memory referenced by MiniDumpWithIndirectlyReferencedMemory); // Get memory referenced by
// stack. // stack.
// Convert #define to a variable so that we can use if() rather than #if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
// #if below and so at least compile-test the Chrome code in bool is_official_chrome_build = true;
// Chromium builds.
#if defined(GOOGLE_CHROME_BUILD)
bool is_chrome_build = true;
#else #else
bool is_chrome_build = false; bool is_official_chrome_build = false;
#endif #endif
base::string16 pipe_name; base::string16 pipe_name;
...@@ -139,8 +136,9 @@ void InitializeCrashReporting() { ...@@ -139,8 +136,9 @@ void InitializeCrashReporting() {
if (!use_policy && IsHeadless()) { if (!use_policy && IsHeadless()) {
pipe_name = kChromePipeName; pipe_name = kChromePipeName;
} else if (use_policy ? enabled_by_policy : } else if (use_policy ?
(is_chrome_build && AreUsageStatsEnabled(exe_path))) { enabled_by_policy :
(is_official_chrome_build && AreUsageStatsEnabled(exe_path))) {
// Build the pipe name. It can be one of: // Build the pipe name. It can be one of:
// 32-bit system: \\.\pipe\GoogleCrashServices\S-1-5-18 // 32-bit system: \\.\pipe\GoogleCrashServices\S-1-5-18
// 32-bit user: \\.\pipe\GoogleCrashServices\<user SID> // 32-bit user: \\.\pipe\GoogleCrashServices\<user SID>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment