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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // We've never been to this page before. | 361 // We've never been to this page before. |
362 *count = 0; | 362 *count = 0; |
363 return true; | 363 return true; |
364 } | 364 } |
365 | 365 |
366 *first_visit = Time::FromInternalValue(statement->column_int64(0)); | 366 *first_visit = Time::FromInternalValue(statement->column_int64(0)); |
367 *count = statement->column_int(1); | 367 *count = statement->column_int(1); |
368 return true; | 368 return true; |
369 } | 369 } |
370 | 370 |
| 371 bool VisitDatabase::GetStartDate(Time* first_visit) { |
| 372 SQLITE_UNIQUE_STATEMENT(statement, GetStatementCache(), |
| 373 "SELECT MIN(visit_time) FROM visits WHERE visit_time != 0"); |
| 374 if (!statement.is_valid() || statement->step() != SQLITE_ROW || |
| 375 statement->column_int64(0) == 0) { |
| 376 *first_visit = Time::Now(); |
| 377 return false; |
| 378 } |
| 379 *first_visit = Time::FromInternalValue(statement->column_int64(0)); |
| 380 return true; |
| 381 } |
| 382 |
371 } // namespace history | 383 } // namespace history |
OLD | NEW |