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

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

Issue 10067018: Add PrerenderLocalPredictor, which will eventually perform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/visit_database.h ('k') | chrome/browser/prerender/prerender_local_predictor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/visit_database.cc
===================================================================
--- chrome/browser/history/visit_database.cc (revision 133528)
+++ chrome/browser/history/visit_database.cc (working copy)
@@ -558,4 +558,27 @@
return true;
}
+void VisitDatabase::GetBriefVisitInfoOfMostRecentVisits(
+ int max_visits,
+ std::vector<BriefVisitInfo>* result_vector) {
+ result_vector->clear();
+
+ sql::Statement statement(GetDB().GetUniqueStatement(
+ "SELECT url,visit_time,transition FROM visits "
+ "ORDER BY id DESC LIMIT ?"));
+
+ statement.BindInt64(0, max_visits);
+
+ if (!statement.is_valid())
+ return;
+
+ while (statement.Step()) {
+ BriefVisitInfo info;
+ info.url_id = statement.ColumnInt64(0);
+ info.time = base::Time::FromInternalValue(statement.ColumnInt64(1));
+ info.transition = content::PageTransitionFromInt(statement.ColumnInt(2));
+ result_vector->push_back(info);
+ }
+}
+
} // namespace history
« no previous file with comments | « chrome/browser/history/visit_database.h ('k') | chrome/browser/prerender/prerender_local_predictor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698