Lines Matching refs:visit
19 // Rows, in order, of the visit table.
40 // True when we have indexed data for this visit.
54 // Visit source table contains the source information for all the visits. To
89 void VisitDatabase::FillVisitRow(sql::Statement& statement, VisitRow* visit) {
90 visit->visit_id = statement.ColumnInt64(0);
91 visit->url_id = statement.ColumnInt64(1);
92 visit->visit_time = base::Time::FromInternalValue(statement.ColumnInt64(2));
93 visit->referring_visit = statement.ColumnInt64(3);
94 visit->transition = PageTransition::FromInt(statement.ColumnInt(4));
95 visit->segment_id = statement.ColumnInt64(5);
96 visit->is_indexed = !!statement.ColumnInt(6);
103 history::VisitRow visit;
104 FillVisitRow(statement, &visit);
105 visits->push_back(visit);
109 VisitID VisitDatabase::AddVisit(VisitRow* visit, VisitSource source) {
115 VLOG(0) << "Failed to build visit insert statement: "
116 << "url_id = " << visit->url_id;
120 statement.BindInt64(0, visit->url_id);
121 statement.BindInt64(1, visit->visit_time.ToInternalValue());
122 statement.BindInt64(2, visit->referring_visit);
123 statement.BindInt64(3, visit->transition);
124 statement.BindInt64(4, visit->segment_id);
125 statement.BindInt64(5, visit->is_indexed);
128 VLOG(0) << "Failed to execute visit insert statement: "
129 << "url_id = " << visit->url_id;
133 visit->visit_id = GetDB().GetLastInsertRowId();
136 // Record the source of this visit when it is not browsed.
141 << "url_id = " << visit->visit_id;
145 statement1.BindInt64(0, visit->visit_id);
149 << "url_id = " << visit->visit_id;
154 return visit->visit_id;
157 void VisitDatabase::DeleteVisit(const VisitRow& visit) {
158 // Patch around this visit. Any visits that this went to will now have their
159 // "source" be the deleted visit's source.
164 update_chain.BindInt64(0, visit.referring_visit);
165 update_chain.BindInt64(1, visit.visit_id);
168 // Now delete the actual visit.
173 del.BindInt64(0, visit.visit_id);
177 // If the visit was browsed, there is no corresponding entry in visit_source
183 del.BindInt64(0, visit.visit_id);
199 // We got a different visit than we asked for, something is wrong.
207 bool VisitDatabase::UpdateVisitRow(const VisitRow& visit) {
209 DCHECK_NE(visit.visit_id, visit.referring_visit);
210 if (visit.visit_id == visit.referring_visit)
220 statement.BindInt64(0, visit.url_id);
221 statement.BindInt64(1, visit.visit_time.ToInternalValue());
222 statement.BindInt64(2, visit.referring_visit);
223 statement.BindInt64(3, visit.transition);
224 statement.BindInt64(4, visit.segment_id);
225 statement.BindInt64(5, visit.is_indexed);
226 statement.BindInt64(6, visit.visit_id);
329 VisitRow visit;
330 FillVisitRow(statement, &visit);
331 // Make sure the URL this visit corresponds to is unique.
332 if (found_urls.find(visit.url_id) != found_urls.end())
334 found_urls.insert(visit.url_id);
335 visits->push_back(visit);
402 return false; // No redirect from this visit.