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

Unified Diff: chrome/install_static/install_util.h

Issue 2221833005: Adding support for sampling crashes in Chrome on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scottmg's comments Created 4 years, 4 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
Index: chrome/install_static/install_util.h
diff --git a/chrome/install_static/install_util.h b/chrome/install_static/install_util.h
index be2a99d4751a49c8509b9b5559afe9b048bcb455..22db14a5fc062dfb2dc0a895bd3311962bd9d300 100644
--- a/chrome/install_static/install_util.h
+++ b/chrome/install_static/install_util.h
@@ -41,6 +41,14 @@ extern const wchar_t kAppGuidCanary[];
extern const wchar_t kAppGuidGoogleChrome[];
extern const wchar_t kAppGuidGoogleBinaries[];
+// Registry key to store the stats/crash sampling state of Chrome. If set to 1,
+// stats and crash reports will be uploaded in line with the user's consent,
+// otherwise, uploads will be dissabled. It is used to sample clients, to reduce
robertshield 2016/08/12 17:49:25 s/dissabled/disabled/
jwd 2016/08/12 20:04:31 Done.
+// server load for metics and crashes. This is controlled by the
+// MetricsReporting feature in chrome_metrics_services_manager_client.cc and is
+// written when metrics services are started up and when consent changes.
+extern const wchar_t kChromeStatsSampleKey[];
Alexei Svitkine (slow) 2016/08/12 17:47:48 Since this is no longer used outside of the .cc fi
robertshield 2016/08/12 17:49:25 What is the relationship between the value stored
jwd 2016/08/12 20:04:30 Done.
jwd 2016/08/12 20:04:31 kRegValueUsageStats is the source of consent descr
+
// TODO(ananta)
// https://crbug.com/604923
// Unify these constants with env_vars.h.
@@ -78,6 +86,14 @@ bool GetCollectStatsConsent();
// Only used by tests.
bool GetCollectStatsConsentForTesting(const std::wstring& exe_path);
+// Returns true if the current executable is currently in the chosen sample that
+// will report stats and crashes.
+bool GetCollectStatsInSample();
+
+// Sets the registry value used for checking if Chrome is in the chosen sample
+// that will report stats and crashes. Returns true if writing was successful.
+bool SetCollectStatsInSample(bool in_sample);
+
// Returns true if if usage stats reporting is controlled by a mandatory
// policy. |metrics_is_enforced_by_policy| will be set to true accordingly.
// TODO(ananta)

Powered by Google App Engine
This is Rietveld 408576698