| 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/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/favicon/favicon_service.h" | 10 #include "chrome/browser/favicon/favicon_service.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 else if (type == syncer::FAVICON_TRACKING) | 220 else if (type == syncer::FAVICON_TRACKING) |
| 221 return FaviconInfoHasTracking(favicon_info); | 221 return FaviconInfoHasTracking(favicon_info); |
| 222 NOTREACHED(); | 222 NOTREACHED(); |
| 223 return false; | 223 return false; |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| 227 | 227 |
| 228 FaviconCache::FaviconCache(Profile* profile, int max_sync_favicon_limit) | 228 FaviconCache::FaviconCache(Profile* profile, int max_sync_favicon_limit) |
| 229 : profile_(profile), | 229 : profile_(profile), |
| 230 weak_ptr_factory_(this), | 230 max_sync_favicon_limit_(max_sync_favicon_limit), |
| 231 max_sync_favicon_limit_(max_sync_favicon_limit) { | 231 weak_ptr_factory_(this) { |
| 232 notification_registrar_.Add(this, | 232 notification_registrar_.Add(this, |
| 233 chrome::NOTIFICATION_HISTORY_URLS_DELETED, | 233 chrome::NOTIFICATION_HISTORY_URLS_DELETED, |
| 234 content::Source<Profile>(profile_)); | 234 content::Source<Profile>(profile_)); |
| 235 DVLOG(1) << "Setting favicon limit to " << max_sync_favicon_limit; | 235 DVLOG(1) << "Setting favicon limit to " << max_sync_favicon_limit; |
| 236 } | 236 } |
| 237 | 237 |
| 238 FaviconCache::~FaviconCache() {} | 238 FaviconCache::~FaviconCache() {} |
| 239 | 239 |
| 240 syncer::SyncMergeResult FaviconCache::MergeDataAndStartSyncing( | 240 syncer::SyncMergeResult FaviconCache::MergeDataAndStartSyncing( |
| 241 syncer::ModelType type, | 241 syncer::ModelType type, |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 | 1033 |
| 1034 size_t FaviconCache::NumFaviconsForTest() const { | 1034 size_t FaviconCache::NumFaviconsForTest() const { |
| 1035 return synced_favicons_.size(); | 1035 return synced_favicons_.size(); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 size_t FaviconCache::NumTasksForTest() const { | 1038 size_t FaviconCache::NumTasksForTest() const { |
| 1039 return page_task_map_.size(); | 1039 return page_task_map_.size(); |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 } // namespace browser_sync | 1042 } // namespace browser_sync |
| OLD | NEW |