Index: chrome/browser/history/history_backend.cc |
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc |
index 1d63731625add0a46eee9e89b818996740e5122c..21ca31dcb8a8d34cc715678337ecb6414d50ad4b 100644 |
--- a/chrome/browser/history/history_backend.cc |
+++ b/chrome/browser/history/history_backend.cc |
@@ -710,6 +710,8 @@ void HistoryBackend::CloseAllDatabases() { |
// Commit the long-running transaction. |
db_->CommitTransaction(); |
db_.reset(); |
+ // Forget the first recorded time since the database is closed. |
+ first_recorded_time_ = base::Time(); |
} |
if (thumbnail_db_) { |
thumbnail_db_->CommitTransaction(); |
@@ -2485,20 +2487,21 @@ void HistoryBackend::ExpireHistoryBetween( |
const std::set<GURL>& restrict_urls, |
Time begin_time, |
Time end_time) { |
- if (db_) { |
- if (begin_time.is_null() && (end_time.is_null() || end_time.is_max()) && |
- restrict_urls.empty()) { |
- // Special case deleting all history so it can be faster and to reduce the |
- // possibility of an information leak. |
- DeleteAllHistory(); |
- } else { |
- // Clearing parts of history, have the expirer do the depend |
- expirer_.ExpireHistoryBetween(restrict_urls, begin_time, end_time); |
+ if (!db_) |
+ return; |
- // Force a commit, if the user is deleting something for privacy reasons, |
- // we want to get it on disk ASAP. |
- Commit(); |
- } |
+ if (begin_time.is_null() && (end_time.is_null() || end_time.is_max()) && |
+ restrict_urls.empty()) { |
+ // Special case deleting all history so it can be faster and to reduce the |
+ // possibility of an information leak. |
+ DeleteAllHistory(); |
+ } else { |
+ // Clearing parts of history, have the expirer do the depend |
+ expirer_.ExpireHistoryBetween(restrict_urls, begin_time, end_time); |
+ |
+ // Force a commit, if the user is deleting something for privacy reasons, |
+ // we want to get it on disk ASAP. |
+ Commit(); |
} |
if (begin_time <= first_recorded_time_) |