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

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..c31be84d70a646a16ce3eb4a96603e5719d1691d 100644
--- a/components/favicon/core/favicon_driver_impl.cc
+++ b/components/favicon/core/favicon_driver_impl.cc
@@ -98,9 +98,21 @@ 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) {
+#if !defined(IOS)
+ DCHECK_EQ(page_url, GetActiveURL());
+ // On iOS the active URL can change in between calls to FetchFavicon(). For
+ // instance, FetchFavicon() is not synchronously called when the active URL
+ // changes as a result of CRWSessionController::goToEntry().
+ // TODO(stuartmorgan): Enable the DCHECK on iOS once favicon fetches occur
+ // synchronously after active URL changes on iOS.
+#endif
+ if (page_url != GetActiveURL())
sky 2015/09/16 15:14:24 Shouldn't this be an a #else?
pkotwicz 2015/09/16 15:17:56 I still check this on non-IOS in the case that Fav
stuartmorgan 2015/09/16 18:35:58 It's explicitly against Chromium's style guide.
pkotwicz 2015/09/16 18:47:57 Fixed now. You are right it is specifically mentio
+ 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 +153,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