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 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 // should match the sql query's projection name. | 129 // should match the sql query's projection name. |
130 // |statement| is query's statement which bound the variables. This class | 130 // |statement| is query's statement which bound the variables. This class |
131 // take the ownership of |statement|. | 131 // take the ownership of |statement|. |
132 SQLiteCursor(const std::vector<std::string>& column_names, | 132 SQLiteCursor(const std::vector<std::string>& column_names, |
133 history::AndroidStatement* statement, | 133 history::AndroidStatement* statement, |
134 AndroidHistoryProviderService* service, | 134 AndroidHistoryProviderService* service, |
135 FaviconService* favicon_service); | 135 FaviconService* favicon_service); |
136 | 136 |
137 virtual ~SQLiteCursor(); | 137 virtual ~SQLiteCursor(); |
138 | 138 |
139 void DestroyOnUIThread(); | |
sky
2013/06/03 17:48:25
Add a comment.
michaelbai
2013/06/03 22:25:37
Done.
| |
140 | |
141 | |
sky
2013/06/03 17:48:25
nit: remove one of these newlines.
michaelbai
2013/06/03 22:25:37
Done.
| |
139 // This method is for testing only. | 142 // This method is for testing only. |
140 void set_test_observer(TestObserver* test_observer) { | 143 void set_test_observer(TestObserver* test_observer) { |
141 test_observer_ = test_observer; | 144 test_observer_ = test_observer; |
142 } | 145 } |
143 | 146 |
144 // Get Favicon from history backend. | 147 // Get Favicon from history backend. |
145 bool GetFavicon(chrome::FaviconID id, | 148 bool GetFavicon(chrome::FaviconID id, |
146 std::vector<unsigned char>* image_data); | 149 std::vector<unsigned char>* image_data); |
147 | 150 |
148 void GetFaviconForIDInUIThread( | 151 void GetFaviconForIDInUIThread( |
149 chrome::FaviconID id, | 152 chrome::FaviconID id, |
150 const FaviconService::FaviconRawCallback& callback); | 153 const FaviconService::FaviconRawCallback& callback); |
151 | 154 |
152 // The callback function of FaviconService::GetLargestRawFaviconForID(). | 155 // The callback function of FaviconService::GetLargestRawFaviconForID(). |
153 void OnFaviconData(const chrome::FaviconBitmapResult& bitmap_result); | 156 void OnFaviconData(const chrome::FaviconBitmapResult& bitmap_result); |
154 | 157 |
155 // The callback function of MoveTo(). | 158 // The callback function of MoveTo(). |
156 void OnMoved(AndroidHistoryProviderService::Handle handle, int pos); | 159 void OnMoved(AndroidHistoryProviderService::Handle handle, int pos); |
157 | 160 |
158 // Used to cancel all request on the UI thread during shutdown. | 161 // Used to cancel all request on the UI thread during shutdown. |
159 void CancelAllRequests(base::WaitableEvent* finished); | 162 void CancelAllRequests(); |
160 | 163 |
161 JavaColumnType GetColumnTypeInternal(int column); | 164 JavaColumnType GetColumnTypeInternal(int column); |
162 | 165 |
163 // Runs the MoveStatement on UI thread. | 166 // Runs the MoveStatement on UI thread. |
164 void RunMoveStatementOnUIThread(int pos); | 167 void RunMoveStatementOnUIThread(int pos); |
165 | 168 |
166 // The current row position, '-1' means the position before the first one. | 169 // The current row position, '-1' means the position before the first one. |
167 int position_; | 170 int position_; |
168 | 171 |
169 base::WaitableEvent event_; | 172 base::WaitableEvent event_; |
(...skipping 17 matching lines...) Expand all Loading... | |
187 | 190 |
188 // The favicon image. | 191 // The favicon image. |
189 chrome::FaviconBitmapResult favicon_bitmap_result_; | 192 chrome::FaviconBitmapResult favicon_bitmap_result_; |
190 | 193 |
191 TestObserver* test_observer_; | 194 TestObserver* test_observer_; |
192 | 195 |
193 DISALLOW_COPY_AND_ASSIGN(SQLiteCursor); | 196 DISALLOW_COPY_AND_ASSIGN(SQLiteCursor); |
194 }; | 197 }; |
195 | 198 |
196 #endif // CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ | 199 #endif // CHROME_BROWSER_HISTORY_ANDROID_SQLITE_CURSOR_H_ |
OLD | NEW |