diff options
Diffstat (limited to 'sync/internal_api')
-rw-r--r-- | sync/internal_api/public/util/experiments.h | 11 | ||||
-rw-r--r-- | sync/internal_api/sync_manager_impl.cc | 10 |
2 files changed, 19 insertions, 2 deletions
diff --git a/sync/internal_api/public/util/experiments.h b/sync/internal_api/public/util/experiments.h index 6e20a8e..c13e56a 100644 --- a/sync/internal_api/public/util/experiments.h +++ b/sync/internal_api/public/util/experiments.h @@ -12,17 +12,21 @@ namespace syncer { const char kKeystoreEncryptionTag[] = "keystore_encryption"; const char kKeystoreEncryptionFlag[] = "sync-keystore-encryption"; const char kAutofillCullingTag[] = "autofill_culling"; +const char kFullHistorySyncTag[] = "history_delete_directives"; +const char kFullHistorySyncFlag[] = "full-history-sync"; // A structure to hold the enable status of experimental sync features. struct Experiments { Experiments() : sync_tab_favicons(false), keystore_encryption(false), - autofill_culling(false) {} + autofill_culling(false), + full_history_sync(false) {} bool Matches(const Experiments& rhs) { return (sync_tab_favicons == rhs.sync_tab_favicons && keystore_encryption == rhs.keystore_encryption && - autofill_culling == rhs.autofill_culling); + autofill_culling == rhs.autofill_culling && + full_history_sync == rhs.full_history_sync); } // Enable syncing of favicons within tab sync (only has an effect if tab sync @@ -34,6 +38,9 @@ struct Experiments { // Enable deletion of expired autofill entries (if autofill sync is enabled). bool autofill_culling; + + // Enable full history sync (and history delete directives) for this client. + bool full_history_sync; }; } // namespace syncer diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc index 618039c..65e2a47 100644 --- a/sync/internal_api/sync_manager_impl.cc +++ b/sync/internal_api/sync_manager_impl.cc @@ -1359,6 +1359,16 @@ bool SyncManagerImpl::ReceivedExperiment(Experiments* experiments) { found_experiment = true; } + ReadNode full_history_sync_node(&trans); + if (full_history_sync_node.InitByClientTagLookup( + syncer::EXPERIMENTS, + syncer::kFullHistorySyncTag) == BaseNode::INIT_OK && + full_history_sync_node.GetExperimentsSpecifics(). + history_delete_directives().enabled()) { + experiments->full_history_sync = true; + found_experiment = true; + } + return found_experiment; } |