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

Unified Diff: chrome/browser/history/android/android_history_provider_service.h

Issue 368283003: Change AndroidHistoryProviderService to use CancelableTaskTracker (5/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.5
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
Index: chrome/browser/history/android/android_history_provider_service.h
diff --git a/chrome/browser/history/android/android_history_provider_service.h b/chrome/browser/history/android/android_history_provider_service.h
index 0c54ca06d2eacc532769649a5b7df3b8623f60d6..56949eef8c7294b68a7ccfc5c2cb23e50cc33366 100644
--- a/chrome/browser/history/android/android_history_provider_service.h
+++ b/chrome/browser/history/android/android_history_provider_service.h
@@ -29,12 +29,9 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
// complete. The pointer is NULL if the creation failed.
typedef base::Callback<void(history::AndroidStatement*)> QueryCallback;
- typedef base::Callback<void(
- Handle, // handle
- bool, // true if the update succeeded.
- int)> // the number of row updated.
- UpdateCallback;
- typedef CancelableRequest<UpdateCallback> UpdateRequest;
+ // Callback invoked when a method updating rows in the database complete.
+ // The parameter is the number of rows updated or 0 if the update failed.
+ typedef base::Callback<void(int)> UpdateCallback;
// Callback invoked when a method inserting rows in the database complete.
// The value is the new row id or 0 if the insertion failed.
@@ -75,12 +72,12 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
// |row| is the value to update.
// |selection| is the SQL WHERE clause without 'WHERE'.
// |selection_args| is the arguments for the WHERE clause.
- Handle UpdateHistoryAndBookmarks(
+ base::CancelableTaskTracker::TaskId UpdateHistoryAndBookmarks(
const history::HistoryAndBookmarkRow& row,
const std::string& selection,
const std::vector<base::string16>& selection_args,
- CancelableRequestConsumerBase* consumer,
- const UpdateCallback& callback);
+ const UpdateCallback& callback,
+ base::CancelableTaskTracker* tracker);
// Deletes the specified rows and invokes the |callback| to return the number
// of row deleted on success.
@@ -138,11 +135,12 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
// |row| is the value need to update.
// |selection| is the SQL WHERE clause without 'WHERE'.
// |selection_args| is the arguments for WHERE clause.
- Handle UpdateSearchTerms(const history::SearchRow& row,
- const std::string& selection,
- const std::vector<base::string16>& selection_args,
- CancelableRequestConsumerBase* consumer,
- const UpdateCallback& callback);
+ base::CancelableTaskTracker::TaskId UpdateSearchTerms(
+ const history::SearchRow& row,
+ const std::string& selection,
+ const std::vector<base::string16>& selection_args,
+ const UpdateCallback& callback,
+ base::CancelableTaskTracker* tracker);
// Deletes the matched rows and the number of deleted rows is returned to
// the |callback| on success.

Powered by Google App Engine
This is Rietveld 408576698