add-flag-to-disable-local-history-expiration.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. # Keep local history longer than 90 days
  2. --- a/chrome/browser/ungoogled_flag_entries.h
  3. +++ b/chrome/browser/ungoogled_flag_entries.h
  4. @@ -52,4 +52,8 @@
  5. "Popups to tabs",
  6. "Makes popups open in new tabs. ungoogled-chromium flag",
  7. kOsAll, SINGLE_VALUE_TYPE("popups-to-tabs")},
  8. + {"keep-old-history",
  9. + "Keep old history",
  10. + "Keep history older than 3 months. ungoogled-chromium flag",
  11. + kOsAll, SINGLE_VALUE_TYPE("keep-old-history")},
  12. #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
  13. --- a/components/history/core/browser/history_backend.cc
  14. +++ b/components/history/core/browser/history_backend.cc
  15. @@ -14,6 +14,7 @@
  16. #include <utility>
  17. #include <vector>
  18. +#include "base/command_line.h"
  19. #include "base/compiler_specific.h"
  20. #include "base/containers/flat_set.h"
  21. #include "base/feature_list.h"
  22. @@ -1187,7 +1188,8 @@ void HistoryBackend::InitImpl(
  23. db_->GetStartDate(&first_recorded_time_);
  24. // Start expiring old stuff.
  25. - expirer_.StartExpiringOldStuff(base::Days(kExpireDaysThreshold));
  26. + if (!base::CommandLine::ForCurrentProcess()->HasSwitch("keep-old-history"))
  27. + expirer_.StartExpiringOldStuff(base::Days(kExpireDaysThreshold));
  28. LOCAL_HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time);
  29. }