summaryrefslogtreecommitdiff
path: root/chromium/components/history/core/browser/history_backend.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/history/core/browser/history_backend.cc')
-rw-r--r--chromium/components/history/core/browser/history_backend.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chromium/components/history/core/browser/history_backend.cc b/chromium/components/history/core/browser/history_backend.cc
index 1a6bb7ad482..885d4de9e57 100644
--- a/chromium/components/history/core/browser/history_backend.cc
+++ b/chromium/components/history/core/browser/history_backend.cc
@@ -46,9 +46,13 @@
#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/page_usage_data.h"
+#if !defined(TOOLKIT_QT)
#include "components/history/core/browser/sync/typed_url_sync_bridge.h"
+#endif
#include "components/history/core/browser/url_utils.h"
+#if !defined(TOOLKIT_QT)
#include "components/sync/model/client_tag_based_model_type_processor.h"
+#endif
#include "components/url_formatter/url_formatter.h"
#include "net/base/escape.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -69,7 +73,9 @@ using favicon::FaviconBitmapID;
using favicon::FaviconBitmapIDSize;
using favicon::FaviconBitmapType;
using favicon::IconMapping;
+#if !defined(TOOLKIT_QT)
using syncer::ClientTagBasedModelTypeProcessor;
+#endif
/* The HistoryBackend consists of two components:
@@ -304,11 +310,13 @@ void HistoryBackend::Init(
InitImpl(history_database_params);
delegate_->DBLoaded();
+#if !defined(TOOLKIT_QT)
typed_url_sync_bridge_ = std::make_unique<TypedURLSyncBridge>(
this, db_.get(),
std::make_unique<ClientTagBasedModelTypeProcessor>(
syncer::TYPED_URLS, /*dump_stack=*/base::RepeatingClosure()));
typed_url_sync_bridge_->Init();
+#endif // !defined(TOOLKIT_QT)
memory_pressure_listener_ = std::make_unique<base::MemoryPressureListener>(
FROM_HERE, base::BindRepeating(&HistoryBackend::OnMemoryPressure,
@@ -1065,10 +1073,12 @@ void HistoryBackend::AddPagesWithDetails(const URLRows& urls,
ScheduleCommit();
}
+#if !defined(TOOLKIT_QT)
void HistoryBackend::SetTypedURLSyncBridgeForTest(
std::unique_ptr<TypedURLSyncBridge> bridge) {
typed_url_sync_bridge_ = std::move(bridge);
}
+#endif // !defined(TOOLKIT_QT)
bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) {
return time < expirer_.GetCurrentExpirationTime();
@@ -1257,11 +1267,13 @@ QueryURLResult HistoryBackend::QueryURL(const GURL& url, bool want_visits) {
return result;
}
+#if !defined(TOOLKIT_QT)
base::WeakPtr<syncer::ModelTypeControllerDelegate>
HistoryBackend::GetTypedURLSyncControllerDelegate() {
DCHECK(typed_url_sync_bridge_);
return typed_url_sync_bridge_->change_processor()->GetControllerDelegate();
}
+#endif // !defined(TOOLKIT_QT)
// Statistics ------------------------------------------------------------------
@@ -2268,10 +2280,12 @@ void HistoryBackend::KillHistoryDatabase() {
if (!db_)
return;
+#if !defined(TOOLKIT_QT)
// Notify SyncBridge about storage error. It will report failure to sync
// engine and stop accepting remote updates.
if (typed_url_sync_bridge_)
typed_url_sync_bridge_->OnDatabaseError();
+#endif // !defined(TOOLKIT_QT)
// Rollback transaction because Raze() cannot be called from within a
// transaction.