Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3057)

Unified Diff: chrome/installer/setup/installer_crash_reporter_client.cc

Issue 2422103004: Adding sampling support to installer crash reporter client. (Closed)
Patch Set: braces Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/installer_crash_reporter_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/installer_crash_reporter_client.cc
diff --git a/chrome/installer/setup/installer_crash_reporter_client.cc b/chrome/installer/setup/installer_crash_reporter_client.cc
index 3d9cd9a5266834244234bf09094a31316ab64d10..2bbe994b96a968e4910f48eb53199cf0a51ecdce 100644
--- a/chrome/installer/setup/installer_crash_reporter_client.cc
+++ b/chrome/installer/setup/installer_crash_reporter_client.cc
@@ -14,7 +14,9 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_version.h"
#include "chrome/common/env_vars.h"
+#include "chrome/install_static/install_util.h"
#include "chrome/installer/setup/installer_crash_reporting.h"
+#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/google_update_settings.h"
InstallerCrashReporterClient::InstallerCrashReporterClient(
@@ -123,6 +125,21 @@ bool InstallerCrashReporterClient::GetCollectStatsConsent() {
#endif
}
+bool InstallerCrashReporterClient::GetCollectStatsInSample() {
+ // TODO(grt): remove duplication of code.
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ base::win::RegKey key(HKEY_CURRENT_USER, dist->GetRegistryPath().c_str(),
+ KEY_QUERY_VALUE | KEY_WOW64_32KEY);
+ if (!key.Valid())
+ return true;
+ DWORD out_value = 0;
+ if (key.ReadValueDW(install_static::kRegValueChromeStatsSample, &out_value) !=
+ ERROR_SUCCESS) {
+ return true;
+ }
+ return out_value == 1;
+}
+
bool InstallerCrashReporterClient::ReportingIsEnforcedByPolicy(bool* enabled) {
// From the generated policy/policy/policy_constants.cc:
#if defined(GOOGLE_CHROME_BUILD)
« no previous file with comments | « chrome/installer/setup/installer_crash_reporter_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698