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

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

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
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 7752ef894c9db92f55633b3d0704c5782f9ae1c3..0c54ca06d2eacc532769649a5b7df3b8623f60d6 100644
--- a/chrome/browser/history/android/android_history_provider_service.h
+++ b/chrome/browser/history/android/android_history_provider_service.h
@@ -36,12 +36,9 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
UpdateCallback;
typedef CancelableRequest<UpdateCallback> UpdateRequest;
- typedef base::Callback<void(
- Handle, // handle
- bool, // true if the insert succeeded.
- int64)> // the id of inserted row.
- InsertCallback;
- typedef CancelableRequest<InsertCallback> InsertRequest;
+ // Callback invoked when a method inserting rows in the database complete.
+ // The value is the new row id or 0 if the insertion failed.
+ typedef base::Callback<void(int64)> InsertCallback;
typedef base::Callback<void(
Handle, // handle
@@ -100,9 +97,10 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
// Inserts the given values into history backend, and invokes the |callback|
// to return the result.
- Handle InsertHistoryAndBookmark(const history::HistoryAndBookmarkRow& values,
- CancelableRequestConsumerBase* consumer,
- const InsertCallback& callback);
+ base::CancelableTaskTracker::TaskId InsertHistoryAndBookmark(
+ const history::HistoryAndBookmarkRow& values,
+ const InsertCallback& callback,
+ base::CancelableTaskTracker* tracker);
// Deletes the matched history and invokes |callback| to return the number of
// the row deleted from the |callback|.
@@ -128,12 +126,13 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
// Search term --------------------------------------------------------------
// Inserts the given values and returns the SearchTermID of the inserted row
- // from the |callback| on success.
- Handle InsertSearchTerm(const history::SearchRow& row,
- CancelableRequestConsumerBase* consumer,
- const InsertCallback& callback);
+ // to the |callback| on success.
+ base::CancelableTaskTracker::TaskId InsertSearchTerm(
+ const history::SearchRow& row,
+ const InsertCallback& callback,
+ base::CancelableTaskTracker* tracker);
- // Runs the given update and returns the number of the update rows from the
+ // Runs the given update and returns the number of the update rows to the
// |callback| on success.
//
// |row| is the value need to update.
@@ -145,8 +144,9 @@ class AndroidHistoryProviderService : public CancelableRequestProvider {
CancelableRequestConsumerBase* consumer,
const UpdateCallback& callback);
- // Deletes the matched rows and the number of deleted rows is returned from
+ // Deletes the matched rows and the number of deleted rows is returned to
// the |callback| on success.
+ //
// |selection| is the SQL WHERE clause without 'WHERE'.
// |selection_args| is the arguments for WHERE clause.
//

Powered by Google App Engine
This is Rietveld 408576698