Index: chrome/browser/history/android/android_history_provider_service.cc |
diff --git a/chrome/browser/history/android/android_history_provider_service.cc b/chrome/browser/history/android/android_history_provider_service.cc |
index 0f69d1eaefb873fd75eea72e4369cf6e4189312f..67e2c47c2a19d1ab69929283ac5a72940b35551e 100644 |
--- a/chrome/browser/history/android/android_history_provider_service.cc |
+++ b/chrome/browser/history/android/android_history_provider_service.cc |
@@ -126,25 +126,31 @@ AndroidHistoryProviderService::DeleteHistory( |
return request->handle(); |
} |
-AndroidHistoryProviderService::Handle |
+base::CancelableTaskTracker::TaskId |
AndroidHistoryProviderService::MoveStatement( |
history::AndroidStatement* statement, |
int current_pos, |
int destination, |
- CancelableRequestConsumerBase* consumer, |
- const MoveStatementCallback& callback) { |
- MoveStatementRequest* request = new MoveStatementRequest(callback); |
- AddRequest(request, consumer); |
+ const MoveStatementCallback& callback, |
+ base::CancelableTaskTracker* tracker) { |
HistoryService* hs = |
HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
if (hs) { |
- hs->Schedule(HistoryService::PRIORITY_NORMAL, |
- &HistoryBackend::MoveStatement, NULL, request, statement, |
- current_pos, destination); |
+ DCHECK(hs->thread_) << "History service being called after cleanup"; |
+ DCHECK(hs->thread_checker_.CalledOnValidThread()); |
+ return tracker->PostTaskAndReplyWithResult( |
+ hs->thread_->message_loop_proxy().get(), |
+ FROM_HERE, |
+ base::Bind(&HistoryBackend::MoveStatement, |
+ hs->history_backend_.get(), |
+ statement, |
+ current_pos, |
+ destination), |
+ callback); |
} else { |
- request->ForwardResultAsync(request->handle(), current_pos); |
+ callback.Run(current_pos); |
+ return base::CancelableTaskTracker::kBadTaskId; |
} |
- return request->handle(); |
} |
void AndroidHistoryProviderService::CloseStatement( |