| Index: components/favicon/core/favicon_handler.h
|
| diff --git a/components/favicon/core/favicon_handler.h b/components/favicon/core/favicon_handler.h
|
| index 4850f3c936d9d59cd7b8dd9d11aed289deec3e91..4449d3548ce846e4424e439a3417595ee5879a22 100644
|
| --- a/components/favicon/core/favicon_handler.h
|
| +++ b/components/favicon/core/favicon_handler.h
|
| @@ -231,7 +231,9 @@ class FaviconHandler {
|
|
|
| // Return the current candidate if any.
|
| favicon::FaviconURL* current_candidate() {
|
| - return (!image_urls_.empty()) ? &image_urls_.front() : NULL;
|
| + return current_candidate_index_ < image_urls_.size()
|
| + ? &image_urls_[current_candidate_index_]
|
| + : nullptr;
|
| }
|
|
|
| // Returns the preferred size of the image. 0 means no preference (any size
|
| @@ -242,10 +244,9 @@ class FaviconHandler {
|
| return handler_type_ == FAVICON ? gfx::kFaviconSize : 0;
|
| }
|
|
|
| - // Sorts the entries in |image_urls_| by icon size in descending order.
|
| - // Additionally removes any entries whose sizes are all greater than the max
|
| - // allowed size.
|
| - void SortAndPruneImageUrls();
|
| + // Sorts the entries in |image_urls| by icon size in descending order.
|
| + // Discards all but the largest size for each FaviconURL.
|
| + void SortAndPruneImageUrls(std::vector<FaviconURL>* image_urls);
|
|
|
| // Used for FaviconService requests.
|
| base::CancelableTaskTracker cancelable_task_tracker_;
|
| @@ -288,6 +289,10 @@ class FaviconHandler {
|
| // This handler's driver, owns this object.
|
| FaviconDriver* driver_;
|
|
|
| + // The index of the favicon URL in |image_urls_| which is currently being
|
| + // requested from history or downloaded.
|
| + size_t current_candidate_index_;
|
| +
|
| // Best image we've seen so far. As images are downloaded from the page they
|
| // are stored here. When there is an exact match, or no more images are
|
| // available the favicon service and the current page are updated (assuming
|
|
|