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

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

Issue 351363002: Revert of Port HistoryService::GetVisibleVisitCountToHost to CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_types.h » ('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 7e52b66f234471158e16171d46133a3c12e681b1..294bc75be92fb34800b25b9dadb205b94c6c6d7d 100644
--- a/chrome/browser/history/history_service.cc
+++ b/chrome/browser/history/history_service.cc
@@ -88,12 +88,6 @@
callback.Run(result->success, result->row, result->visits);
}
-void RunWithVisibleVisitCountToHostResult(
- const HistoryService::GetVisibleVisitCountToHostCallback& callback,
- const history::VisibleVisitCountToHostResult* result) {
- callback.Run(result->success, result->count, result->first_visit);
-}
-
// Extract history::URLRows into GURLs for VisitedLinkMaster.
class URLIteratorFromURLRows
: public visitedlink::VisitedLinkMaster::URLIterator {
@@ -835,23 +829,13 @@
base::Bind(callback, base::Owned(result)));
}
-base::CancelableTaskTracker::TaskId HistoryService::GetVisibleVisitCountToHost(
+HistoryService::Handle HistoryService::GetVisibleVisitCountToHost(
const GURL& url,
- const GetVisibleVisitCountToHostCallback& callback,
- base::CancelableTaskTracker* tracker) {
- DCHECK(thread_checker_.CalledOnValidThread());
- history::VisibleVisitCountToHostResult* result =
- new history::VisibleVisitCountToHostResult();
- return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::GetVisibleVisitCountToHost,
- history_backend_.get(),
- url,
- base::Unretained(result)),
- base::Bind(&RunWithVisibleVisitCountToHostResult,
- callback,
- base::Owned(result)));
+ CancelableRequestConsumerBase* consumer,
+ const GetVisibleVisitCountToHostCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return Schedule(PRIORITY_UI, &HistoryBackend::GetVisibleVisitCountToHost,
+ consumer, new history::GetVisibleVisitCountToHostRequest(callback), url);
}
HistoryService::Handle HistoryService::QueryTopURLsAndRedirects(
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698