Skip to content

Commit

Permalink
Modified patch for HistoryModelTypeController; added patch HistoryDel…
Browse files Browse the repository at this point in the history
…eteDirectivesModelTypeController
  • Loading branch information
AlexeyBarabash committed Oct 6, 2023
1 parent d644658 commit 6696d3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/components/history/core/browser/sync/history_delete_directives_model_type_controller.cc b/components/history/core/browser/sync/history_delete_directives_model_type_controller.cc
index f7dbc9b6779bf246e0dce502be286c008fc0be14..41a31c5ff978fa8c7965aa02753b5fe058411028 100644
--- a/components/history/core/browser/sync/history_delete_directives_model_type_controller.cc
+++ b/components/history/core/browser/sync/history_delete_directives_model_type_controller.cc
@@ -64,6 +64,7 @@ HistoryDeleteDirectivesModelTypeController::
syncer::DataTypeController::PreconditionState
HistoryDeleteDirectivesModelTypeController::GetPreconditionState() const {
DCHECK(CalledOnValidThread());
+ if (static_cast<int>(type()) > 0) return PreconditionState::kPreconditionsMet;
if (helper_.sync_service()->GetUserSettings()->IsEncryptEverythingEnabled()) {
return PreconditionState::kMustStopAndClearData;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/components/history/core/browser/sync/history_model_type_controller.cc b/components/history/core/browser/sync/history_model_type_controller.cc
index 77b8d10dabd8a14beb4e2b8b80060d0418f744f1..f597e70d46c09a689393aed9ef6350a460e99266 100644
index 77b8d10dabd8a14beb4e2b8b80060d0418f744f1..18a1d711fc6c3b398a81f6cef9bd2db745033cbc 100644
--- a/components/history/core/browser/sync/history_model_type_controller.cc
+++ b/components/history/core/browser/sync/history_model_type_controller.cc
@@ -145,6 +145,7 @@ HistoryModelTypeController::~HistoryModelTypeController() = default;

syncer::DataTypeController::PreconditionState
HistoryModelTypeController::GetPreconditionState() const {
@@ -155,6 +155,7 @@ HistoryModelTypeController::GetPreconditionState() const {
return PreconditionState::kMustStopAndClearData;
}
DCHECK_EQ(type(), syncer::HISTORY);
+ if (static_cast<int>(type()) > 0) return PreconditionState::kPreconditionsMet;
if (!base::FeatureList::IsEnabled(syncer::kSyncEnableHistoryDataType)) {
DCHECK_EQ(type(), syncer::TYPED_URLS);
return helper_.GetPreconditionState();

// syncer::HISTORY doesn't support custom passphrase encryption.
if (helper_.sync_service()->GetUserSettings()->IsEncryptEverythingEnabled()) {

0 comments on commit 6696d3f

Please sign in to comment.