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/top_sites.h" | 5 #include "chrome/browser/history/top_sites.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 void TopSites::ResetThreadSafeCache() { | 941 void TopSites::ResetThreadSafeCache() { |
942 base::AutoLock lock(lock_); | 942 base::AutoLock lock(lock_); |
943 MostVisitedURLList cached; | 943 MostVisitedURLList cached; |
944 ApplyBlacklistAndPinnedURLs(cache_->top_sites(), &cached); | 944 ApplyBlacklistAndPinnedURLs(cache_->top_sites(), &cached); |
945 thread_safe_cache_->SetTopSites(cached); | 945 thread_safe_cache_->SetTopSites(cached); |
946 } | 946 } |
947 | 947 |
948 void TopSites::ResetThreadSafeImageCache() { | 948 void TopSites::ResetThreadSafeImageCache() { |
949 base::AutoLock lock(lock_); | 949 base::AutoLock lock(lock_); |
950 thread_safe_cache_->SetThumbnails(cache_->images()); | 950 thread_safe_cache_->SetThumbnails(cache_->images()); |
951 thread_safe_cache_->RemoveUnreferencedThumbnails(); | |
952 } | 951 } |
953 | 952 |
954 void TopSites::NotifyTopSitesChanged() { | 953 void TopSites::NotifyTopSitesChanged() { |
955 content::NotificationService::current()->Notify( | 954 content::NotificationService::current()->Notify( |
956 chrome::NOTIFICATION_TOP_SITES_CHANGED, | 955 chrome::NOTIFICATION_TOP_SITES_CHANGED, |
957 content::Source<TopSites>(this), | 956 content::Source<TopSites>(this), |
958 content::NotificationService::NoDetails()); | 957 content::NotificationService::NoDetails()); |
959 } | 958 } |
960 | 959 |
961 void TopSites::RestartQueryForTopSitesTimer(base::TimeDelta delta) { | 960 void TopSites::RestartQueryForTopSitesTimer(base::TimeDelta delta) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 SetTopSites(pages); | 1025 SetTopSites(pages); |
1027 | 1026 |
1028 // Used only in testing. | 1027 // Used only in testing. |
1029 content::NotificationService::current()->Notify( | 1028 content::NotificationService::current()->Notify( |
1030 chrome::NOTIFICATION_TOP_SITES_UPDATED, | 1029 chrome::NOTIFICATION_TOP_SITES_UPDATED, |
1031 content::Source<TopSites>(this), | 1030 content::Source<TopSites>(this), |
1032 content::Details<CancelableRequestProvider::Handle>(&handle)); | 1031 content::Details<CancelableRequestProvider::Handle>(&handle)); |
1033 } | 1032 } |
1034 | 1033 |
1035 } // namespace history | 1034 } // namespace history |
OLD | NEW |