| 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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // | 181 // |
| 182 // This constructor is fast and does no I/O, so can be called at any time. | 182 // This constructor is fast and does no I/O, so can be called at any time. |
| 183 HistoryBackend(Delegate* delegate, | 183 HistoryBackend(Delegate* delegate, |
| 184 scoped_ptr<HistoryBackendClient> backend_client, | 184 scoped_ptr<HistoryBackendClient> backend_client, |
| 185 scoped_refptr<base::SequencedTaskRunner> task_runner); | 185 scoped_refptr<base::SequencedTaskRunner> task_runner); |
| 186 | 186 |
| 187 // Must be called after creation but before any objects are created. If this | 187 // Must be called after creation but before any objects are created. If this |
| 188 // fails, all other functions will fail as well. (Since this runs on another | 188 // fails, all other functions will fail as well. (Since this runs on another |
| 189 // thread, we don't bother returning failure.) | 189 // thread, we don't bother returning failure.) |
| 190 // | 190 // |
| 191 // |languages| gives a list of language encodings with which the history | |
| 192 // URLs and omnibox searches are interpreted. | |
| 193 // |force_fail| can be set during unittests to unconditionally fail to init. | 191 // |force_fail| can be set during unittests to unconditionally fail to init. |
| 194 void Init(const std::string& languages, | 192 void Init(bool force_fail, |
| 195 bool force_fail, | |
| 196 const HistoryDatabaseParams& history_database_params); | 193 const HistoryDatabaseParams& history_database_params); |
| 197 | 194 |
| 198 // Notification that the history system is shutting down. This will break | 195 // Notification that the history system is shutting down. This will break |
| 199 // the refs owned by the delegate and any pending transaction so it will | 196 // the refs owned by the delegate and any pending transaction so it will |
| 200 // actually be deleted. | 197 // actually be deleted. |
| 201 void Closing(); | 198 void Closing(); |
| 202 | 199 |
| 203 #if defined(OS_IOS) | 200 #if defined(OS_IOS) |
| 204 // Persists any in-flight state, without actually shutting down the history | 201 // Persists any in-flight state, without actually shutting down the history |
| 205 // system. This is intended for use when the application is backgrounded. | 202 // system. This is intended for use when the application is backgrounded. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 base::FilePath GetThumbnailFileName() const; | 569 base::FilePath GetThumbnailFileName() const; |
| 573 | 570 |
| 574 // Returns the name of the Favicons database. This is the new name | 571 // Returns the name of the Favicons database. This is the new name |
| 575 // of the Thumbnails database. | 572 // of the Thumbnails database. |
| 576 base::FilePath GetFaviconsFileName() const; | 573 base::FilePath GetFaviconsFileName() const; |
| 577 | 574 |
| 578 class URLQuerier; | 575 class URLQuerier; |
| 579 friend class URLQuerier; | 576 friend class URLQuerier; |
| 580 | 577 |
| 581 // Does the work of Init. | 578 // Does the work of Init. |
| 582 void InitImpl(const std::string& languages, | 579 void InitImpl(const HistoryDatabaseParams& history_database_params); |
| 583 const HistoryDatabaseParams& history_database_params); | |
| 584 | 580 |
| 585 // Called when the system is under memory pressure. | 581 // Called when the system is under memory pressure. |
| 586 void OnMemoryPressure( | 582 void OnMemoryPressure( |
| 587 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 583 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| 588 | 584 |
| 589 // Closes all databases managed by HistoryBackend. Commits any pending | 585 // Closes all databases managed by HistoryBackend. Commits any pending |
| 590 // transactions. | 586 // transactions. |
| 591 void CloseAllDatabases(); | 587 void CloseAllDatabases(); |
| 592 | 588 |
| 593 // Adds a single visit to the database, updating the URL information such | 589 // Adds a single visit to the database, updating the URL information such |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 | 887 |
| 892 // List of observers | 888 // List of observers |
| 893 base::ObserverList<HistoryBackendObserver> observers_; | 889 base::ObserverList<HistoryBackendObserver> observers_; |
| 894 | 890 |
| 895 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 891 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 896 }; | 892 }; |
| 897 | 893 |
| 898 } // namespace history | 894 } // namespace history |
| 899 | 895 |
| 900 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 896 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
| OLD | NEW |