| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // Returns the number of row updated by the update query. | 304 // Returns the number of row updated by the update query. |
| 305 // | 305 // |
| 306 // |row| is the value to update. | 306 // |row| is the value to update. |
| 307 // |selection| is the SQL WHERE clause without 'WHERE'. | 307 // |selection| is the SQL WHERE clause without 'WHERE'. |
| 308 // |selection_args| is the arguments for the WHERE clause. | 308 // |selection_args| is the arguments for the WHERE clause. |
| 309 int UpdateHistoryAndBookmarks( | 309 int UpdateHistoryAndBookmarks( |
| 310 const HistoryAndBookmarkRow& row, | 310 const HistoryAndBookmarkRow& row, |
| 311 const std::string& selection, | 311 const std::string& selection, |
| 312 const std::vector<base::string16>& selection_args); | 312 const std::vector<base::string16>& selection_args); |
| 313 | 313 |
| 314 void DeleteHistoryAndBookmarks( | 314 // Deletes the specified rows and returns the number of rows deleted. |
| 315 scoped_refptr<DeleteRequest> request, | 315 // |
| 316 // |selection| is the SQL WHERE clause without 'WHERE'. |
| 317 // |selection_args| is the arguments for the WHERE clause. |
| 318 // |
| 319 // If |selection| is empty all history and bookmarks are deleted. |
| 320 int DeleteHistoryAndBookmarks( |
| 316 const std::string& selection, | 321 const std::string& selection, |
| 317 const std::vector<base::string16>& selection_args); | 322 const std::vector<base::string16>& selection_args); |
| 318 | 323 |
| 319 void DeleteHistory(scoped_refptr<DeleteRequest> request, | 324 // Deletes the matched history and returns the number of rows deleted. |
| 320 const std::string& selection, | 325 int DeleteHistory(const std::string& selection, |
| 321 const std::vector<base::string16>& selection_args); | 326 const std::vector<base::string16>& selection_args); |
| 322 | 327 |
| 323 // Statement ---------------------------------------------------------------- | 328 // Statement ---------------------------------------------------------------- |
| 324 // Move the statement's current position. | 329 // Move the statement's current position. |
| 325 int MoveStatement(history::AndroidStatement* statement, | 330 int MoveStatement(history::AndroidStatement* statement, |
| 326 int current_pos, | 331 int current_pos, |
| 327 int destination); | 332 int destination); |
| 328 | 333 |
| 329 // Close the given statement. The ownership is transfered. | 334 // Close the given statement. The ownership is transfered. |
| 330 void CloseStatement(AndroidStatement* statement); | 335 void CloseStatement(AndroidStatement* statement); |
| 331 | 336 |
| 332 // Search terms ------------------------------------------------------------- | 337 // Search terms ------------------------------------------------------------- |
| 333 // Inserts the given values and returns the SearchTermID of the inserted row. | 338 // Inserts the given values and returns the SearchTermID of the inserted row. |
| 334 SearchTermID InsertSearchTerm(const SearchRow& row); | 339 SearchTermID InsertSearchTerm(const SearchRow& row); |
| 335 | 340 |
| 336 // Returns the number of row updated by the update query. | 341 // Returns the number of row updated by the update query. |
| 337 // | 342 // |
| 338 // |row| is the value to update. | 343 // |row| is the value to update. |
| 339 // |selection| is the SQL WHERE clause without 'WHERE'. | 344 // |selection| is the SQL WHERE clause without 'WHERE'. |
| 340 // |selection_args| is the arguments for the WHERE clause. | 345 // |selection_args| is the arguments for the WHERE clause. |
| 341 int UpdateSearchTerms(const SearchRow& row, | 346 int UpdateSearchTerms(const SearchRow& row, |
| 342 const std::string& selection, | 347 const std::string& selection, |
| 343 const std::vector<base::string16> selection_args); | 348 const std::vector<base::string16> selection_args); |
| 344 | 349 |
| 345 void DeleteSearchTerms(scoped_refptr<DeleteRequest> request, | 350 // Deletes the matched rows and returns the number of deleted rows. |
| 346 const std::string& selection, | 351 // |
| 347 const std::vector<base::string16> selection_args); | 352 // |selection| is the SQL WHERE clause without 'WHERE'. |
| 353 // |selection_args| is the arguments for WHERE clause. |
| 354 // |
| 355 // If |selection| is empty all search terms will be deleted. |
| 356 int DeleteSearchTerms(const std::string& selection, |
| 357 const std::vector<base::string16> selection_args); |
| 348 | 358 |
| 349 // Returns the result of the given query. | 359 // Returns the result of the given query. |
| 350 // | 360 // |
| 351 // |projections| specifies the result columns. | 361 // |projections| specifies the result columns. |
| 352 // |selection| is the SQL WHERE clause without 'WHERE'. | 362 // |selection| is the SQL WHERE clause without 'WHERE'. |
| 353 // |selection_args| is the arguments for WHERE clause. | 363 // |selection_args| is the arguments for WHERE clause. |
| 354 // |sort_order| is the SQL ORDER clause. | 364 // |sort_order| is the SQL ORDER clause. |
| 355 history::AndroidStatement* QuerySearchTerms( | 365 history::AndroidStatement* QuerySearchTerms( |
| 356 const std::vector<SearchRow::ColumnID>& projections, | 366 const std::vector<SearchRow::ColumnID>& projections, |
| 357 const std::string& selection, | 367 const std::string& selection, |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 | 886 |
| 877 // Listens for the system being under memory pressure. | 887 // Listens for the system being under memory pressure. |
| 878 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 888 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 879 | 889 |
| 880 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 890 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 881 }; | 891 }; |
| 882 | 892 |
| 883 } // namespace history | 893 } // namespace history |
| 884 | 894 |
| 885 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 895 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |