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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 // When a simple GetMostRecentRedirectsFrom() fails, this method is | 622 // When a simple GetMostRecentRedirectsFrom() fails, this method is |
623 // called which searches the last N visit sessions instead of just | 623 // called which searches the last N visit sessions instead of just |
624 // the current one. Returns true and puts thumbnail data in |data| | 624 // the current one. Returns true and puts thumbnail data in |data| |
625 // if a proper thumbnail was found. Returns false otherwise. Assumes | 625 // if a proper thumbnail was found. Returns false otherwise. Assumes |
626 // that this HistoryBackend object has been Init()ed successfully. | 626 // that this HistoryBackend object has been Init()ed successfully. |
627 bool GetThumbnailFromOlderRedirect( | 627 bool GetThumbnailFromOlderRedirect( |
628 const GURL& page_url, std::vector<unsigned char>* data); | 628 const GURL& page_url, std::vector<unsigned char>* data); |
629 | 629 |
630 // Querying ------------------------------------------------------------------ | 630 // Querying ------------------------------------------------------------------ |
631 | 631 |
632 // Backends for QueryHistory. *Basic() handles queries that are not FTS (full | 632 // Backends for QueryHistory. *Basic() handles queries that are not |
633 // text search) queries and can just be given directly to the history DB). | 633 // text search queries and can just be given directly to the history DB. |
634 // The FTS version queries the text_database, then merges with the history DB. | 634 // The *Text() version performs a brute force query of the history DB to |
| 635 // search for results which match the given text query. |
635 // Both functions assume QueryHistory already checked the DB for validity. | 636 // Both functions assume QueryHistory already checked the DB for validity. |
636 void QueryHistoryBasic(URLDatabase* url_db, VisitDatabase* visit_db, | 637 void QueryHistoryBasic(URLDatabase* url_db, VisitDatabase* visit_db, |
637 const QueryOptions& options, QueryResults* result); | 638 const QueryOptions& options, QueryResults* result); |
| 639 void QueryHistoryText(URLDatabase* url_db, |
| 640 VisitDatabase* visit_db, |
| 641 const string16& text_query, |
| 642 const QueryOptions& options, |
| 643 QueryResults* result); |
638 void QueryHistoryFTS(const string16& text_query, | 644 void QueryHistoryFTS(const string16& text_query, |
639 const QueryOptions& options, | 645 const QueryOptions& options, |
640 QueryResults* result); | 646 QueryResults* result); |
641 | 647 |
642 // Committing ---------------------------------------------------------------- | 648 // Committing ---------------------------------------------------------------- |
643 | 649 |
644 // We always keep a transaction open on the history database so that multiple | 650 // We always keep a transaction open on the history database so that multiple |
645 // transactions can be batched. Periodically, these are flushed (use | 651 // transactions can be batched. Periodically, these are flushed (use |
646 // ScheduleCommit). This function does the commit to write any new changes to | 652 // ScheduleCommit). This function does the commit to write any new changes to |
647 // disk and opens a new transaction. This will be called automatically by | 653 // disk and opens a new transaction. This will be called automatically by |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 // Used to manage syncing of the typed urls datatype. This will be NULL | 920 // Used to manage syncing of the typed urls datatype. This will be NULL |
915 // before Init is called. | 921 // before Init is called. |
916 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; | 922 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
917 | 923 |
918 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 924 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
919 }; | 925 }; |
920 | 926 |
921 } // namespace history | 927 } // namespace history |
922 | 928 |
923 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 929 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |