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

Unified Diff: chrome/browser/history/android/sqlite_cursor.cc

Issue 366133003: Change AndroidHistoryProviderService to use CancelableTaskTracker (3/6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancelable_task_tracker.3
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 | « chrome/browser/history/android/sqlite_cursor.h ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/android/sqlite_cursor.cc
diff --git a/chrome/browser/history/android/sqlite_cursor.cc b/chrome/browser/history/android/sqlite_cursor.cc
index ded7dd09c1b32bce03a7bc18fe6463e6ae2fd870..1b536242bb0f10aaf78bd2b472d7367d3f1403b7 100644
--- a/chrome/browser/history/android/sqlite_cursor.cc
+++ b/chrome/browser/history/android/sqlite_cursor.cc
@@ -167,7 +167,6 @@ void SQLiteCursor::DestroyOnUIThread() {
// Consumer requests were set in the UI thread. They must be cancelled
// using the same thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- consumer_.reset();
tracker_.reset();
service_->CloseStatement(statement_);
delete this;
@@ -218,8 +217,7 @@ void SQLiteCursor::OnFaviconData(
test_observer_->OnGetFaviconResult();
}
-void SQLiteCursor::OnMoved(AndroidHistoryProviderService::Handle handle,
- int pos) {
+void SQLiteCursor::OnMoved(int pos) {
position_ = pos;
event_.Signal();
if (test_observer_)
@@ -236,9 +234,12 @@ SQLiteCursor::JavaColumnType SQLiteCursor::GetColumnTypeInternal(int column) {
void SQLiteCursor::RunMoveStatementOnUIThread(int pos) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (!consumer_.get())
- consumer_.reset(new CancelableRequestConsumer());
+ if (!tracker_.get())
+ tracker_.reset(new base::CancelableTaskTracker());
service_->MoveStatement(
- statement_, position_, pos, consumer_.get(),
- base::Bind(&SQLiteCursor::OnMoved, base::Unretained(this)));
+ statement_,
+ position_,
+ pos,
+ base::Bind(&SQLiteCursor::OnMoved, base::Unretained(this)),
+ tracker_.get());
}
« no previous file with comments | « chrome/browser/history/android/sqlite_cursor.h ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698