OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 if (db_.get()) { | 1113 if (db_.get()) { |
1114 // If some "in progress" entries were not updated when Chrome exited, they | 1114 // If some "in progress" entries were not updated when Chrome exited, they |
1115 // need to be cleaned up. | 1115 // need to be cleaned up. |
1116 db_->CleanUpInProgressEntries(); | 1116 db_->CleanUpInProgressEntries(); |
1117 } | 1117 } |
1118 } | 1118 } |
1119 | 1119 |
1120 // Update a particular download entry. | 1120 // Update a particular download entry. |
1121 void HistoryBackend::UpdateDownload(int64 received_bytes, | 1121 void HistoryBackend::UpdateDownload(int64 received_bytes, |
1122 int32 state, | 1122 int32 state, |
| 1123 const base::Time& end_time, |
1123 int64 db_handle) { | 1124 int64 db_handle) { |
1124 if (db_.get()) | 1125 if (db_.get()) |
1125 db_->UpdateDownload(received_bytes, state, db_handle); | 1126 db_->UpdateDownload(received_bytes, state, end_time, db_handle); |
1126 } | 1127 } |
1127 | 1128 |
1128 // Update the path of a particular download entry. | 1129 // Update the path of a particular download entry. |
1129 void HistoryBackend::UpdateDownloadPath(const FilePath& path, | 1130 void HistoryBackend::UpdateDownloadPath(const FilePath& path, |
1130 int64 db_handle) { | 1131 int64 db_handle) { |
1131 if (db_.get()) | 1132 if (db_.get()) |
1132 db_->UpdateDownloadPath(path, db_handle); | 1133 db_->UpdateDownloadPath(path, db_handle); |
1133 } | 1134 } |
1134 | 1135 |
1135 // Create a new download entry and pass back the db_handle to it. | 1136 // Create a new download entry and pass back the db_handle to it. |
(...skipping 13 matching lines...) Expand all Loading... |
1149 if (db_.get()) | 1150 if (db_.get()) |
1150 db_->RemoveDownload(db_handle); | 1151 db_->RemoveDownload(db_handle); |
1151 } | 1152 } |
1152 | 1153 |
1153 void HistoryBackend::RemoveDownloadsBetween(const Time remove_begin, | 1154 void HistoryBackend::RemoveDownloadsBetween(const Time remove_begin, |
1154 const Time remove_end) { | 1155 const Time remove_end) { |
1155 if (db_.get()) | 1156 if (db_.get()) |
1156 db_->RemoveDownloadsBetween(remove_begin, remove_end); | 1157 db_->RemoveDownloadsBetween(remove_begin, remove_end); |
1157 } | 1158 } |
1158 | 1159 |
| 1160 void HistoryBackend::MarkDownloadOpened(int64 db_handle) { |
| 1161 if (db_.get()) |
| 1162 db_->MarkDownloadOpened(db_handle); |
| 1163 } |
| 1164 |
1159 void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, | 1165 void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, |
1160 const string16& text_query, | 1166 const string16& text_query, |
1161 const QueryOptions& options) { | 1167 const QueryOptions& options) { |
1162 if (request->canceled()) | 1168 if (request->canceled()) |
1163 return; | 1169 return; |
1164 | 1170 |
1165 TimeTicks beginning_time = TimeTicks::Now(); | 1171 TimeTicks beginning_time = TimeTicks::Now(); |
1166 | 1172 |
1167 if (db_.get()) { | 1173 if (db_.get()) { |
1168 if (text_query.empty()) { | 1174 if (text_query.empty()) { |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 return true; | 2257 return true; |
2252 } | 2258 } |
2253 | 2259 |
2254 BookmarkService* HistoryBackend::GetBookmarkService() { | 2260 BookmarkService* HistoryBackend::GetBookmarkService() { |
2255 if (bookmark_service_) | 2261 if (bookmark_service_) |
2256 bookmark_service_->BlockTillLoaded(); | 2262 bookmark_service_->BlockTillLoaded(); |
2257 return bookmark_service_; | 2263 return bookmark_service_; |
2258 } | 2264 } |
2259 | 2265 |
2260 } // namespace history | 2266 } // namespace history |
OLD | NEW |