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

Unified Diff: chrome/browser/android/provider/chrome_browser_provider.cc

Issue 370533003: Change AndroidHistoryProviderService to use CancelableTaskTracker (6/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.6
Patch Set: Fix unit tests Created 6 years, 5 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 | « no previous file | chrome/browser/history/android/android_history_provider_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/provider/chrome_browser_provider.cc
diff --git a/chrome/browser/android/provider/chrome_browser_provider.cc b/chrome/browser/android/provider/chrome_browser_provider.cc
index 904acc84602bd31d8d8f8f1139543f7d7f68dea5..419a860cb5dc27cc07cd593ca4ea80055aacd1ee 100644
--- a/chrome/browser/android/provider/chrome_browser_provider.cc
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc
@@ -851,17 +851,17 @@ class RemoveBookmarksFromAPITask : public HistoryProviderTask {
const std::vector<base::string16>& selection_args) {
RunAsyncRequestOnUIThreadBlocking(
base::Bind(&AndroidHistoryProviderService::DeleteHistoryAndBookmarks,
- base::Unretained(service()), selection, selection_args,
- cancelable_consumer(),
+ base::Unretained(service()),
+ selection,
+ selection_args,
base::Bind(&RemoveBookmarksFromAPITask::OnBookmarksRemoved,
- base::Unretained(this))));
+ base::Unretained(this)),
+ cancelable_tracker()));
return result_;
}
private:
- void OnBookmarksRemoved(AndroidHistoryProviderService::Handle handle,
- bool succeeded,
- int removed_row_count) {
+ void OnBookmarksRemoved(int removed_row_count) {
result_ = removed_row_count;
RequestCompleted();
}
@@ -884,17 +884,17 @@ class RemoveHistoryFromAPITask : public HistoryProviderTask {
const std::vector<base::string16>& selection_args) {
RunAsyncRequestOnUIThreadBlocking(
base::Bind(&AndroidHistoryProviderService::DeleteHistory,
- base::Unretained(service()), selection,
- selection_args, cancelable_consumer(),
+ base::Unretained(service()),
+ selection,
+ selection_args,
base::Bind(&RemoveHistoryFromAPITask::OnHistoryRemoved,
- base::Unretained(this))));
+ base::Unretained(this)),
+ cancelable_tracker()));
return result_;
}
private:
- void OnHistoryRemoved(AndroidHistoryProviderService::Handle handle,
- bool succeeded,
- int removed_row_count) {
+ void OnHistoryRemoved(int removed_row_count) {
result_ = removed_row_count;
RequestCompleted();
}
@@ -1094,20 +1094,19 @@ class RemoveSearchTermsFromAPITask : public SearchTermTask {
int Run(const std::string& selection,
const std::vector<base::string16>& selection_args) {
- RunAsyncRequestOnUIThreadBlocking(
- base::Bind(&AndroidHistoryProviderService::DeleteSearchTerms,
- base::Unretained(service()), selection, selection_args,
- cancelable_consumer(),
- base::Bind(
- &RemoveSearchTermsFromAPITask::OnSearchTermsDeleted,
- base::Unretained(this))));
+ RunAsyncRequestOnUIThreadBlocking(base::Bind(
+ &AndroidHistoryProviderService::DeleteSearchTerms,
+ base::Unretained(service()),
+ selection,
+ selection_args,
+ base::Bind(&RemoveSearchTermsFromAPITask::OnSearchTermsDeleted,
+ base::Unretained(this)),
+ cancelable_tracker()));
return result_;
}
private:
- void OnSearchTermsDeleted(AndroidHistoryProviderService::Handle handle,
- bool succeeded,
- int deleted_row_count) {
+ void OnSearchTermsDeleted(int deleted_row_count) {
result_ = deleted_row_count;
RequestCompleted();
}
« no previous file with comments | « no previous file | chrome/browser/history/android/android_history_provider_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698