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_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 void DeleteMatchingURLsForKeyword(KeywordID keyword_id, | 278 void DeleteMatchingURLsForKeyword(KeywordID keyword_id, |
279 const base::string16& term); | 279 const base::string16& term); |
280 | 280 |
281 #if defined(OS_ANDROID) | 281 #if defined(OS_ANDROID) |
282 // Android Provider --------------------------------------------------------- | 282 // Android Provider --------------------------------------------------------- |
283 | 283 |
284 // History and bookmarks ---------------------------------------------------- | 284 // History and bookmarks ---------------------------------------------------- |
285 void InsertHistoryAndBookmark(scoped_refptr<InsertRequest> request, | 285 void InsertHistoryAndBookmark(scoped_refptr<InsertRequest> request, |
286 const HistoryAndBookmarkRow& row); | 286 const HistoryAndBookmarkRow& row); |
287 | 287 |
288 void QueryHistoryAndBookmarks( | 288 // Runs the given query on history backend and returns the result. |
289 scoped_refptr<QueryRequest> request, | 289 // |
| 290 // |projections| is the vector of the result columns. |
| 291 // |selection| is the SQL WHERE clause without 'WHERE'. |
| 292 // |selection_args| is the arguments for WHERE clause. |
| 293 // |sort_order| is the SQL ORDER clause. |
| 294 history::AndroidStatement* QueryHistoryAndBookmarks( |
290 const std::vector<HistoryAndBookmarkRow::ColumnID>& projections, | 295 const std::vector<HistoryAndBookmarkRow::ColumnID>& projections, |
291 const std::string& selection, | 296 const std::string& selection, |
292 const std::vector<base::string16>& selection_args, | 297 const std::vector<base::string16>& selection_args, |
293 const std::string& sort_order); | 298 const std::string& sort_order); |
294 | 299 |
295 void UpdateHistoryAndBookmarks( | 300 void UpdateHistoryAndBookmarks( |
296 scoped_refptr<UpdateRequest> request, | 301 scoped_refptr<UpdateRequest> request, |
297 const HistoryAndBookmarkRow& row, | 302 const HistoryAndBookmarkRow& row, |
298 const std::string& selection, | 303 const std::string& selection, |
299 const std::vector<base::string16>& selection_args); | 304 const std::vector<base::string16>& selection_args); |
(...skipping 23 matching lines...) Expand all Loading... |
323 | 328 |
324 void UpdateSearchTerms(scoped_refptr<UpdateRequest> request, | 329 void UpdateSearchTerms(scoped_refptr<UpdateRequest> request, |
325 const SearchRow& row, | 330 const SearchRow& row, |
326 const std::string& selection, | 331 const std::string& selection, |
327 const std::vector<base::string16> selection_args); | 332 const std::vector<base::string16> selection_args); |
328 | 333 |
329 void DeleteSearchTerms(scoped_refptr<DeleteRequest> request, | 334 void DeleteSearchTerms(scoped_refptr<DeleteRequest> request, |
330 const std::string& selection, | 335 const std::string& selection, |
331 const std::vector<base::string16> selection_args); | 336 const std::vector<base::string16> selection_args); |
332 | 337 |
333 void QuerySearchTerms(scoped_refptr<QueryRequest> request, | 338 // Returns the result of the given query. |
334 const std::vector<SearchRow::ColumnID>& projections, | 339 // |
335 const std::string& selection, | 340 // |projections| specifies the result columns. |
336 const std::vector<base::string16>& selection_args, | 341 // |selection| is the SQL WHERE clause without 'WHERE'. |
337 const std::string& sort_order); | 342 // |selection_args| is the arguments for WHERE clause. |
| 343 // |sort_order| is the SQL ORDER clause. |
| 344 history::AndroidStatement* QuerySearchTerms( |
| 345 const std::vector<SearchRow::ColumnID>& projections, |
| 346 const std::string& selection, |
| 347 const std::vector<base::string16>& selection_args, |
| 348 const std::string& sort_order); |
338 | 349 |
339 #endif // defined(OS_ANDROID) | 350 #endif // defined(OS_ANDROID) |
340 | 351 |
341 // Generic operations -------------------------------------------------------- | 352 // Generic operations -------------------------------------------------------- |
342 | 353 |
343 void ProcessDBTask( | 354 void ProcessDBTask( |
344 scoped_refptr<HistoryDBTask> task, | 355 scoped_refptr<HistoryDBTask> task, |
345 scoped_refptr<base::SingleThreadTaskRunner> origin_loop, | 356 scoped_refptr<base::SingleThreadTaskRunner> origin_loop, |
346 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled); | 357 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled); |
347 | 358 |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 865 |
855 // Listens for the system being under memory pressure. | 866 // Listens for the system being under memory pressure. |
856 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 867 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
857 | 868 |
858 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 869 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
859 }; | 870 }; |
860 | 871 |
861 } // namespace history | 872 } // namespace history |
862 | 873 |
863 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 874 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |