| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 if (result->success && want_visits) | 1038 if (result->success && want_visits) |
| 1039 db_->GetVisitsForURL(result->row.id(), &result->visits); | 1039 db_->GetVisitsForURL(result->row.id(), &result->visits); |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 TypedUrlSyncableService* HistoryBackend::GetTypedUrlSyncableService() const { | 1042 TypedUrlSyncableService* HistoryBackend::GetTypedUrlSyncableService() const { |
| 1043 return typed_url_syncable_service_.get(); | 1043 return typed_url_syncable_service_.get(); |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 // Statistics ------------------------------------------------------------------ | 1046 // Statistics ------------------------------------------------------------------ |
| 1047 | 1047 |
| 1048 HistoryCountResult HistoryBackend::GetHistoryCount() { | 1048 HistoryCountResult HistoryBackend::GetHistoryCount(const Time& begin_time, |
| 1049 const Time& end_time) { |
| 1049 HistoryCountResult result; | 1050 HistoryCountResult result; |
| 1050 result.count = 0; | 1051 result.count = 0; |
| 1051 result.success = db_ && db_->GetHistoryCount(&result.count); | 1052 result.success = |
| 1053 db_ && db_->GetHistoryCount(begin_time, end_time, &result.count); |
| 1052 return result; | 1054 return result; |
| 1053 } | 1055 } |
| 1054 | 1056 |
| 1055 // Keyword visits -------------------------------------------------------------- | 1057 // Keyword visits -------------------------------------------------------------- |
| 1056 | 1058 |
| 1057 void HistoryBackend::SetKeywordSearchTermsForURL(const GURL& url, | 1059 void HistoryBackend::SetKeywordSearchTermsForURL(const GURL& url, |
| 1058 KeywordID keyword_id, | 1060 KeywordID keyword_id, |
| 1059 const base::string16& term) { | 1061 const base::string16& term) { |
| 1060 if (!db_) | 1062 if (!db_) |
| 1061 return; | 1063 return; |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2707 // transaction is currently open. | 2709 // transaction is currently open. |
| 2708 db_->CommitTransaction(); | 2710 db_->CommitTransaction(); |
| 2709 db_->Vacuum(); | 2711 db_->Vacuum(); |
| 2710 db_->BeginTransaction(); | 2712 db_->BeginTransaction(); |
| 2711 db_->GetStartDate(&first_recorded_time_); | 2713 db_->GetStartDate(&first_recorded_time_); |
| 2712 | 2714 |
| 2713 return true; | 2715 return true; |
| 2714 } | 2716 } |
| 2715 | 2717 |
| 2716 } // namespace history | 2718 } // namespace history |
| OLD | NEW |