Fix crash database size calculation

This commit is contained in:
Marshall Greenblatt
2017-12-05 16:59:25 -05:00
parent 18a939d16b
commit 6adf85553e

View File

@ -1,8 +1,8 @@
diff --git third_party/crashpad/crashpad/client/prune_crash_reports.cc third_party/crashpad/crashpad/client/prune_crash_reports.cc diff --git third_party/crashpad/crashpad/client/prune_crash_reports.cc third_party/crashpad/crashpad/client/prune_crash_reports.cc
index 3aaaeee5d07f..d99fcb418d9e 100644 index 3aaaeee5d07f..9d2e7bcbd621 100644
--- third_party/crashpad/crashpad/client/prune_crash_reports.cc --- third_party/crashpad/crashpad/client/prune_crash_reports.cc
+++ third_party/crashpad/crashpad/client/prune_crash_reports.cc +++ third_party/crashpad/crashpad/client/prune_crash_reports.cc
@@ -67,13 +67,19 @@ void PruneCrashReportDatabase(CrashReportDatabase* database, @@ -67,13 +67,20 @@ void PruneCrashReportDatabase(CrashReportDatabase* database,
} }
// static // static
@ -17,10 +17,12 @@ index 3aaaeee5d07f..d99fcb418d9e 100644
+ if (max_age_in_days <= 0) + if (max_age_in_days <= 0)
+ max_age_in_days = 365; + max_age_in_days = 365;
return base::WrapUnique( return base::WrapUnique(
new BinaryPruneCondition(BinaryPruneCondition::OR, - new BinaryPruneCondition(BinaryPruneCondition::OR,
- new DatabaseSizePruneCondition(1024 * 128), - new DatabaseSizePruneCondition(1024 * 128),
- new AgePruneCondition(365))); - new AgePruneCondition(365)));
+ new DatabaseSizePruneCondition(max_size_in_mb), + new BinaryPruneCondition(
+ BinaryPruneCondition::OR,
+ new DatabaseSizePruneCondition(1024 * max_size_in_mb),
+ new AgePruneCondition(max_age_in_days))); + new AgePruneCondition(max_age_in_days)));
} }