Chromium Code Reviews| Index: components/ntp_tiles/most_visited_sites.cc |
| diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc |
| index 47918739aca14ab147eb3cd8b53317b70c7b1cef..f1d8d7b11bf01b483b8277a61762ac1ff5789fd5 100644 |
| --- a/components/ntp_tiles/most_visited_sites.cc |
| +++ b/components/ntp_tiles/most_visited_sites.cc |
| @@ -169,6 +169,8 @@ void MostVisitedSites::BuildCurrentTiles() { |
| void MostVisitedSites::InitiateTopSitesQuery() { |
| if (!top_sites_) |
| return; |
| + if (weak_ptr_factory_.HasWeakPtrs()) |
|
sfiera
2016/12/16 16:15:03
This seems brittle—it assumes we won't ever use we
mastiz
2017/01/05 11:50:45
You have a point, but adding yet another state var
|
| + return; // Ongoing query. |
| top_sites_->GetMostVisitedURLs( |
| base::Bind(&MostVisitedSites::OnMostVisitedURLsAvailable, |
| weak_ptr_factory_.GetWeakPtr()), |