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

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

Issue 10060003: Support for different weight-functions for time-slicing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added missing #include Created 8 years, 7 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/history/visit_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/visit_database.cc
diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc
index 0951da3d8cb59c6e8ebedf2e14948ccac80e9809..f48845c6cc54a7874b420b95b29aa2d9d1b68bae 100644
--- a/chrome/browser/history/visit_database.cc
+++ b/chrome/browser/history/visit_database.cc
@@ -301,7 +301,8 @@ bool VisitDatabase::GetVisitsInRangeForTransition(
void VisitDatabase::GetVisibleVisitsInRange(base::Time begin_time,
base::Time end_time,
int max_count,
- VisitVector* visits) {
+ VisitVector* visits,
+ bool unique) {
visits->clear();
// The visit_time values can be duplicated in a redirect chain, so we sort
// by id too, to ensure a consistent ordering just in case.
@@ -329,10 +330,12 @@ void VisitDatabase::GetVisibleVisitsInRange(base::Time begin_time,
while (statement.Step()) {
VisitRow visit;
FillVisitRow(statement, &visit);
- // Make sure the URL this visit corresponds to is unique.
- if (found_urls.find(visit.url_id) != found_urls.end())
- continue;
- found_urls.insert(visit.url_id);
+ if (unique) {
+ // Make sure the URL this visit corresponds to is unique.
+ if (found_urls.find(visit.url_id) != found_urls.end())
+ continue;
+ found_urls.insert(visit.url_id);
+ }
visits->push_back(visit);
if (max_count > 0 && static_cast<int>(visits->size()) >= max_count)
@@ -349,7 +352,7 @@ void VisitDatabase::GetVisibleVisitsDuringTimes(const VisitFilter& time_filter,
for (VisitFilter::TimeVector::const_iterator it = time_filter.times().begin();
it != time_filter.times().end(); ++it) {
VisitVector v;
- GetVisibleVisitsInRange(it->first, it->second, max_results, &v);
+ GetVisibleVisitsInRange(it->first, it->second, max_results, &v, false);
size_t take_only = 0;
if (max_results &&
static_cast<int>(visits->size() + v.size()) > max_results) {
« no previous file with comments | « chrome/browser/history/visit_database.h ('k') | chrome/browser/history/visit_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698