| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/containers/mru_cache.h" | 13 #include "base/containers/mru_cache.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/memory_pressure_listener.h" | 16 #include "base/memory/memory_pressure_listener.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/task/cancelable_task_tracker.h" | 20 #include "base/task/cancelable_task_tracker.h" |
| 21 #include "chrome/browser/history/expire_history_backend.h" | 21 #include "chrome/browser/history/expire_history_backend.h" |
| 22 #include "chrome/browser/history/history_database.h" | |
| 23 #include "components/history/core/browser/history_backend_notifier.h" | 22 #include "components/history/core/browser/history_backend_notifier.h" |
| 24 #include "components/history/core/browser/history_types.h" | 23 #include "components/history/core/browser/history_types.h" |
| 25 #include "components/history/core/browser/keyword_id.h" | 24 #include "components/history/core/browser/keyword_id.h" |
| 26 #include "components/history/core/browser/thumbnail_database.h" | 25 #include "components/history/core/browser/thumbnail_database.h" |
| 27 #include "components/history/core/browser/visit_tracker.h" | 26 #include "components/history/core/browser/visit_tracker.h" |
| 28 #include "components/visitedlink/browser/visitedlink_delegate.h" | 27 #include "components/visitedlink/browser/visitedlink_delegate.h" |
| 29 #include "sql/init_status.h" | 28 #include "sql/init_status.h" |
| 30 | 29 |
| 31 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
| 32 #include "components/history/core/android/android_history_types.h" | 31 #include "components/history/core/browser/android/android_history_types.h" |
| 33 #endif | 32 #endif |
| 34 | 33 |
| 35 class HistoryURLProvider; | 34 class HistoryURLProvider; |
| 36 struct HistoryURLProviderParams; | 35 struct HistoryURLProviderParams; |
| 37 struct ImportedFaviconUsage; | 36 struct ImportedFaviconUsage; |
| 38 class SkBitmap; | 37 class SkBitmap; |
| 39 class TestingProfile; | 38 class TestingProfile; |
| 40 struct ThumbnailScore; | 39 struct ThumbnailScore; |
| 41 | 40 |
| 42 namespace base { | 41 namespace base { |
| 43 class MessageLoop; | 42 class MessageLoop; |
| 44 class SingleThreadTaskRunner; | 43 class SingleThreadTaskRunner; |
| 45 } | 44 } |
| 46 | 45 |
| 47 namespace history { | 46 namespace history { |
| 48 #if defined(OS_ANDROID) | 47 #if defined(OS_ANDROID) |
| 49 class AndroidProviderBackend; | 48 class AndroidProviderBackend; |
| 50 #endif | 49 #endif |
| 51 | 50 |
| 52 class CommitLaterTask; | 51 class CommitLaterTask; |
| 53 struct DownloadRow; | 52 struct DownloadRow; |
| 54 class HistoryBackendObserver; | 53 class HistoryBackendObserver; |
| 55 class HistoryClient; | 54 class HistoryClient; |
| 55 class HistoryDatabase; |
| 56 struct HistoryDatabaseParams; |
| 56 struct HistoryDetails; | 57 struct HistoryDetails; |
| 57 class HistoryDBTask; | 58 class HistoryDBTask; |
| 58 class InMemoryHistoryBackend; | 59 class InMemoryHistoryBackend; |
| 59 class TypedUrlSyncableService; | 60 class TypedUrlSyncableService; |
| 60 class VisitFilter; | 61 class VisitFilter; |
| 61 | 62 |
| 62 // The maximum number of icons URLs per page which can be stored in the | 63 // The maximum number of icons URLs per page which can be stored in the |
| 63 // thumbnail database. | 64 // thumbnail database. |
| 64 static const size_t kMaxFaviconsPerPage = 8; | 65 static const size_t kMaxFaviconsPerPage = 8; |
| 65 | 66 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 Delegate* delegate, | 178 Delegate* delegate, |
| 178 HistoryClient* history_client); | 179 HistoryClient* history_client); |
| 179 | 180 |
| 180 // Must be called after creation but before any objects are created. If this | 181 // Must be called after creation but before any objects are created. If this |
| 181 // fails, all other functions will fail as well. (Since this runs on another | 182 // fails, all other functions will fail as well. (Since this runs on another |
| 182 // thread, we don't bother returning failure.) | 183 // thread, we don't bother returning failure.) |
| 183 // | 184 // |
| 184 // |languages| gives a list of language encodings with which the history | 185 // |languages| gives a list of language encodings with which the history |
| 185 // URLs and omnibox searches are interpreted. | 186 // URLs and omnibox searches are interpreted. |
| 186 // |force_fail| can be set during unittests to unconditionally fail to init. | 187 // |force_fail| can be set during unittests to unconditionally fail to init. |
| 187 void Init(const std::string& languages, bool force_fail); | 188 void Init(const std::string& languages, |
| 189 bool force_fail, |
| 190 const HistoryDatabaseParams& history_database_params); |
| 188 | 191 |
| 189 // Notification that the history system is shutting down. This will break | 192 // Notification that the history system is shutting down. This will break |
| 190 // the refs owned by the delegate and any pending transaction so it will | 193 // the refs owned by the delegate and any pending transaction so it will |
| 191 // actually be deleted. | 194 // actually be deleted. |
| 192 void Closing(); | 195 void Closing(); |
| 193 | 196 |
| 194 void ClearCachedDataForContextID(ContextID context_id); | 197 void ClearCachedDataForContextID(ContextID context_id); |
| 195 | 198 |
| 196 // Navigation ---------------------------------------------------------------- | 199 // Navigation ---------------------------------------------------------------- |
| 197 | 200 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 605 |
| 603 #if defined(OS_ANDROID) | 606 #if defined(OS_ANDROID) |
| 604 // Returns the name of android cache database. | 607 // Returns the name of android cache database. |
| 605 base::FilePath GetAndroidCacheFileName() const; | 608 base::FilePath GetAndroidCacheFileName() const; |
| 606 #endif | 609 #endif |
| 607 | 610 |
| 608 class URLQuerier; | 611 class URLQuerier; |
| 609 friend class URLQuerier; | 612 friend class URLQuerier; |
| 610 | 613 |
| 611 // Does the work of Init. | 614 // Does the work of Init. |
| 612 void InitImpl(const std::string& languages); | 615 void InitImpl(const std::string& languages, |
| 616 const HistoryDatabaseParams& history_database_params); |
| 613 | 617 |
| 614 // Called when the system is under memory pressure. | 618 // Called when the system is under memory pressure. |
| 615 void OnMemoryPressure( | 619 void OnMemoryPressure( |
| 616 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 620 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| 617 | 621 |
| 618 // Closes all databases managed by HistoryBackend. Commits any pending | 622 // Closes all databases managed by HistoryBackend. Commits any pending |
| 619 // transactions. | 623 // transactions. |
| 620 void CloseAllDatabases(); | 624 void CloseAllDatabases(); |
| 621 | 625 |
| 622 // Adds a single visit to the database, updating the URL information such | 626 // Adds a single visit to the database, updating the URL information such |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 | 921 |
| 918 // List of observers | 922 // List of observers |
| 919 ObserverList<HistoryBackendObserver> observers_; | 923 ObserverList<HistoryBackendObserver> observers_; |
| 920 | 924 |
| 921 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 925 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 922 }; | 926 }; |
| 923 | 927 |
| 924 } // namespace history | 928 } // namespace history |
| 925 | 929 |
| 926 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 930 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |