Chromium Code Reviews| Index: chrome/browser/history/history_service.cc |
| diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc |
| index a4513e1d6037cedcced8d0df6d9adf32428c5d04..930a8a074ac151e342ed1f4d21dd74a26a37ac0e 100644 |
| --- a/chrome/browser/history/history_service.cc |
| +++ b/chrome/browser/history/history_service.cc |
| @@ -81,6 +81,13 @@ void RunWithFaviconResult(const favicon_base::FaviconRawCallback& callback, |
| callback.Run(*bitmap_result); |
| } |
| +void RunWithQueryURLResult(const HistoryService::QueryURLCallback& callback, |
| + bool* success, |
| + history::URLRow* url_row, |
| + history::VisitVector* visits) { |
| + callback.Run(*success, *url_row, *visits); |
| +} |
| + |
| // Extract history::URLRows into GURLs for VisitedLinkMaster. |
| class URLIteratorFromURLRows |
| : public visitedlink::VisitedLinkMaster::URLIterator { |
| @@ -703,14 +710,29 @@ void HistoryService::SetImportedFavicons( |
| &HistoryBackend::SetImportedFavicons, favicon_usage); |
| } |
| -HistoryService::Handle HistoryService::QueryURL( |
| +base::CancelableTaskTracker::TaskId HistoryService::QueryURL( |
| const GURL& url, |
| bool want_visits, |
| - CancelableRequestConsumerBase* consumer, |
| - const QueryURLCallback& callback) { |
| + const QueryURLCallback& callback, |
| + base::CancelableTaskTracker* tracker) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - return Schedule(PRIORITY_UI, &HistoryBackend::QueryURL, consumer, |
| - new history::QueryURLRequest(callback), url, want_visits); |
| + bool* success = new bool(false); |
| + history::URLRow* url_row = new history::URLRow(); |
| + history::VisitVector* visits = new history::VisitVector(); |
| + return tracker->PostTaskAndReply(thread_->message_loop_proxy().get(), |
|
blundell
2014/06/11 11:08:40
Could PostTaskAndReplyWithResult simplify the pas
sdefresne
2014/06/11 16:46:25
Done.
|
| + FROM_HERE, |
| + base::Bind(&HistoryBackend::QueryURL, |
| + history_backend_.get(), |
| + url, |
| + want_visits, |
| + success, |
| + url_row, |
| + visits), |
| + base::Bind(&RunWithQueryURLResult, |
| + callback, |
| + base::Owned(success), |
| + base::Owned(url_row), |
| + base::Owned(visits))); |
| } |
| // Downloads ------------------------------------------------------------------- |