| 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/expire_history_backend.h" | 5 #include "chrome/browser/history/expire_history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // Pick up any bits possibly left over. | 320 // Pick up any bits possibly left over. |
| 321 ParanoidExpireHistory(); | 321 ParanoidExpireHistory(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void ExpireHistoryBackend::ArchiveHistoryBefore(Time end_time) { | 324 void ExpireHistoryBackend::ArchiveHistoryBefore(Time end_time) { |
| 325 if (!main_db_) | 325 if (!main_db_) |
| 326 return; | 326 return; |
| 327 | 327 |
| 328 // Archive as much history as possible before the given date. | 328 // Archive as much history as possible before the given date. |
| 329 ArchiveSomeOldHistory(end_time, GetAllVisitsReader(), | 329 ArchiveSomeOldHistory(end_time, GetAllVisitsReader(), |
| 330 std::numeric_limits<size_t>::max()); | 330 std::numeric_limits<int>::max()); |
| 331 ParanoidExpireHistory(); | 331 ParanoidExpireHistory(); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void ExpireHistoryBackend::InitWorkQueue() { | 334 void ExpireHistoryBackend::InitWorkQueue() { |
| 335 DCHECK(work_queue_.empty()) << "queue has to be empty prior to init"; | 335 DCHECK(work_queue_.empty()) << "queue has to be empty prior to init"; |
| 336 | 336 |
| 337 for (size_t i = 0; i < readers_.size(); i++) | 337 for (size_t i = 0; i < readers_.size(); i++) |
| 338 work_queue_.push(readers_[i]); | 338 work_queue_.push(readers_[i]); |
| 339 } | 339 } |
| 340 | 340 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 // We use the bookmark service to determine if a URL is bookmarked. The | 766 // We use the bookmark service to determine if a URL is bookmarked. The |
| 767 // bookmark service is loaded on a separate thread and may not be done by the | 767 // bookmark service is loaded on a separate thread and may not be done by the |
| 768 // time we get here. We therefor block until the bookmarks have finished | 768 // time we get here. We therefor block until the bookmarks have finished |
| 769 // loading. | 769 // loading. |
| 770 if (bookmark_service_) | 770 if (bookmark_service_) |
| 771 bookmark_service_->BlockTillLoaded(); | 771 bookmark_service_->BlockTillLoaded(); |
| 772 return bookmark_service_; | 772 return bookmark_service_; |
| 773 } | 773 } |
| 774 | 774 |
| 775 } // namespace history | 775 } // namespace history |
| OLD | NEW |