diff options
Diffstat (limited to 'chrome/browser/history/history_backend.cc')
| -rw-r--r-- | chrome/browser/history/history_backend.cc | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index f9ef759..d9cac45 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -28,7 +28,6 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/url_constants.h" -#include "content/browser/cancelable_request.h" #include "content/browser/download/download_persistent_store_info.h" #include "googleurl/src/gurl.h" #include "grit/chromium_strings.h" @@ -1025,7 +1024,9 @@ void HistoryBackend::QuerySegmentUsage( NewRunnableMethod(this, &HistoryBackend::DeleteOldSegmentData)); } } - request->ForwardResult(request->handle(), &request->value.get()); + request->ForwardResult( + QuerySegmentUsageRequest::TupleType(request->handle(), + &request->value.get())); } // Keyword visits -------------------------------------------------------------- @@ -1078,7 +1079,9 @@ void HistoryBackend::GetMostRecentKeywordSearchTerms( db_->GetMostRecentKeywordSearchTerms(keyword_id, prefix, max_count, &(request->value)); } - request->ForwardResult(request->handle(), &request->value); + request->ForwardResult( + GetMostRecentKeywordSearchTermsRequest::TupleType(request->handle(), + &request->value)); } // Downloads ------------------------------------------------------------------- @@ -1091,7 +1094,7 @@ void HistoryBackend::GetNextDownloadId( } else { request->value = 0; } - request->ForwardResult(request->value); + request->ForwardResult(DownloadNextIdRequest::TupleType(request->value)); } // Get all the download entries from the database. @@ -1101,7 +1104,7 @@ void HistoryBackend::QueryDownloads( return; if (db_.get()) db_->QueryDownloads(&request->value); - request->ForwardResult(&request->value); + request->ForwardResult(DownloadQueryRequest::TupleType(&request->value)); } // Clean up entries that has been corrupted (because of the crash, for example). @@ -1137,7 +1140,7 @@ void HistoryBackend::CreateDownload( if (!request->canceled()) { if (db_.get()) db_handle = db_->CreateDownload(history_info); - request->ForwardResult(id, db_handle); + request->ForwardResult(DownloadCreateRequest::TupleType(id, db_handle)); } } @@ -1178,7 +1181,8 @@ void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, } } - request->ForwardResult(request->handle(), &request->value); + request->ForwardResult(QueryHistoryRequest::TupleType(request->handle(), + &request->value)); UMA_HISTOGRAM_TIMES("History.QueryHistory", TimeTicks::Now() - beginning_time); @@ -1296,7 +1300,8 @@ void HistoryBackend::QueryRedirectsFrom( if (request->canceled()) return; bool success = GetMostRecentRedirectsFrom(url, &request->value); - request->ForwardResult(request->handle(), url, success, &request->value); + request->ForwardResult(QueryRedirectsRequest::TupleType( + request->handle(), url, success, &request->value)); } void HistoryBackend::QueryRedirectsTo( @@ -1305,7 +1310,8 @@ void HistoryBackend::QueryRedirectsTo( if (request->canceled()) return; bool success = GetMostRecentRedirectsTo(url, &request->value); - request->ForwardResult(request->handle(), url, success, &request->value); + request->ForwardResult(QueryRedirectsRequest::TupleType( + request->handle(), url, success, &request->value)); } void HistoryBackend::GetVisibleVisitCountToHost( @@ -1317,7 +1323,8 @@ void HistoryBackend::GetVisibleVisitCountToHost( Time first_visit; const bool success = db_.get() && db_->GetVisibleVisitCountToHost(url, &count, &first_visit); - request->ForwardResult(request->handle(), success, count, first_visit); + request->ForwardResult(GetVisibleVisitCountToHostRequest::TupleType( + request->handle(), success, count, first_visit)); } void HistoryBackend::QueryTopURLsAndRedirects( @@ -1327,7 +1334,8 @@ void HistoryBackend::QueryTopURLsAndRedirects( return; if (!db_.get()) { - request->ForwardResult(request->handle(), false, NULL, NULL); + request->ForwardResult(QueryTopURLsAndRedirectsRequest::TupleType( + request->handle(), false, NULL, NULL)); return; } @@ -1345,7 +1353,8 @@ void HistoryBackend::QueryTopURLsAndRedirects( (*redirects)[top_urls->back()] = list; } - request->ForwardResult(request->handle(), true, top_urls, redirects); + request->ForwardResult(QueryTopURLsAndRedirectsRequest::TupleType( + request->handle(), true, top_urls, redirects)); } // Will replace QueryTopURLsAndRedirectsRequest. @@ -1358,13 +1367,15 @@ void HistoryBackend::QueryMostVisitedURLs( if (!db_.get()) { // No History Database - return an empty list. - request->ForwardResult(request->handle(), MostVisitedURLList()); + request->ForwardResult(QueryMostVisitedURLsRequest::TupleType( + request->handle(), MostVisitedURLList())); return; } MostVisitedURLList* result = &request->value; QueryMostVisitedURLsImpl(result_count, days_back, result); - request->ForwardResult(request->handle(), *result); + request->ForwardResult(QueryMostVisitedURLsRequest::TupleType( + request->handle(), *result)); } void HistoryBackend::QueryMostVisitedURLsImpl(int result_count, @@ -1499,7 +1510,8 @@ void HistoryBackend::GetPageThumbnail( scoped_refptr<RefCountedBytes> data; GetPageThumbnailDirectly(page_url, &data); - request->ForwardResult(request->handle(), data); + request->ForwardResult(GetPageThumbnailRequest::TupleType( + request->handle(), data)); } void HistoryBackend::GetPageThumbnailDirectly( @@ -1715,7 +1727,8 @@ void HistoryBackend::UpdateFaviconMappingAndFetchImpl( // else case, haven't cached entry yet. Caller is responsible for // downloading the favicon and invoking SetFavicon. } - request->ForwardResult(request->handle(), favicon); + request->ForwardResult(GetFaviconRequest::TupleType( + request->handle(), favicon)); } void HistoryBackend::GetFaviconForURL( @@ -1730,7 +1743,8 @@ void HistoryBackend::GetFaviconForURL( // Get the favicon from DB. GetFaviconFromDB(page_url, icon_types, &favicon); - request->ForwardResult(request->handle(), favicon); + request->ForwardResult( + GetFaviconRequest::TupleType(request->handle(), favicon)); } void HistoryBackend::SetFavicon( @@ -1913,7 +1927,7 @@ void HistoryBackend::ProcessDBTaskImpl() { db_task_requests_.pop_front(); if (request->value->RunOnDBThread(this, db_.get())) { // The task is done. Notify the callback. - request->ForwardResult(); + request->ForwardResult(HistoryDBTaskRequest::TupleType()); // We AddRef'd the request before adding, need to release it now. request->Release(); } else { @@ -1961,7 +1975,7 @@ void HistoryBackend::DeleteURL(const GURL& url) { } void HistoryBackend::ExpireHistoryBetween( - scoped_refptr<CancelableRequest<base::Closure> > request, + scoped_refptr<ExpireHistoryRequest> request, const std::set<GURL>& restrict_urls, Time begin_time, Time end_time) { @@ -1986,7 +2000,7 @@ void HistoryBackend::ExpireHistoryBetween( if (begin_time <= first_recorded_time_) db_->GetStartDate(&first_recorded_time_); - request->ForwardResult(); + request->ForwardResult(ExpireHistoryRequest::TupleType()); if (history_publisher_.get() && restrict_urls.empty()) history_publisher_->DeleteUserHistoryBetween(begin_time, end_time); |
