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 {
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
// association. It instructs DataTypeControllers to load models, start
// associating and stopping. Since the operations are async it uses an
......@@ -59,7 +62,8 @@ class 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 {
public:
enum State {
......
......@@ -657,11 +657,11 @@ void ProfileSyncService::ShutdownImpl(ShutdownReason reason) {
// 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.
if (reason == ShutdownReason::DISABLE_SYNC) {
// Clearing the Directory via Directory::DeleteDirectoryFiles() means
// there's IO involved which may we considerable overhead if triggered
// consistently upon browser startup (which is the case for certain
// codepaths such as the user being signed out). To avoid that, SyncPrefs
// is used to determine whether it's worth it.
// Clearing the Directory via DeleteLegacyDirectoryFilesAndNigoriStorage()
// means there's IO involved which may we considerable overhead if
// triggered consistently upon browser startup (which is the case for
// certain codepaths such as the user being signed out). To avoid that,
// SyncPrefs is used to determine whether it's worth it.
if (!sync_prefs_.GetCacheGuid().empty()) {
backend_task_runner_->PostTask(
FROM_HERE,
......@@ -1891,8 +1891,6 @@ void ProfileSyncService::StopAndClear() {
void ProfileSyncService::ReconfigureDatatypeManager(
bool bypass_setup_in_progress_check) {
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()) {
DCHECK(engine_);
// Don't configure datatypes if the setup UI is still on the screen - this
......
......@@ -40,6 +40,9 @@ enum ModelSafeGroup {
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
// 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
......
......@@ -47,7 +47,7 @@ class DataTypeDebugInfoEmitter {
// Allows others to mutate the commit counters.
CommitCounters* GetMutableCommitCounters();
// Triggerss a commit counters update to registered observers.
// Triggers a commit counters update to registered observers.
void EmitCommitCountersUpdate();
// Returns a reference to the current update counters.
......
......@@ -144,7 +144,7 @@ class ModelTypeRegistry : public ModelTypeConnector,
// 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
// book-keeping easier if we just store the list here. That way it's
// guaranteed to live as long as this sync backend.
......
......@@ -35,9 +35,7 @@ namespace syncer {
class CancelationSignal;
class ModelTypeProcessor;
// A smart cache for sync types that use message passing (rather than
// transactions and the syncable::Directory) to communicate with the sync
// thread.
// A smart cache for sync types to communicate with the sync thread.
//
// 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
......
......@@ -241,9 +241,8 @@ bool UpdateEncryptedTypes(const NigoriSpecifics& specifics,
return true;
}
// Packs explicit passphrase key in order to persist it. Should be aligned with
// Directory implementation (Cryptographer::GetBootstrapToken()) unless it is
// removed. Returns empty string in case of errors.
// Packs explicit passphrase key in order to persist it. Returns empty string in
// case of errors.
std::string PackExplicitPassphraseKey(const Encryptor& encryptor,
const CryptographerImpl& cryptographer) {
DCHECK(cryptographer.CanEncrypt());
......@@ -271,8 +270,6 @@ std::string PackExplicitPassphraseKey(const Encryptor& encryptor,
// Unpacks explicit passphrase keys. Returns a populated sync_pb::NigoriKey if
// successful, or an empty instance (i.e. default value) if |packed_key| is
// 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,
const std::string& packed_key) {
if (packed_key.empty()) {
......@@ -296,9 +293,7 @@ sync_pb::NigoriKey UnpackExplicitPassphraseKey(const Encryptor& encryptor,
return key;
}
// Returns Base64 encoded keystore keys or empty vector if errors occur. Should
// be aligned with Directory implementation (UnpackKeystoreBootstrapToken())
// unless it is removed.
// Returns Base64 encoded keystore keys or empty vector if errors occur.
std::vector<std::string> UnpackKeystoreKeys(
const std::string& packed_keystore_keys,
const Encryptor& encryptor) {
......@@ -664,7 +659,7 @@ void NigoriSyncBridgeImpl::AddTrustedVaultDecryptionKeys(
void NigoriSyncBridgeImpl::EnableEncryptEverything() {
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
// is always called together with this method.
// TODO(crbug.com/1033040): remove this method and clean up calling sides.
......@@ -672,7 +667,7 @@ void NigoriSyncBridgeImpl::EnableEncryptEverything() {
bool NigoriSyncBridgeImpl::IsEncryptEverythingEnabled() const {
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.
// TODO(crbug.com/1033040): remove this method or at least append ForTesting
// 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