Home | History | Annotate | Download | only in glue

Lines Matching defs:visits

32 // There's no limit on how many visits the history DB could have for a given
35 // from kMaxTypedUrlVisits, as some of the visits fetched from the DB may be
36 // RELOAD visits, which will be stripped.
41 static bool CheckVisitOrdering(const history::VisitVector& visits) {
43 for (history::VisitVector::const_iterator visit = visits.begin();
44 visit != visits.end(); ++visit) {
45 if (visit != visits.begin()) {
46 // We allow duplicate visits here - they shouldn't really be allowed, but
82 history::VisitVector* visits) {
86 url->id(), kMaxVisitsToFetch, visits)) {
96 if (visits->empty()) {
97 DVLOG(1) << "Found empty visits for URL: " << url->url();
100 visits->push_back(visit);
105 std::reverse(visits->begin(), visits->end());
110 url->set_last_visit(visits->back().visit_time);
111 DCHECK(CheckVisitOrdering(*visits));
134 const history::VisitVector& visits) {
139 if (!history_backend_->GetVisitsSource(visits, &map))
142 // Walk the list of visits and look for a non-imported item.
143 for (history::VisitVector::const_iterator it = visits.begin();
144 it != visits.end(); ++it) {
150 // We only saw imported visits, so tell the caller to ignore them.
204 // Get all the visits.
212 // Ignore this URL if we couldn't load the visits or if there's some
237 history::VisitVector& visits = visit_vectors[ix->id()];
257 MergeUrls(typed_url, *ix, &visits, &new_url, &added_visits);
267 // We don't want to resurrect old visits that have been aged out by
268 // other clients, so remove all visits that are older than the
272 base::Time::FromInternalValue(typed_url.visits(0));
273 for (history::VisitVector::iterator it = visits.begin();
274 it != visits.end() && it->visit_time < earliest_visit; ) {
275 it = visits.erase(it);
278 // visit vector contains all the items in typed_url.visits.
279 DCHECK(visits.size() > 0);
282 visits.back().visit_time.ToInternalValue());
283 WriteToSyncNode(new_url, visits, &write_node);
308 WriteToSyncNode(*ix, visits, &node);
352 // Now, get rid of the expired visits, and if there are no un-expired
353 // visits left, just ignore this node.
363 // existing visits (pass NULL as |visits_to_remove|).
409 // This URL already exists locally - fetch the visits so we can
412 // Couldn't load the visits for this URL due to some kind of DB error.
414 visits).
415 DLOG(ERROR) << "Could not load visits for url: " << new_url.url();
425 // Figure out which visits we need to add.
439 // Make a copy of the source, then regenerate the visits.
444 base::Time time = base::Time::FromInternalValue(source.visits(i));
446 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)));