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 |