| 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(const DownloadPersistentStoreInfo& 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 break; | 2269 break; |
| 2272 } | 2270 } |
| 2273 } | 2271 } |
| 2274 } | 2272 } |
| 2275 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name | 2273 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name |
| 2276 TimeTicks::Now() - beginning_time); | 2274 TimeTicks::Now() - beginning_time); |
| 2277 return success; | 2275 return success; |
| 2278 } | 2276 } |
| 2279 | 2277 |
| 2280 } // namespace history | 2278 } // namespace history |
| OLD | NEW |