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

Unified Diff: components/history/core/browser/thumbnail_database.cc

Issue 1393393007: [sql] Track uploads of diagnostic data to prevent duplication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing FILE_PATH_LITERAL Created 5 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 | « no previous file | sql/connection.h » ('j') | sql/connection.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/thumbnail_database.cc
diff --git a/components/history/core/browser/thumbnail_database.cc b/components/history/core/browser/thumbnail_database.cc
index 35afa12319fc9a021b6c7c3d7dfd30971e35cf5f..730e0695d2a56edcb333c933b3c01a169d333fc9 100644
--- a/components/history/core/browser/thumbnail_database.cc
+++ b/components/history/core/browser/thumbnail_database.cc
@@ -254,6 +254,9 @@ void GenerateDiagnostics(sql::Connection* db,
// Set first in case of errors in generating the report.
reported = true;
+ if (!db->ShouldUploadDiagnosticDump())
+ return;
pkotwicz 2015/10/15 18:02:29 Nit - I think that this is slightly clearer: if (
Scott Hess - ex-Googler 2015/10/15 21:12:20 OK, I pulled all of these to just before the Repor
+
// Corrupt cases currently dominate, report them very infrequently.
static const uint64 kCorruptReportsPerMillion = 10000;
if (rand < kCorruptReportsPerMillion)
@@ -263,6 +266,9 @@ void GenerateDiagnostics(sql::Connection* db,
// is seen, it is almost guaranteed to be seen again.
reported = true;
+ if (!db->ShouldUploadDiagnosticDump())
+ return;
+
if (rand < kReportsPerMillion)
ReportError(db, extended_error);
} else {
@@ -276,6 +282,8 @@ void GenerateDiagnostics(sql::Connection* db,
// channels, so probably easier to just harvest from the field.
if (rand < kReportsPerMillion) {
reported = true;
+ if (!db->ShouldUploadDiagnosticDump())
+ return;
ReportError(db, extended_error);
}
}
« no previous file with comments | « no previous file | sql/connection.h » ('j') | sql/connection.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698