OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/history/android/sqlite_cursor.h" | 5 #include "chrome/browser/history/android/sqlite_cursor.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 return false; | 200 return false; |
201 } | 201 } |
202 | 202 |
203 void SQLiteCursor::GetFaviconForIDInUIThread( | 203 void SQLiteCursor::GetFaviconForIDInUIThread( |
204 chrome::FaviconID id, | 204 chrome::FaviconID id, |
205 const FaviconService::FaviconRawCallback& callback) { | 205 const FaviconService::FaviconRawCallback& callback) { |
206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
207 if (!tracker_.get()) | 207 if (!tracker_.get()) |
208 tracker_.reset(new CancelableTaskTracker()); | 208 tracker_.reset(new base::CancelableTaskTracker()); |
209 favicon_service_->GetLargestRawFaviconForID(id, callback, tracker_.get()); | 209 favicon_service_->GetLargestRawFaviconForID(id, callback, tracker_.get()); |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 void SQLiteCursor::OnFaviconData( | 213 void SQLiteCursor::OnFaviconData( |
214 const chrome::FaviconBitmapResult& bitmap_result) { | 214 const chrome::FaviconBitmapResult& bitmap_result) { |
215 favicon_bitmap_result_ = bitmap_result; | 215 favicon_bitmap_result_ = bitmap_result; |
216 event_.Signal(); | 216 event_.Signal(); |
217 if (test_observer_) | 217 if (test_observer_) |
218 test_observer_->OnGetFaviconResult(); | 218 test_observer_->OnGetFaviconResult(); |
(...skipping 16 matching lines...) Expand all Loading... |
235 } | 235 } |
236 | 236 |
237 void SQLiteCursor::RunMoveStatementOnUIThread(int pos) { | 237 void SQLiteCursor::RunMoveStatementOnUIThread(int pos) { |
238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
239 if (!consumer_.get()) | 239 if (!consumer_.get()) |
240 consumer_.reset(new CancelableRequestConsumer()); | 240 consumer_.reset(new CancelableRequestConsumer()); |
241 service_->MoveStatement( | 241 service_->MoveStatement( |
242 statement_, position_, pos, consumer_.get(), | 242 statement_, position_, pos, consumer_.get(), |
243 base::Bind(&SQLiteCursor::OnMoved, base::Unretained(this))); | 243 base::Bind(&SQLiteCursor::OnMoved, base::Unretained(this))); |
244 } | 244 } |
OLD | NEW |