| 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..6f5504cf5792fe285357ef8244b746727b91b821 100644
|
| --- a/components/ntp_tiles/most_visited_sites.cc
|
| +++ b/components/ntp_tiles/most_visited_sites.cc
|
| @@ -63,7 +63,7 @@ MostVisitedSites::MostVisitedSites(
|
| num_sites_(0),
|
| top_sites_observer_(this),
|
| mv_source_(NTPTileSource::TOP_SITES),
|
| - weak_ptr_factory_(this) {
|
| + top_sites_weak_ptr_factory_(this) {
|
| DCHECK(prefs_);
|
| // top_sites_ can be null in tests.
|
| // TODO(sfiera): have iOS use a dummy TopSites in its tests.
|
| @@ -169,9 +169,11 @@ void MostVisitedSites::BuildCurrentTiles() {
|
| void MostVisitedSites::InitiateTopSitesQuery() {
|
| if (!top_sites_)
|
| return;
|
| + if (top_sites_weak_ptr_factory_.HasWeakPtrs())
|
| + return; // Ongoing query.
|
| top_sites_->GetMostVisitedURLs(
|
| base::Bind(&MostVisitedSites::OnMostVisitedURLsAvailable,
|
| - weak_ptr_factory_.GetWeakPtr()),
|
| + top_sites_weak_ptr_factory_.GetWeakPtr()),
|
| false);
|
| }
|
|
|
|
|