| 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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 NotifyURLsModified(changed_urls); | 914 NotifyURLsModified(changed_urls); |
| 915 ScheduleCommit(); | 915 ScheduleCommit(); |
| 916 } | 916 } |
| 917 | 917 |
| 918 bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) { | 918 bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) { |
| 919 return time < expirer_.GetCurrentExpirationTime(); | 919 return time < expirer_.GetCurrentExpirationTime(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 void HistoryBackend::OnMemoryStateChange( | 922 void HistoryBackend::OnMemoryStateChange( |
| 923 memory_coordinator::MemoryState state) { | 923 memory_coordinator::MemoryState state) { |
| 924 bool trim_aggressively = state == memory_coordinator::MemoryState::SUSPENDED; | 924 db_->AdjustCacheMemory(state); |
| 925 TrimMemory(trim_aggressively); | 925 // TODO(bashi): Adjust cache memory of |thumbnail_db_| as well. |
| 926 } | 926 } |
| 927 | 927 |
| 928 void HistoryBackend::SetPageTitle(const GURL& url, | 928 void HistoryBackend::SetPageTitle(const GURL& url, |
| 929 const base::string16& title) { | 929 const base::string16& title) { |
| 930 if (!db_) | 930 if (!db_) |
| 931 return; | 931 return; |
| 932 | 932 |
| 933 // Search for recent redirects which should get the same title. We make a | 933 // Search for recent redirects which should get the same title. We make a |
| 934 // dummy list containing the exact URL visited if there are no redirects so | 934 // dummy list containing the exact URL visited if there are no redirects so |
| 935 // the processing below can be the same. | 935 // the processing below can be the same. |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2657 // transaction is currently open. | 2657 // transaction is currently open. |
| 2658 db_->CommitTransaction(); | 2658 db_->CommitTransaction(); |
| 2659 db_->Vacuum(); | 2659 db_->Vacuum(); |
| 2660 db_->BeginTransaction(); | 2660 db_->BeginTransaction(); |
| 2661 db_->GetStartDate(&first_recorded_time_); | 2661 db_->GetStartDate(&first_recorded_time_); |
| 2662 | 2662 |
| 2663 return true; | 2663 return true; |
| 2664 } | 2664 } |
| 2665 | 2665 |
| 2666 } // namespace history | 2666 } // namespace history |
| OLD | NEW |