Commit 5edaa00b authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Update some mentions to Sync Directory

The Directory doesn't exist anymore, so this CL updates references [1]
to it across the Sync codebase. For code that's already scheduled for
cleanup, the CL just adds TODOs pointing to the corresponding bugs.


[1] https://source.chromium.org/search?q=f:(components%7Cchrome).*sync%2F%20case:yes%20comment:Directory%20-f:%5Eout

Bug: None
Change-Id: I134fe4abe0a3d8e669686fed71d374da7be6f69c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440869
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812184}
parent 398b7eae
...@@ -22,6 +22,9 @@ namespace syncer { ...@@ -22,6 +22,9 @@ namespace syncer {
struct ConfigureContext; struct ConfigureContext;
// TODO(crbug.com/1102837): Association was a Directory concept, this class
// should disappear or be refactored.
//
// |ModelAssociationManager| does the heavy lifting for doing the actual model // |ModelAssociationManager| does the heavy lifting for doing the actual model
// association. It instructs DataTypeControllers to load models, start // association. It instructs DataTypeControllers to load models, start
// associating and stopping. Since the operations are async it uses an // associating and stopping. Since the operations are async it uses an
...@@ -59,7 +62,8 @@ class ModelAssociationManagerDelegate { ...@@ -59,7 +62,8 @@ class ModelAssociationManagerDelegate {
virtual ~ModelAssociationManagerDelegate() {} virtual ~ModelAssociationManagerDelegate() {}
}; };
// The class that is responsible for model association. // TODO(crbug.com/1102837): Association was a Directory concept, this class
// should disappear or be refactored.
class ModelAssociationManager { class ModelAssociationManager {
public: public:
enum State { enum State {
......
...@@ -657,11 +657,11 @@ void ProfileSyncService::ShutdownImpl(ShutdownReason reason) { ...@@ -657,11 +657,11 @@ void ProfileSyncService::ShutdownImpl(ShutdownReason reason) {
// If the engine hasn't started or is already shut down when a DISABLE_SYNC // If the engine hasn't started or is already shut down when a DISABLE_SYNC
// happens, the data directory needs to be cleaned up here. // happens, the data directory needs to be cleaned up here.
if (reason == ShutdownReason::DISABLE_SYNC) { if (reason == ShutdownReason::DISABLE_SYNC) {
// Clearing the Directory via Directory::DeleteDirectoryFiles() means // Clearing the Directory via DeleteLegacyDirectoryFilesAndNigoriStorage()
// there's IO involved which may we considerable overhead if triggered // means there's IO involved which may we considerable overhead if
// consistently upon browser startup (which is the case for certain // triggered consistently upon browser startup (which is the case for
// codepaths such as the user being signed out). To avoid that, SyncPrefs // certain codepaths such as the user being signed out). To avoid that,
// is used to determine whether it's worth it. // SyncPrefs is used to determine whether it's worth it.
if (!sync_prefs_.GetCacheGuid().empty()) { if (!sync_prefs_.GetCacheGuid().empty()) {
backend_task_runner_->PostTask( backend_task_runner_->PostTask(
FROM_HERE, FROM_HERE,
...@@ -1891,8 +1891,6 @@ void ProfileSyncService::StopAndClear() { ...@@ -1891,8 +1891,6 @@ void ProfileSyncService::StopAndClear() {
void ProfileSyncService::ReconfigureDatatypeManager( void ProfileSyncService::ReconfigureDatatypeManager(
bool bypass_setup_in_progress_check) { bool bypass_setup_in_progress_check) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// If we haven't initialized yet, don't configure the DTM as it could cause
// association to start before a Directory has even been created.
if (engine_ && engine_->IsInitialized()) { if (engine_ && engine_->IsInitialized()) {
DCHECK(engine_); DCHECK(engine_);
// Don't configure datatypes if the setup UI is still on the screen - this // Don't configure datatypes if the setup UI is still on the screen - this
......
...@@ -40,6 +40,9 @@ enum ModelSafeGroup { ...@@ -40,6 +40,9 @@ enum ModelSafeGroup {
std::string ModelSafeGroupToString(ModelSafeGroup group); std::string ModelSafeGroupToString(ModelSafeGroup group);
// TODO(crbug.com/1102835): This class is a remainder from the old Directory
// implementation and should be removed.
//
// The Syncer uses a ModelSafeWorker for all tasks that could potentially // The Syncer uses a ModelSafeWorker for all tasks that could potentially
// modify syncable entries (e.g under a WriteTransaction). The ModelSafeWorker // modify syncable entries (e.g under a WriteTransaction). The ModelSafeWorker
// only knows how to do one thing, and that is take some work (in a fully // only knows how to do one thing, and that is take some work (in a fully
......
...@@ -47,7 +47,7 @@ class DataTypeDebugInfoEmitter { ...@@ -47,7 +47,7 @@ class DataTypeDebugInfoEmitter {
// Allows others to mutate the commit counters. // Allows others to mutate the commit counters.
CommitCounters* GetMutableCommitCounters(); CommitCounters* GetMutableCommitCounters();
// Triggerss a commit counters update to registered observers. // Triggers a commit counters update to registered observers.
void EmitCommitCountersUpdate(); void EmitCommitCountersUpdate();
// Returns a reference to the current update counters. // Returns a reference to the current update counters.
......
...@@ -144,7 +144,7 @@ class ModelTypeRegistry : public ModelTypeConnector, ...@@ -144,7 +144,7 @@ class ModelTypeRegistry : public ModelTypeConnector,
// The set of observers of per-type debug info. // The set of observers of per-type debug info.
// //
// Each of the DirectoryTypeDebugInfoEmitters needs such a list. There's // Each of the DataTypeDebugInfoEmitter needs such a list. There's
// a lot of them, and their lifetimes are unpredictable, so it makes the // a lot of them, and their lifetimes are unpredictable, so it makes the
// book-keeping easier if we just store the list here. That way it's // book-keeping easier if we just store the list here. That way it's
// guaranteed to live as long as this sync backend. // guaranteed to live as long as this sync backend.
......
...@@ -35,9 +35,7 @@ namespace syncer { ...@@ -35,9 +35,7 @@ namespace syncer {
class CancelationSignal; class CancelationSignal;
class ModelTypeProcessor; class ModelTypeProcessor;
// A smart cache for sync types that use message passing (rather than // A smart cache for sync types to communicate with the sync thread.
// transactions and the syncable::Directory) to communicate with the sync
// thread.
// //
// When the non-blocking sync type wants to talk with the sync server, it will // When the non-blocking sync type wants to talk with the sync server, it will
// send a message from its thread to this object on the sync thread. This // send a message from its thread to this object on the sync thread. This
......
...@@ -241,9 +241,8 @@ bool UpdateEncryptedTypes(const NigoriSpecifics& specifics, ...@@ -241,9 +241,8 @@ bool UpdateEncryptedTypes(const NigoriSpecifics& specifics,
return true; return true;
} }
// Packs explicit passphrase key in order to persist it. Should be aligned with // Packs explicit passphrase key in order to persist it. Returns empty string in
// Directory implementation (Cryptographer::GetBootstrapToken()) unless it is // case of errors.
// removed. Returns empty string in case of errors.
std::string PackExplicitPassphraseKey(const Encryptor& encryptor, std::string PackExplicitPassphraseKey(const Encryptor& encryptor,
const CryptographerImpl& cryptographer) { const CryptographerImpl& cryptographer) {
DCHECK(cryptographer.CanEncrypt()); DCHECK(cryptographer.CanEncrypt());
...@@ -271,8 +270,6 @@ std::string PackExplicitPassphraseKey(const Encryptor& encryptor, ...@@ -271,8 +270,6 @@ std::string PackExplicitPassphraseKey(const Encryptor& encryptor,
// Unpacks explicit passphrase keys. Returns a populated sync_pb::NigoriKey if // Unpacks explicit passphrase keys. Returns a populated sync_pb::NigoriKey if
// successful, or an empty instance (i.e. default value) if |packed_key| is // successful, or an empty instance (i.e. default value) if |packed_key| is
// empty or decoding/decryption errors occur. // empty or decoding/decryption errors occur.
// Should be aligned with Directory implementation (
// Cryptographer::UnpackBootstrapToken()) unless it is removed.
sync_pb::NigoriKey UnpackExplicitPassphraseKey(const Encryptor& encryptor, sync_pb::NigoriKey UnpackExplicitPassphraseKey(const Encryptor& encryptor,
const std::string& packed_key) { const std::string& packed_key) {
if (packed_key.empty()) { if (packed_key.empty()) {
...@@ -296,9 +293,7 @@ sync_pb::NigoriKey UnpackExplicitPassphraseKey(const Encryptor& encryptor, ...@@ -296,9 +293,7 @@ sync_pb::NigoriKey UnpackExplicitPassphraseKey(const Encryptor& encryptor,
return key; return key;
} }
// Returns Base64 encoded keystore keys or empty vector if errors occur. Should // Returns Base64 encoded keystore keys or empty vector if errors occur.
// be aligned with Directory implementation (UnpackKeystoreBootstrapToken())
// unless it is removed.
std::vector<std::string> UnpackKeystoreKeys( std::vector<std::string> UnpackKeystoreKeys(
const std::string& packed_keystore_keys, const std::string& packed_keystore_keys,
const Encryptor& encryptor) { const Encryptor& encryptor) {
...@@ -664,7 +659,7 @@ void NigoriSyncBridgeImpl::AddTrustedVaultDecryptionKeys( ...@@ -664,7 +659,7 @@ void NigoriSyncBridgeImpl::AddTrustedVaultDecryptionKeys(
void NigoriSyncBridgeImpl::EnableEncryptEverything() { void NigoriSyncBridgeImpl::EnableEncryptEverything() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// This method is relevant only for Directory implementation. USS // This method was relevant only for Directory implementation. USS
// implementation catches that as part of SetEncryptionPassphrase(), which // implementation catches that as part of SetEncryptionPassphrase(), which
// is always called together with this method. // is always called together with this method.
// TODO(crbug.com/1033040): remove this method and clean up calling sides. // TODO(crbug.com/1033040): remove this method and clean up calling sides.
...@@ -672,7 +667,7 @@ void NigoriSyncBridgeImpl::EnableEncryptEverything() { ...@@ -672,7 +667,7 @@ void NigoriSyncBridgeImpl::EnableEncryptEverything() {
bool NigoriSyncBridgeImpl::IsEncryptEverythingEnabled() const { bool NigoriSyncBridgeImpl::IsEncryptEverythingEnabled() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// This method is relevant only for Directory implementation and used only // This method was relevant only for Directory implementation and used only
// for testing. // for testing.
// TODO(crbug.com/1033040): remove this method or at least append ForTesting // TODO(crbug.com/1033040): remove this method or at least append ForTesting
// suffix. // suffix.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment