Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1330)

Unified Diff: chrome/browser/history/history_backend.cc

Issue 43054: Stop history search going on beyond the start of history.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_querying_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
===================================================================
--- chrome/browser/history/history_backend.cc (revision 11260)
+++ chrome/browser/history/history_backend.cc (working copy)
@@ -350,6 +350,11 @@
last_recorded_time_ = last_requested_time_;
}
+ // If the user is adding older history, we need to make sure our times
+ // are correct.
+ if (request->time < first_recorded_time_)
+ first_recorded_time_ = request->time;
+
if (request->redirects.size() <= 1) {
// The single entry is both a chain start and end.
PageTransition::Type t = request->transition |
@@ -565,6 +570,9 @@
if (text_database_.get())
text_database_->BeginTransaction();
+ // Get the first item in our database.
+ db_->GetStartDate(&first_recorded_time_);
+
// Start expiring old stuff.
expirer_.StartArchivingOldStuff(TimeDelta::FromDays(kArchiveDaysThreshold));
@@ -1042,6 +1050,9 @@
// snippets and stuff don't apply to basic querying.
result->AppendURLBySwapping(&url_result);
}
+
+ if (options.begin_time <= first_recorded_time_)
+ result->set_reached_beginning(true);
}
void HistoryBackend::QueryHistoryFTS(const std::wstring& text_query,
@@ -1092,6 +1103,9 @@
// result of the swap.
result->AppendURLBySwapping(&url_result);
}
+
+ if (options.begin_time <= first_recorded_time_)
+ result->set_reached_beginning(true);
}
// Frontend to GetMostRecentRedirectsFrom from the history thread.
@@ -1581,6 +1595,7 @@
void HistoryBackend::DeleteURL(const GURL& url) {
expirer_.DeleteURL(url);
+ db_->GetStartDate(&first_recorded_time_);
// Force a commit, if the user is deleting something for privacy reasons, we
// want to get it on disk ASAP.
Commit();
@@ -1608,6 +1623,9 @@
}
}
+ if (begin_time <= first_recorded_time_)
+ db_->GetStartDate(&first_recorded_time_);
+
request->ForwardResult(ExpireHistoryRequest::TupleType());
if (history_publisher_.get())
@@ -1729,6 +1747,8 @@
}
}
+ db_->GetStartDate(&first_recorded_time_);
+
// Send out the notfication that history is cleared. The in-memory datdabase
// will pick this up and clear itself.
URLsDeletedDetails* details = new URLsDeletedDetails;
@@ -1822,6 +1842,10 @@
db_->CommitTransaction();
db_->Vacuum();
db_->BeginTransaction();
+ db_->GetStartDate(&first_recorded_time_);
+
+ first_recorded_time_ = Time::Now();
sky 2009/03/11 01:11:31 nuke this.
+
return true;
}
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_querying_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698