diff options
Diffstat (limited to 'chrome/browser/history/history_database.cc')
-rw-r--r-- | chrome/browser/history/history_database.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/history/history_database.cc b/chrome/browser/history/history_database.cc index 7b198fc..5a929b1 100644 --- a/chrome/browser/history/history_database.cc +++ b/chrome/browser/history/history_database.cc @@ -10,6 +10,8 @@ #include "base/string_util.h" #include "chrome/common/sqlite_utils.h" +using base::Time; + namespace history { namespace { @@ -17,6 +19,7 @@ namespace { // Current version number. static const int kCurrentVersionNumber = 16; static const int kCompatibleVersionNumber = 16; +static const char kEarlyExpirationThresholdKey[] = "early_expiration_threshold"; } // namespace @@ -171,6 +174,27 @@ SegmentID HistoryDatabase::GetSegmentID(VisitID visit_id) { return 0; } +Time HistoryDatabase::GetEarlyExpirationThreshold() { + if (!cached_early_expiration_threshold_.is_null()) + return cached_early_expiration_threshold_; + + int64 threshold; + if (!meta_table_.GetValue(kEarlyExpirationThresholdKey, &threshold)) { + // Set to a very early non-zero time, so it's before all history, but not + // zero to avoid re-retrieval. + threshold = 1L; + } + + cached_early_expiration_threshold_ = Time::FromInternalValue(threshold); + return cached_early_expiration_threshold_; +} + +void HistoryDatabase::UpdateEarlyExpirationThreshold(Time threshold) { + meta_table_.SetValue(kEarlyExpirationThresholdKey, + threshold.ToInternalValue()); + cached_early_expiration_threshold_ = threshold; +} + sqlite3* HistoryDatabase::GetDB() { return db_; } |