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

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

Issue 314293005: Change HistoryService::QueryURL to use CancelableTaskTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase & fix style errors 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
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 497f1aa5b023cff3adbd50ee2c9036f9b02b9fbb..76b479c9273c5a63d6177f7ed7bcc911ef5b26b4 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -990,26 +990,20 @@ bool HistoryBackend::GetURL(const GURL& url, history::URLRow* url_row) {
return false;
}
-void HistoryBackend::QueryURL(scoped_refptr<QueryURLRequest> request,
- const GURL& url,
- bool want_visits) {
- if (request->canceled())
- return;
-
- bool success = false;
- URLRow* row = &request->value.a;
- VisitVector* visits = &request->value.b;
- if (db_) {
- if (db_->GetRowForURL(url, row)) {
- // Have a row.
- success = true;
-
- // Optionally query the visits.
- if (want_visits)
- db_->GetVisitsForURL(row->id(), visits);
+void HistoryBackend::QueryURL(const GURL& url,
+ bool want_visits,
+ bool* success,
+ URLRow* url_row,
+ VisitVector* visits) {
+ DCHECK(success);
+ DCHECK(url_row);
+ DCHECK(!want_visits || visits);
+ if ((*success = db_ && db_->GetRowForURL(url, url_row))) {
+ // Optionally query the visits.
+ if (want_visits) {
+ db_->GetVisitsForURL(url_row->id(), visits);
}
}
- request->ForwardResult(request->handle(), success, row, visits);
}
TypedUrlSyncableService* HistoryBackend::GetTypedUrlSyncableService() const {

Powered by Google App Engine
This is Rietveld 408576698