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

Unified Diff: components/crash/content/app/crashpad.cc

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: components/crash/content/app/crashpad.cc
diff --git a/components/crash/content/app/crashpad.cc b/components/crash/content/app/crashpad.cc
index 85afe46af675145d2b1251ea5a3b9e5989123eb2..37aeb4c5403700f1c513831f5d772b9ca1fbb90e 100644
--- a/components/crash/content/app/crashpad.cc
+++ b/components/crash/content/app/crashpad.cc
@@ -295,7 +295,8 @@ void InitializeCrashpadWithEmbeddedHandler(bool initial_client,
void SetUploadsEnabled(bool enable_uploads) {
if (g_database) {
crashpad::Settings* settings = g_database->GetSettings();
- settings->SetUploadsEnabled(enable_uploads);
+ settings->SetUploadsEnabled(
+ enable_uploads && GetCrashReporterClient()->GetCollectStatsInSample());
robertshield 2016/08/12 17:49:25 The logic for whether uploads are enabled or not i
jwd 2016/08/12 20:04:31 I don't disagree. But, keeping SetUploadsEnabled a
Mark Mentovai 2016/08/12 20:16:27 The intent is to do this on Windows too. https://c
robertshield 2016/08/12 21:04:43 If this method is to contain logic that can cause
Mark Mentovai 2016/08/12 22:01:57 Changing the name to something more suitable is fi
}
}
@@ -460,6 +461,14 @@ void ReadMainModuleAnnotationsForKasko(
extern "C" {
+// This function is used in chrome_metrics_services_manager_client.cc to trigger
+// changes to the upload-enabled state. This is done when the metrics services
+// are initialized, and when the user changes their consent for uploads. See
+// crash_reporter::SetUploadsEnabled for effects.
+void __declspec(dllexport) __cdecl SetUploadsEnabledImpl(bool enable_uploads) {
+ crash_reporter::SetUploadsEnabled(enable_uploads);
Alexei Svitkine (slow) 2016/08/12 17:47:48 So this will be called as a result of UpdateRunnin
jwd 2016/08/12 20:04:31 Yes, you're right. This is already the case, since
+}
+
// NOTE: This function is used by SyzyASAN to annotate crash reports. If you
// change the name or signature of this function you will break SyzyASAN
// instrumented releases of Chrome. Please contact syzygy-team@chromium.org

Powered by Google App Engine
This is Rietveld 408576698