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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 // Clean up entries that has been corrupted (because of the crash, for example). | 1111 // Clean up entries that has been corrupted (because of the crash, for example). |
1112 void HistoryBackend::CleanUpInProgressEntries() { | 1112 void HistoryBackend::CleanUpInProgressEntries() { |
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(history::DownloadItemData data) { |
1122 int32 state, | |
1123 int64 db_handle) { | |
1124 if (db_.get()) | 1122 if (db_.get()) |
1125 db_->UpdateDownload(received_bytes, state, db_handle); | 1123 db_->UpdateDownload(data); |
1126 } | 1124 } |
1127 | 1125 |
1128 // Update the path of a particular download entry. | 1126 // Update the path of a particular download entry. |
1129 void HistoryBackend::UpdateDownloadPath(const FilePath& path, | 1127 void HistoryBackend::UpdateDownloadPath(const FilePath& path, |
1130 int64 db_handle) { | 1128 int64 db_handle) { |
1131 if (db_.get()) | 1129 if (db_.get()) |
1132 db_->UpdateDownloadPath(path, db_handle); | 1130 db_->UpdateDownloadPath(path, db_handle); |
1133 } | 1131 } |
1134 | 1132 |
1135 // Create a new download entry and pass back the db_handle to it. | 1133 // Create a new download entry and pass back the db_handle to it. |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 return true; | 2249 return true; |
2252 } | 2250 } |
2253 | 2251 |
2254 BookmarkService* HistoryBackend::GetBookmarkService() { | 2252 BookmarkService* HistoryBackend::GetBookmarkService() { |
2255 if (bookmark_service_) | 2253 if (bookmark_service_) |
2256 bookmark_service_->BlockTillLoaded(); | 2254 bookmark_service_->BlockTillLoaded(); |
2257 return bookmark_service_; | 2255 return bookmark_service_; |
2258 } | 2256 } |
2259 | 2257 |
2260 } // namespace history | 2258 } // namespace history |
OLD | NEW |