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

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

Issue 330703005: Revert of Change HistoryService::QueryURL to use CancelableTaskTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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_backend.h ('k') | chrome/browser/history/history_marshaling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index b2c0c69d47316b07f3748b8b4663814d6475321e..a3fb38f409a0820f40588c851b7b4924b3cd26af 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -152,14 +152,6 @@
scoped_refptr<HistoryBackend> history_backend_;
};
-// HistoryBackend::QueryURLResult ----------------------------------------------
-
-HistoryBackend::QueryURLResult::QueryURLResult() : success(false) {
-}
-
-HistoryBackend::QueryURLResult::~QueryURLResult() {
-}
-
// HistoryBackend --------------------------------------------------------------
HistoryBackend::HistoryBackend(const base::FilePath& history_dir,
@@ -996,15 +988,26 @@
return false;
}
-HistoryBackend::QueryURLResult HistoryBackend::QueryURL(const GURL& url,
- bool want_visits) {
- QueryURLResult result;
- result.success = db_ && db_->GetRowForURL(url, &result.row);
- // Optionally query the visits.
- if (result.success && want_visits) {
- db_->GetVisitsForURL(result.row.id(), &result.visits);
- }
- return result;
+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);
+ }
+ }
+ request->ForwardResult(request->handle(), success, row, visits);
}
TypedUrlSyncableService* HistoryBackend::GetTypedUrlSyncableService() const {
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_marshaling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698