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

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: Another comment tweak 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') | no next file with comments »
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..e9226b2c7f4cc313028b6ce1bef1e73d8db95424 100644
--- a/components/history/core/browser/thumbnail_database.cc
+++ b/components/history/core/browser/thumbnail_database.cc
@@ -256,14 +256,14 @@ void GenerateDiagnostics(sql::Connection* db,
// Corrupt cases currently dominate, report them very infrequently.
static const uint64 kCorruptReportsPerMillion = 10000;
- if (rand < kCorruptReportsPerMillion)
+ if (rand < kCorruptReportsPerMillion && db->RegisterIntentToUpload())
sky 2015/10/16 15:07:24 Naming is hard, but looking at this code it isn't
Scott Hess - ex-Googler 2015/10/16 15:27:43 Previously it was more like ShouldReportError(), b
ReportCorrupt(db, startup_kb);
} else if (error == SQLITE_READONLY) {
// SQLITE_READONLY appears similar to SQLITE_CORRUPT - once it
// is seen, it is almost guaranteed to be seen again.
reported = true;
- if (rand < kReportsPerMillion)
+ if (rand < kReportsPerMillion && db->RegisterIntentToUpload())
ReportError(db, extended_error);
} else {
// Only set the flag when making a report. This should allow
@@ -276,7 +276,8 @@ void GenerateDiagnostics(sql::Connection* db,
// channels, so probably easier to just harvest from the field.
if (rand < kReportsPerMillion) {
reported = true;
- ReportError(db, extended_error);
+ if (db->RegisterIntentToUpload())
+ ReportError(db, extended_error);
}
}
}
« no previous file with comments | « no previous file | sql/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698