Chromium Code Reviews| Index: chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc |
| diff --git a/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc b/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc |
| index 717add4f1f2563ea7d93acdae333abcef69d8ca4..3cfe6e339751298781f43a4aa029d331eb6f5f48 100644 |
| --- a/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc |
| +++ b/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc |
| @@ -61,7 +61,7 @@ void SuggestionsSourceTopSites::FetchItems(Profile* profile) { |
| DCHECK(combiner_); |
| STLDeleteElements(&items_); |
| - history_consumer_.CancelAllRequests(); |
| + history_tracker_.TryCancelAll(); |
| HistoryService* history = HistoryServiceFactory::GetForProfile( |
| profile, Profile::EXPLICIT_ACCESS); |
| // |history| may be null during unit tests. |
| @@ -71,9 +71,13 @@ void SuggestionsSourceTopSites::FetchItems(Profile* profile) { |
| time_filter.SetFilterWidth(GetFilterWidth()); |
| time_filter.set_sorting_order(GetSortingOrder()); |
| - history->QueryFilteredURLs(0, time_filter, debug_, &history_consumer_, |
| + history->QueryFilteredURLs( |
| + 0, |
| + time_filter, |
| + debug_, |
| base::Bind(&SuggestionsSourceTopSites::OnSuggestionsUrlsAvailable, |
| - base::Unretained(this))); |
| + base::Unretained(this)), |
| + &history_tracker_); |
| } |
| } |
| @@ -83,11 +87,13 @@ void SuggestionsSourceTopSites::SetCombiner(SuggestionsCombiner* combiner) { |
| } |
| void SuggestionsSourceTopSites::OnSuggestionsUrlsAvailable( |
| - CancelableRequestProvider::Handle handle, |
| - const history::FilteredURLList& data) { |
| + const history::FilteredURLList* data) { |
| + DCHECK(data); |
| DCHECK(combiner_); |
| - for (size_t i = 0; i < data.size(); i++) { |
| - const history::FilteredURL& suggested_url = data[i]; |
| + for (history::FilteredURLList::const_iterator iter = data->begin(); |
| + iter != data->end(); |
| + ++iter) { |
| + const history::FilteredURL& suggested_url = *iter; |
|
Dan Beam
2014/06/26 03:47:33
nit: revert this hunk, data[i] -> (*data)[i]
sdefresne
2014/06/28 07:59:47
Done.
|
| if (suggested_url.url.is_empty()) |
| continue; |