| Index: chrome/browser/history/visit_database.cc
|
| diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc
|
| index 48975b1015149e3c1cb88cf755bbab1a7c9a9afc..862d574a4146893731d63d89508f8341d2fc4f86 100644
|
| --- a/chrome/browser/history/visit_database.cc
|
| +++ b/chrome/browser/history/visit_database.cc
|
| @@ -159,10 +159,21 @@ bool VisitDatabase::GetRowForVisit(VisitID visit_id, VisitRow* out_visit) {
|
| return false;
|
|
|
| FillVisitRow(*statement, out_visit);
|
| +
|
| + // We got a different visit than we asked for, something is wrong.
|
| + DCHECK_EQ(visit_id, out_visit->visit_id);
|
| + if (visit_id != out_visit->visit_id)
|
| + return false;
|
| +
|
| return true;
|
| }
|
|
|
| bool VisitDatabase::UpdateVisitRow(const VisitRow& visit) {
|
| + // Don't store inconsistent data to the database.
|
| + DCHECK_NE(visit.visit_id, visit.referring_visit);
|
| + if (visit.visit_id == visit.referring_visit)
|
| + return false;
|
| +
|
| SQLITE_UNIQUE_STATEMENT(statement, GetStatementCache(),
|
| "UPDATE visits SET "
|
| "url=?,visit_time=?,from_visit=?,transition=?,segment_id=?,is_indexed=? "
|
|
|