diff options
Diffstat (limited to 'chromium/components/history/core/browser/history_database.cc')
-rw-r--r-- | chromium/components/history/core/browser/history_database.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/chromium/components/history/core/browser/history_database.cc b/chromium/components/history/core/browser/history_database.cc index 7e47f39fe0c..d65d0b8b90d 100644 --- a/chromium/components/history/core/browser/history_database.cc +++ b/chromium/components/history/core/browser/history_database.cc @@ -20,7 +20,9 @@ #include "base/rand_util.h" #include "base/time/time.h" #include "build/build_config.h" +#if !defined(TOOLKIT_QT) #include "components/sync/base/features.h" +#endif #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "sql/database.h" #include "sql/meta_table.h" @@ -79,7 +81,7 @@ HistoryDatabase::HistoryDatabase( DownloadInterruptReason download_interrupt_reason_crash) : DownloadDatabase(download_interrupt_reason_none, download_interrupt_reason_crash), - db_(sql::DatabaseOptions( + db_(sql::DatabaseOptions{ // Note that we don't set exclusive locking here. That's done by // BeginExclusiveMode below which is called later (we have to be in // shared mode to start out for the in-memory backend to read the @@ -93,9 +95,12 @@ HistoryDatabase::HistoryDatabase( // Set the cache size. The page size, plus a little extra, times this // value, tells us how much memory the cache will use maximum. // 1000 * 4kB = 4MB - /*.cache_size =*/ 1000}), - typed_url_metadata_db_(&db_, &meta_table_), - history_metadata_db_(&db_, &meta_table_) {} + /*.cache_size =*/ 1000}) +#if !defined(TOOLKIT_QT) + , typed_url_metadata_db_(&db_, &meta_table_) + , history_metadata_db_(&db_, &meta_table_) +#endif +{} HistoryDatabase::~HistoryDatabase() = default; @@ -125,14 +130,19 @@ sql::InitStatus HistoryDatabase::Init(const base::FilePath& history_name) { return LogInitFailure(InitStep::META_TABLE_INIT); if (!CreateURLTable(false) || !InitVisitTable() || !InitKeywordSearchTermsTable() || !InitDownloadTable() || - !InitSegmentTables() || !typed_url_metadata_db_.Init() || + !InitSegmentTables() || +#if !defined(TOOLKIT_QT) + !typed_url_metadata_db_.Init() || +#endif !InitVisitAnnotationsTables()) { return LogInitFailure(InitStep::CREATE_TABLES); } +#if !defined(TOOLKIT_QT) if (base::FeatureList::IsEnabled(syncer::kSyncEnableHistoryDataType) && !history_metadata_db_.Init()) { return LogInitFailure(InitStep::CREATE_TABLES); } +#endif CreateMainURLIndex(); // TODO(benjhayden) Remove at some point. @@ -173,6 +183,7 @@ void HistoryDatabase::ComputeDatabaseMetrics( UMA_HISTOGRAM_TIMES("History.DatabaseBasicMetricsTime", base::TimeTicks::Now() - start_time); +#if !defined(TOOLKIT_QT) if (base::FeatureList::IsEnabled(syncer::kSyncEnableHistoryDataType)) { // Compute metrics about foreign visits (i.e. visits coming from other // devices) in the DB. @@ -251,6 +262,7 @@ void HistoryDatabase::ComputeDatabaseMetrics( base::UmaHistogramTimes("History.DatabaseForeignVisitMetricsTime", base::TimeTicks::Now() - start_time); } +#endif // !defined(TOOLKIT_QT) // Compute the advanced metrics even less often, pending timing data showing // that's not necessary. @@ -462,6 +474,7 @@ void HistoryDatabase::UpdateEarlyExpirationThreshold(base::Time threshold) { cached_early_expiration_threshold_ = threshold; } +#if !defined(TOOLKIT_QT) TypedURLSyncMetadataDatabase* HistoryDatabase::GetTypedURLMetadataDB() { return &typed_url_metadata_db_; } @@ -469,6 +482,7 @@ TypedURLSyncMetadataDatabase* HistoryDatabase::GetTypedURLMetadataDB() { HistorySyncMetadataDatabase* HistoryDatabase::GetHistoryMetadataDB() { return &history_metadata_db_; } +#endif // !defined(TOOLKIT_QT) sql::Database& HistoryDatabase::GetDB() { return db_; |