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

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

Issue 12033021: Add UMA metrics and histograms for locally managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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/url_database.h ('k') | chrome/browser/managed_mode/managed_mode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/url_database.cc
===================================================================
--- chrome/browser/history/url_database.cc (revision 177135)
+++ chrome/browser/history/url_database.cc (working copy)
@@ -111,6 +111,31 @@
return true;
}
+bool URLDatabase::GetUniqueURLsInRange(base::Time begin_time,
+ base::Time end_time,
+ int max_results,
+ URLRows* urls) {
+ sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
+ "SELECT DISTINCT" HISTORY_URL_ROW_FIELDS "FROM urls "
+ "WHERE last_visit_time > ? AND last_visit_time < ? "
+ "ORDER BY last_visit_time LIMIT ?"));
+
+ // See VisitDatabase::GetVisibleVisitsInRange for more info on how these
+ // times are bound.
+ int64 end = end_time.ToInternalValue();
+ statement.BindInt64(0, begin_time.ToInternalValue());
+ statement.BindInt64(1, end ? end : std::numeric_limits<int64>::max());
+ statement.BindInt64(2,
+ max_results ? max_results : std::numeric_limits<int64>::max());
+
+ while (statement.Step()) {
+ URLRow info;
+ FillURLRow(statement, &info);
+ urls->push_back(info);
+ }
+ return true;
+}
+
URLID URLDatabase::GetRowForURL(const GURL& url, history::URLRow* info) {
sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
"SELECT" HISTORY_URL_ROW_FIELDS "FROM urls WHERE url=?"));
« no previous file with comments | « chrome/browser/history/url_database.h ('k') | chrome/browser/managed_mode/managed_mode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698