| Index: chrome/browser/history/history_backend.cc
|
| diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
|
| index 6c6761fba314aedea32bcc239a257351b10dcc68..abf9178784a138ab8735aa675b389bfd14a24eaa 100644
|
| --- a/chrome/browser/history/history_backend.cc
|
| +++ b/chrome/browser/history/history_backend.cc
|
| @@ -152,6 +152,14 @@ class CommitLaterTask : public base::RefCounted<CommitLaterTask> {
|
| scoped_refptr<HistoryBackend> history_backend_;
|
| };
|
|
|
| +// HistoryBackend::QueryURLResult ----------------------------------------------
|
| +
|
| +HistoryBackend::QueryURLResult::QueryURLResult() : success(false) {
|
| +}
|
| +
|
| +HistoryBackend::QueryURLResult::~QueryURLResult() {
|
| +}
|
| +
|
| // HistoryBackend --------------------------------------------------------------
|
|
|
| HistoryBackend::HistoryBackend(const base::FilePath& history_dir,
|
| @@ -990,26 +998,15 @@ 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);
|
| - }
|
| +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);
|
| }
|
| - request->ForwardResult(request->handle(), success, row, visits);
|
| + return result;
|
| }
|
|
|
| TypedUrlSyncableService* HistoryBackend::GetTypedUrlSyncableService() const {
|
|
|