| 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 #ifndef CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ |
| 6 #define CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ | 6 #define CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "base/task/cancelable_task_tracker.h" |
| 17 #include "chrome/browser/common/cancelable_request.h" | 18 #include "chrome/browser/common/cancelable_request.h" |
| 18 #include "chrome/browser/favicon/favicon_service.h" | 19 #include "chrome/browser/favicon/favicon_service.h" |
| 19 #include "chrome/browser/history/android/android_history_provider_service.h" | 20 #include "chrome/browser/history/android/android_history_provider_service.h" |
| 20 #include "chrome/browser/history/history_types.h" | 21 #include "chrome/browser/history/history_types.h" |
| 21 #include "chrome/common/cancelable_task_tracker.h" | |
| 22 | 22 |
| 23 // This class is JNI implementation of | 23 // This class is JNI implementation of |
| 24 // org.chromium.chrome.database.SqliteCursor, it uses the AndroidStatement to | 24 // org.chromium.chrome.database.SqliteCursor, it uses the AndroidStatement to |
| 25 // iterate among the result rows. This is not thread safe, all methods should | 25 // iterate among the result rows. This is not thread safe, all methods should |
| 26 // be called from the same non-UI thread which typical is the Java thread. | 26 // be called from the same non-UI thread which typical is the Java thread. |
| 27 // | 27 // |
| 28 // This class can not be in history namespace because the class name has to | 28 // This class can not be in history namespace because the class name has to |
| 29 // match to the generated sqlite_cursor_jni.h. | 29 // match to the generated sqlite_cursor_jni.h. |
| 30 class SQLiteCursor { | 30 class SQLiteCursor { |
| 31 public: | 31 public: |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 // Result set columns' name | 175 // Result set columns' name |
| 176 const std::vector<std::string> column_names_; | 176 const std::vector<std::string> column_names_; |
| 177 | 177 |
| 178 AndroidHistoryProviderService* service_; | 178 AndroidHistoryProviderService* service_; |
| 179 | 179 |
| 180 FaviconService* favicon_service_; | 180 FaviconService* favicon_service_; |
| 181 | 181 |
| 182 // Live on UI thread. | 182 // Live on UI thread. |
| 183 scoped_ptr<CancelableRequestConsumer> consumer_; | 183 scoped_ptr<CancelableRequestConsumer> consumer_; |
| 184 scoped_ptr<CancelableTaskTracker> tracker_; | 184 scoped_ptr<base::CancelableTaskTracker> tracker_; |
| 185 | 185 |
| 186 // The count of result rows. | 186 // The count of result rows. |
| 187 int count_; | 187 int count_; |
| 188 | 188 |
| 189 // The favicon image. | 189 // The favicon image. |
| 190 chrome::FaviconBitmapResult favicon_bitmap_result_; | 190 chrome::FaviconBitmapResult favicon_bitmap_result_; |
| 191 | 191 |
| 192 TestObserver* test_observer_; | 192 TestObserver* test_observer_; |
| 193 | 193 |
| 194 DISALLOW_COPY_AND_ASSIGN(SQLiteCursor); | 194 DISALLOW_COPY_AND_ASSIGN(SQLiteCursor); |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 #endif // CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ | 197 #endif // CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ |
| OLD | NEW |