| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/history/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 // Basic time-based querying of history. | 1051 // Basic time-based querying of history. |
| 1052 void HistoryBackend::QueryHistoryBasic(URLDatabase* url_db, | 1052 void HistoryBackend::QueryHistoryBasic(URLDatabase* url_db, |
| 1053 VisitDatabase* visit_db, | 1053 VisitDatabase* visit_db, |
| 1054 const QueryOptions& options, | 1054 const QueryOptions& options, |
| 1055 QueryResults* result) { | 1055 QueryResults* result) { |
| 1056 // First get all visits. | 1056 // First get all visits. |
| 1057 VisitVector visits; | 1057 VisitVector visits; |
| 1058 visit_db->GetVisibleVisitsInRange(options.begin_time, options.end_time, | 1058 visit_db->GetVisibleVisitsInRange(options.begin_time, options.end_time, |
| 1059 options.most_recent_visit_only, | |
| 1060 options.max_count, &visits); | 1059 options.max_count, &visits); |
| 1061 DCHECK(options.max_count == 0 || | 1060 DCHECK(options.max_count == 0 || |
| 1062 static_cast<int>(visits.size()) <= options.max_count); | 1061 static_cast<int>(visits.size()) <= options.max_count); |
| 1063 | 1062 |
| 1064 // Now add them and the URL rows to the results. | 1063 // Now add them and the URL rows to the results. |
| 1065 URLResult url_result; | 1064 URLResult url_result; |
| 1066 for (size_t i = 0; i < visits.size(); i++) { | 1065 for (size_t i = 0; i < visits.size(); i++) { |
| 1067 const VisitRow visit = visits[i]; | 1066 const VisitRow visit = visits[i]; |
| 1068 | 1067 |
| 1069 // Add a result row for this visit, get the URL info from the DB. | 1068 // Add a result row for this visit, get the URL info from the DB. |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 return true; | 1979 return true; |
| 1981 } | 1980 } |
| 1982 | 1981 |
| 1983 BookmarkService* HistoryBackend::GetBookmarkService() { | 1982 BookmarkService* HistoryBackend::GetBookmarkService() { |
| 1984 if (bookmark_service_) | 1983 if (bookmark_service_) |
| 1985 bookmark_service_->BlockTillLoaded(); | 1984 bookmark_service_->BlockTillLoaded(); |
| 1986 return bookmark_service_; | 1985 return bookmark_service_; |
| 1987 } | 1986 } |
| 1988 | 1987 |
| 1989 } // namespace history | 1988 } // namespace history |
| OLD | NEW |