| 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 "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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 int32 id, | 1233 int32 id, |
| 1234 const content::DownloadPersistentStoreInfo& history_info) { | 1234 const content::DownloadPersistentStoreInfo& history_info) { |
| 1235 int64 db_handle = 0; | 1235 int64 db_handle = 0; |
| 1236 if (!request->canceled()) { | 1236 if (!request->canceled()) { |
| 1237 if (db_.get()) | 1237 if (db_.get()) |
| 1238 db_handle = db_->CreateDownload(history_info); | 1238 db_handle = db_->CreateDownload(history_info); |
| 1239 request->ForwardResult(id, db_handle); | 1239 request->ForwardResult(id, db_handle); |
| 1240 } | 1240 } |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 void HistoryBackend::RemoveDownload(int64 db_handle) { | 1243 void HistoryBackend::RemoveDownloads(const std::set<int64>& handles) { |
| 1244 if (db_.get()) | 1244 if (db_.get()) |
| 1245 db_->RemoveDownload(db_handle); | 1245 db_->RemoveDownloads(handles); |
| 1246 } | |
| 1247 | |
| 1248 void HistoryBackend::RemoveDownloadsBetween(const Time remove_begin, | |
| 1249 const Time remove_end) { | |
| 1250 if (db_.get()) | |
| 1251 db_->RemoveDownloadsBetween(remove_begin, remove_end); | |
| 1252 } | 1246 } |
| 1253 | 1247 |
| 1254 void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, | 1248 void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, |
| 1255 const string16& text_query, | 1249 const string16& text_query, |
| 1256 const QueryOptions& options) { | 1250 const QueryOptions& options) { |
| 1257 if (request->canceled()) | 1251 if (request->canceled()) |
| 1258 return; | 1252 return; |
| 1259 | 1253 |
| 1260 TimeTicks beginning_time = TimeTicks::Now(); | 1254 TimeTicks beginning_time = TimeTicks::Now(); |
| 1261 | 1255 |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2484 info.url_id = visit.url_id; | 2478 info.url_id = visit.url_id; |
| 2485 info.time = visit.visit_time; | 2479 info.time = visit.visit_time; |
| 2486 info.transition = visit.transition; | 2480 info.transition = visit.transition; |
| 2487 // If we don't have a delegate yet during setup or shutdown, we will drop | 2481 // If we don't have a delegate yet during setup or shutdown, we will drop |
| 2488 // these notifications. | 2482 // these notifications. |
| 2489 if (delegate_.get()) | 2483 if (delegate_.get()) |
| 2490 delegate_->NotifyVisitDBObserversOnAddVisit(info); | 2484 delegate_->NotifyVisitDBObserversOnAddVisit(info); |
| 2491 } | 2485 } |
| 2492 | 2486 |
| 2493 } // namespace history | 2487 } // namespace history |
| OLD | NEW |