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

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

Issue 365133003: Change AndroidHistoryProviderService to use CancelableTaskTracker (4/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.4
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 b4827da0d8d3ce5aa808dd1454e854c48fd22403..b50528be5b9318ea9aef150a671929406b3e57b5 100644
--- a/chrome/browser/android/provider/chrome_browser_provider.cc
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc
@@ -744,17 +744,17 @@ class AddBookmarkFromAPITask : public HistoryProviderTask {
history::URLID Run(const history::HistoryAndBookmarkRow& row) {
RunAsyncRequestOnUIThreadBlocking(
base::Bind(&AndroidHistoryProviderService::InsertHistoryAndBookmark,
- base::Unretained(service()), row, cancelable_consumer(),
+ base::Unretained(service()),
+ row,
base::Bind(&AddBookmarkFromAPITask::OnBookmarkInserted,
- base::Unretained(this))));
+ base::Unretained(this)),
+ cancelable_tracker()));
return result_;
}
private:
- void OnBookmarkInserted(AndroidHistoryProviderService::Handle handle,
- bool succeeded,
- history::URLID id) {
- // Note that here 0 means an invalid id too.
+ void OnBookmarkInserted(history::URLID id) {
+ // Note that here 0 means an invalid id.
// This is because it represents a SQLite database row id.
result_ = id;
RequestCompleted();
@@ -967,15 +967,15 @@ class AddSearchTermFromAPITask : public SearchTermTask {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
history::SearchRow internal_row = row;
BuildSearchRow(&internal_row);
- service()->InsertSearchTerm(internal_row, cancelable_consumer(),
+ service()->InsertSearchTerm(
+ internal_row,
base::Bind(&AddSearchTermFromAPITask::OnSearchTermInserted,
- base::Unretained(this)));
+ base::Unretained(this)),
+ cancelable_tracker());
}
- void OnSearchTermInserted(AndroidHistoryProviderService::Handle handle,
- bool succeeded,
- history::URLID id) {
- // Note that here 0 means an invalid id too.
+ void OnSearchTermInserted(history::URLID id) {
+ // Note that here 0 means an invalid id.
// This is because it represents a SQLite database row id.
result_ = id;
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