Home | History | Annotate | Download | only in glue

Lines Matching defs:visits

33 // There's no limit on how many visits the history DB could have for a given
36 // from kMaxTypedUrlVisits, as some of the visits fetched from the DB may be
37 // RELOAD visits, which will be stripped.
40 static bool CheckVisitOrdering(const history::VisitVector& visits) {
42 for (history::VisitVector::const_iterator visit = visits.begin();
43 visit != visits.end(); ++visit) {
44 if (visit != visits.begin()) {
45 // We allow duplicate visits here - they shouldn't really be allowed, but
81 history::VisitVector* visits) {
85 url->id(), kMaxVisitsToFetch, visits)) {
95 if (visits->empty()) {
96 DVLOG(1) << "Found empty visits for URL: " << url->url();
100 // even if all its visits are deleted. Return false to stop further
107 visits->push_back(visit);
112 std::reverse(visits->begin(), visits->end());
117 url->set_last_visit(visits->back().visit_time);
118 DCHECK(CheckVisitOrdering(*visits));
141 const history::VisitVector& visits) {
146 if (!history_backend_->GetVisitsSource(visits, &map))
149 // Walk the list of visits and look for a non-imported item.
150 for (history::VisitVector::const_iterator it = visits.begin();
151 it != visits.end(); ++it) {
157 // We only saw imported visits, so tell the caller to ignore them.
211 // Get all the visits.
219 // Ignore this URL if we couldn't load the visits or if there's some
244 history::VisitVector& visits = visit_vectors[ix->id()];
264 MergeUrls(typed_url, *ix, &visits, &new_url, &added_visits);
274 // We don't want to resurrect old visits that have been aged out by
275 // other clients, so remove all visits that are older than the
279 base::Time::FromInternalValue(typed_url.visits(0));
280 for (history::VisitVector::iterator it = visits.begin();
281 it != visits.end() && it->visit_time < earliest_visit; ) {
282 it = visits.erase(it);
285 // visit vector contains all the items in typed_url.visits.
286 DCHECK(visits.size() > 0);
289 visits.back().visit_time.ToInternalValue());
290 WriteToSyncNode(new_url, visits, &write_node);
315 WriteToSyncNode(*ix, visits, &node);
359 // Now, get rid of the expired visits, and if there are no un-expired
360 // visits left, just ignore this node.
370 // existing visits (pass NULL as |visits_to_remove|).
416 // This URL already exists locally - fetch the visits
419 // Couldn't load the visits for this URL due to some kind of DB error.
421 // error and continue, we might end up duplicating existing visits).
422 DLOG(ERROR) << "Could not load visits for url: " << new_url.url();
432 // Figure out which visits we need to add.
445 // Make a copy of the source, then regenerate the visits.
450 base::Time time = base::Time::FromInternalValue(source.visits(i));
452 specifics.add_visits(source.visits(i));
531 for (TypedUrlVisitVector::const_iterator visits = new_visits->begin();
532 visits != new_visits->end(); ++visits) {
533 // If there are no visits to add, just skip this.
534 if (visits->second.empty())
537 if (!history_backend_->AddVisits(visits->first, visits->second,
540 DLOG(ERROR) << "Could not add visits.";
548 DLOG(ERROR) << "Could not remove visits.";
560 history::VisitVector* visits,
566 DCHECK(visits->size());
569 // If we have an old-format node (before we added the visits and
571 // expired visits, so just overwrite it with our local history data.
578 node.visits(node.visits_size() - 1));
604 size_t history_num_visits = visits->size();
607 base::Time earliest_history_time = (*visits)[0].visit_time;
608 // Walk through the two sets of visits and figure out if any new visits were
615 node_time = base::Time::FromInternalValue(node.visits(node_visit_index));
617 history_time = (*visits)[history_visit_index].visit_time;
628 // add it to our list of new visits and set the appropriate flag so the
631 // don't re-add it - this keeps us from resurrecting visits that were
640 // This visit is added to visits below.
649 DCHECK(CheckVisitOrdering(*visits));
651 // Insert new visits into the apropriate place in the visits vector.
652 history::VisitVector::iterator visit_ix = visits->begin();
656 while (visit_ix != visits->end() &&
660 visit_ix = visits->insert(visit_ix,
666 DCHECK(CheckVisitOrdering(*visits));
668 new_url->set_last_visit(visits->back().visit_time);
675 const history::VisitVector& visits,
678 WriteToTypedUrlSpecifics(url, visits, &typed_url);
684 const history::VisitVector& visits,
688 DCHECK(!visits.empty());
690 visits.back().visit_time.ToInternalValue());
696 DCHECK(CheckVisitOrdering(visits));
701 if (visits.size() > static_cast<size_t>(kMaxTypedUrlVisits)) {
704 // Walk the passed-in visit vector and count the # of typed visits.
705 for (history::VisitVector::const_iterator visit = visits.begin();
706 visit != visits.end(); ++visit) {
709 // We ignore reload visits.
731 for (history::VisitVector::const_iterator visit = visits.begin();
732 visit != visits.end(); ++visit) {
735 // Skip reload visits.
739 // If we only have room for typed visits, then only add typed visits.
757 // If we get here, it's because we don't actually have any TYPED visits
783 base::Time::FromInternalValue(new_url.visits(new_index));
786 // If there are visits missing from the start of the node, that
813 base::Time::FromInternalValue(new_url.visits(new_index)),
830 typed_url.visits(typed_url.visits_size() - 1)));