| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <limits> | 6 #include <limits> |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "chrome/browser/history/visit_database.h" | 10 #include "chrome/browser/history/visit_database.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 bool VisitDatabase::InitVisitTable() { | 30 bool VisitDatabase::InitVisitTable() { |
| 31 if (!DoesSqliteTableExist(GetDB(), "visits")) { | 31 if (!DoesSqliteTableExist(GetDB(), "visits")) { |
| 32 if (sqlite3_exec(GetDB(), "CREATE TABLE visits(" | 32 if (sqlite3_exec(GetDB(), "CREATE TABLE visits(" |
| 33 "id INTEGER PRIMARY KEY," | 33 "id INTEGER PRIMARY KEY," |
| 34 "url INTEGER NOT NULL," // key of the URL this corresponds to | 34 "url INTEGER NOT NULL," // key of the URL this corresponds to |
| 35 "visit_time INTEGER NOT NULL," | 35 "visit_time INTEGER NOT NULL," |
| 36 "from_visit INTEGER," | 36 "from_visit INTEGER," |
| 37 "transition INTEGER DEFAULT 0 NOT NULL," | 37 "transition INTEGER DEFAULT 0 NOT NULL," |
| 38 "segment_id INTEGER," | 38 "segment_id INTEGER," |
| 39 "is_indexed BOOLEAN)", // True when we have indexed data for this visit
. | 39 // True when we have indexed data for this visit. |
| 40 "is_indexed BOOLEAN)", |
| 40 NULL, NULL, NULL) != SQLITE_OK) | 41 NULL, NULL, NULL) != SQLITE_OK) |
| 41 return false; | 42 return false; |
| 42 } else if (!DoesSqliteColumnExist(GetDB(), "visits", | 43 } else if (!DoesSqliteColumnExist(GetDB(), "visits", |
| 43 "is_indexed", "BOOLEAN")) { | 44 "is_indexed", "BOOLEAN")) { |
| 44 // Old versions don't have the is_indexed column, we can just add that and | 45 // Old versions don't have the is_indexed column, we can just add that and |
| 45 // not worry about different database revisions, since old ones will | 46 // not worry about different database revisions, since old ones will |
| 46 // continue to work. | 47 // continue to work. |
| 47 // | 48 // |
| 48 // TODO(brettw) this should be removed once we think everybody has been | 49 // TODO(brettw) this should be removed once we think everybody has been |
| 49 // updated (added early Mar 2008). | 50 // updated (added early Mar 2008). |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 *count = 0; | 362 *count = 0; |
| 362 return true; | 363 return true; |
| 363 } | 364 } |
| 364 | 365 |
| 365 *first_visit = Time::FromInternalValue(statement->column_int64(0)); | 366 *first_visit = Time::FromInternalValue(statement->column_int64(0)); |
| 366 *count = statement->column_int(1); | 367 *count = statement->column_int(1); |
| 367 return true; | 368 return true; |
| 368 } | 369 } |
| 369 | 370 |
| 370 } // namespace history | 371 } // namespace history |
| OLD | NEW |