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

Unified Diff: components/favicon/core/favicon_driver_impl.cc

Issue 1272413002: Remove useless FaviconHandler::PageChangedSinceFaviconWasRequested() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/favicon/core/favicon_driver_impl.h ('k') | components/favicon/core/favicon_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/core/favicon_driver_impl.cc
diff --git a/components/favicon/core/favicon_driver_impl.cc b/components/favicon/core/favicon_driver_impl.cc
index 8135922832521166f1f7b34559f975c447d10da4..8896bd859360bc06f0c1e3e46deb317720b20a0a 100644
--- a/components/favicon/core/favicon_driver_impl.cc
+++ b/components/favicon/core/favicon_driver_impl.cc
@@ -98,9 +98,17 @@ bool FaviconDriverImpl::IsBookmarked(const GURL& url) {
return bookmark_model_ && bookmark_model_->IsBookmarked(url);
}
-void FaviconDriverImpl::OnFaviconAvailable(const gfx::Image& image,
+void FaviconDriverImpl::OnFaviconAvailable(const GURL& page_url,
const GURL& icon_url,
+ const gfx::Image& image,
bool is_active_favicon) {
+ // Check whether the active URL has changed since FetchFavicon() was called.
+ // On iOS only, the active URL can change between calls to FetchFavicon().
+ // For instance, FetchFavicon() is not synchronously called when the active
+ // URL changes as a result of CRWSessionController::goToEntry().
+ if (page_url != GetActiveURL())
+ return;
+
if (is_active_favicon) {
bool icon_url_changed = GetActiveFaviconURL() != icon_url;
// No matter what happens, we need to mark the favicon as being set.
@@ -141,13 +149,14 @@ void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url,
}
void FaviconDriverImpl::OnUpdateFaviconURL(
+ const GURL& page_url,
const std::vector<FaviconURL>& candidates) {
DCHECK(!candidates.empty());
- favicon_handler_->OnUpdateFaviconURL(candidates);
+ favicon_handler_->OnUpdateFaviconURL(page_url, candidates);
if (touch_icon_handler_.get())
- touch_icon_handler_->OnUpdateFaviconURL(candidates);
+ touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
if (large_icon_handler_.get())
- large_icon_handler_->OnUpdateFaviconURL(candidates);
+ large_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
}
} // namespace favicon
« no previous file with comments | « components/favicon/core/favicon_driver_impl.h ('k') | components/favicon/core/favicon_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698