OLD | NEW |
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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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)) { |
1606 thumbnail_db_->SetFaviconBitmapLastUpdateTime( | 1606 thumbnail_db_->SetFaviconBitmapLastUpdateTime( |
1607 bitmap_id_sizes[i].bitmap_id, base::Time::Now()); | 1607 bitmap_id_sizes[i].bitmap_id, base::Time::Now()); |
1608 bitmap_identical = true; | 1608 bitmap_identical = true; |
1609 } else { | 1609 } else { |
| 1610 // Expire the favicon bitmap because sync can provide incorrect |
| 1611 // |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 // user visits any page which uses |icon_url|. |
1610 thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id, | 1614 thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id, |
1611 bitmap_data, base::Time::Now()); | 1615 bitmap_data, base::Time()); |
1612 replaced_bitmap = true; | 1616 replaced_bitmap = true; |
1613 } | 1617 } |
1614 break; | 1618 break; |
1615 } | 1619 } |
1616 } | 1620 } |
1617 | 1621 |
1618 // Create a vector of the pixel sizes of the favicon bitmaps currently at | 1622 // Create a vector of the pixel sizes of the favicon bitmaps currently at |
1619 // |icon_url|. | 1623 // |icon_url|. |
1620 std::vector<gfx::Size> favicon_sizes; | 1624 std::vector<gfx::Size> favicon_sizes; |
1621 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) | 1625 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2635 return true; | 2639 return true; |
2636 } | 2640 } |
2637 | 2641 |
2638 HistoryClient* HistoryBackend::GetHistoryClient() { | 2642 HistoryClient* HistoryBackend::GetHistoryClient() { |
2639 if (history_client_) | 2643 if (history_client_) |
2640 history_client_->BlockUntilBookmarksLoaded(); | 2644 history_client_->BlockUntilBookmarksLoaded(); |
2641 return history_client_; | 2645 return history_client_; |
2642 } | 2646 } |
2643 | 2647 |
2644 } // namespace history | 2648 } // namespace history |
OLD | NEW |