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

Unified Diff: chrome/browser/history/history_service.cc

Issue 352623002: Port History::QueryMostVisitedURLs to use CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 | « chrome/browser/history/history_service.h ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_service.cc
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
index 0cc6fc20997c571898590fc576604aba304f3f65..14824a1ea0e36dc1a9ccea6cc40b4a4a1ecc15de 100644
--- a/chrome/browser/history/history_service.cc
+++ b/chrome/browser/history/history_service.cc
@@ -825,16 +825,22 @@ HistoryService::Handle HistoryService::GetVisibleVisitCountToHost(
consumer, new history::GetVisibleVisitCountToHostRequest(callback), url);
}
-HistoryService::Handle HistoryService::QueryMostVisitedURLs(
+base::CancelableTaskTracker::TaskId HistoryService::QueryMostVisitedURLs(
int result_count,
int days_back,
- CancelableRequestConsumerBase* consumer,
- const QueryMostVisitedURLsCallback& callback) {
+ const QueryMostVisitedURLsCallback& callback,
+ base::CancelableTaskTracker* tracker) {
DCHECK(thread_checker_.CalledOnValidThread());
- return Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryMostVisitedURLs,
- consumer,
- new history::QueryMostVisitedURLsRequest(callback),
- result_count, days_back);
+ history::MostVisitedURLList* result = new history::MostVisitedURLList();
+ return tracker->PostTaskAndReply(
+ thread_->message_loop_proxy().get(),
+ FROM_HERE,
+ base::Bind(&HistoryBackend::QueryMostVisitedURLs,
+ history_backend_.get(),
+ result_count,
+ days_back,
+ base::Unretained(result)),
+ base::Bind(callback, base::Owned(result)));
}
HistoryService::Handle HistoryService::QueryFilteredURLs(
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698