Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/sync/glue/favicon_cache.cc

Issue 235863023: Eliminate the archived history database and clean up related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 } 572 }
573 573
574 void FaviconCache::Observe(int type, 574 void FaviconCache::Observe(int type,
575 const content::NotificationSource& source, 575 const content::NotificationSource& source,
576 const content::NotificationDetails& details) { 576 const content::NotificationDetails& details) {
577 DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_DELETED); 577 DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_DELETED);
578 578
579 content::Details<history::URLsDeletedDetails> deleted_details(details); 579 content::Details<history::URLsDeletedDetails> deleted_details(details);
580 580
581 // We only care about actual user (or sync) deletions. 581 // We only care about actual user (or sync) deletions.
582 if (deleted_details->archived) 582 if (deleted_details->expired)
583 return; 583 return;
584 584
585 if (!deleted_details->all_history) { 585 if (!deleted_details->all_history) {
586 DeleteSyncedFavicons(deleted_details->favicon_urls); 586 DeleteSyncedFavicons(deleted_details->favicon_urls);
587 return; 587 return;
588 } 588 }
589 589
590 // All history was cleared: just delete all favicons. 590 // All history was cleared: just delete all favicons.
591 DVLOG(1) << "History clear detected, deleting all synced favicons."; 591 DVLOG(1) << "History clear detected, deleting all synced favicons.";
592 syncer::SyncChangeList image_deletions, tracking_deletions; 592 syncer::SyncChangeList image_deletions, tracking_deletions;
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 1058
1059 size_t FaviconCache::NumFaviconsForTest() const { 1059 size_t FaviconCache::NumFaviconsForTest() const {
1060 return synced_favicons_.size(); 1060 return synced_favicons_.size();
1061 } 1061 }
1062 1062
1063 size_t FaviconCache::NumTasksForTest() const { 1063 size_t FaviconCache::NumTasksForTest() const {
1064 return page_task_map_.size(); 1064 return page_task_map_.size();
1065 } 1065 }
1066 1066
1067 } // namespace browser_sync 1067 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698