OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync/glue/favicon_cache.h" | 5 #include "chrome/browser/sync/glue/favicon_cache.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/favicon/favicon_service.h" | 9 #include "chrome/browser/favicon/favicon_service.h" |
10 #include "chrome/browser/favicon/favicon_service_factory.h" | 10 #include "chrome/browser/favicon/favicon_service_factory.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 FaviconCacheObserver::~FaviconCacheObserver() {} | 218 FaviconCacheObserver::~FaviconCacheObserver() {} |
219 | 219 |
220 FaviconCache::FaviconCache(Profile* profile, int max_sync_favicon_limit) | 220 FaviconCache::FaviconCache(Profile* profile, int max_sync_favicon_limit) |
221 : profile_(profile), | 221 : profile_(profile), |
222 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 222 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
223 legacy_delegate_(NULL), | 223 legacy_delegate_(NULL), |
224 max_sync_favicon_limit_(max_sync_favicon_limit) { | 224 max_sync_favicon_limit_(max_sync_favicon_limit) { |
225 notification_registrar_.Add(this, | 225 notification_registrar_.Add(this, |
226 chrome::NOTIFICATION_HISTORY_URLS_DELETED, | 226 chrome::NOTIFICATION_HISTORY_URLS_DELETED, |
227 content::Source<Profile>(profile_)); | 227 content::Source<Profile>(profile_)); |
| 228 DVLOG(1) << "Setting favicon limit to " << max_sync_favicon_limit; |
228 } | 229 } |
229 | 230 |
230 FaviconCache::~FaviconCache() {} | 231 FaviconCache::~FaviconCache() {} |
231 | 232 |
232 syncer::SyncMergeResult FaviconCache::MergeDataAndStartSyncing( | 233 syncer::SyncMergeResult FaviconCache::MergeDataAndStartSyncing( |
233 syncer::ModelType type, | 234 syncer::ModelType type, |
234 const syncer::SyncDataList& initial_sync_data, | 235 const syncer::SyncDataList& initial_sync_data, |
235 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 236 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
236 scoped_ptr<syncer::SyncErrorFactory> error_handler) { | 237 scoped_ptr<syncer::SyncErrorFactory> error_handler) { |
237 DCHECK(type == syncer::FAVICON_IMAGES || type == syncer::FAVICON_TRACKING); | 238 DCHECK(type == syncer::FAVICON_IMAGES || type == syncer::FAVICON_TRACKING); |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 | 989 |
989 size_t FaviconCache::NumFaviconsForTest() const { | 990 size_t FaviconCache::NumFaviconsForTest() const { |
990 return synced_favicons_.size(); | 991 return synced_favicons_.size(); |
991 } | 992 } |
992 | 993 |
993 size_t FaviconCache::NumTasksForTest() const { | 994 size_t FaviconCache::NumTasksForTest() const { |
994 return page_task_map_.size(); | 995 return page_task_map_.size(); |
995 } | 996 } |
996 | 997 |
997 } // namespace browser_sync | 998 } // namespace browser_sync |
OLD | NEW |