Chromium Code Reviews| 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); |
| } |
| } |