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

Side by Side Diff: components/history/core/browser/history_backend.cc

Issue 1128343004: Allow favicons for synced bookmarks to expire (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 1595
1596 std::vector<FaviconBitmapIDSize> bitmap_id_sizes; 1596 std::vector<FaviconBitmapIDSize> bitmap_id_sizes;
1597 thumbnail_db_->GetFaviconBitmapIDSizes(favicon_id, &bitmap_id_sizes); 1597 thumbnail_db_->GetFaviconBitmapIDSizes(favicon_id, &bitmap_id_sizes);
1598 1598
1599 // If there is already a favicon bitmap of |pixel_size| at |icon_url|, 1599 // If there is already a favicon bitmap of |pixel_size| at |icon_url|,
1600 // replace it. 1600 // replace it.
1601 bool bitmap_identical = false; 1601 bool bitmap_identical = false;
1602 bool replaced_bitmap = false; 1602 bool replaced_bitmap = false;
1603 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) { 1603 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) {
1604 if (bitmap_id_sizes[i].pixel_size == pixel_size) { 1604 if (bitmap_id_sizes[i].pixel_size == pixel_size) {
1605 if (IsFaviconBitmapDataEqual(bitmap_id_sizes[i].bitmap_id, bitmap_data)) { 1605 if (IsFaviconBitmapDataEqual(bitmap_id_sizes[i].bitmap_id, bitmap_data)) {
sky 2015/05/18 17:15:20 How about a comment as to why this doesn't update
1606 thumbnail_db_->SetFaviconBitmapLastUpdateTime( 1606 // TODO: Pass in boolean to MergeFavicon() if any users of
1607 bitmap_id_sizes[i].bitmap_id, base::Time::Now()); 1607 // MergeFavicon() want the last_updated time to be updated when the new
1608 // bitmap data is identical to the old.
1608 bitmap_identical = true; 1609 bitmap_identical = true;
1609 } else { 1610 } else {
1610 // Expire the favicon bitmap because sync can provide incorrect 1611 // Expire the favicon bitmap because sync can provide incorrect
1611 // |bitmap_data|. See crbug.com/474421 for more details. Expiring the 1612 // |bitmap_data|. See crbug.com/474421 for more details. Expiring the
1612 // favicon bitmap causes it to be redownloaded the next time that the 1613 // favicon bitmap causes it to be redownloaded the next time that the
1613 // user visits any page which uses |icon_url|. 1614 // user visits any page which uses |icon_url|.
1614 thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id, 1615 thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id,
1615 bitmap_data, base::Time()); 1616 bitmap_data, base::Time());
1616 replaced_bitmap = true; 1617 replaced_bitmap = true;
1617 } 1618 }
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 return true; 2640 return true;
2640 } 2641 }
2641 2642
2642 HistoryClient* HistoryBackend::GetHistoryClient() { 2643 HistoryClient* HistoryBackend::GetHistoryClient() {
2643 if (history_client_) 2644 if (history_client_)
2644 history_client_->BlockUntilBookmarksLoaded(); 2645 history_client_->BlockUntilBookmarksLoaded();
2645 return history_client_; 2646 return history_client_;
2646 } 2647 }
2647 2648
2648 } // namespace history 2649 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698