Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Unified Diff: components/sync/driver/sync_service_base.cc

Issue 2710623003: [sync] Clean up path generation for the local sync database. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/driver/sync_service_base.cc
diff --git a/components/sync/driver/sync_service_base.cc b/components/sync/driver/sync_service_base.cc
index ae7467a27669377aa084d4c896673fb9cde2f724..be7df958382aa8988d29fc71f931a86a7dc566b9 100644
--- a/components/sync/driver/sync_service_base.cc
+++ b/components/sync/driver/sync_service_base.cc
@@ -58,6 +58,7 @@ SyncServiceBase::SyncServiceBase(std::unique_ptr<SyncClient> sync_client,
std::unique_ptr<SigninManagerWrapper> signin,
const version_info::Channel& channel,
const base::FilePath& base_directory,
+ const base::FilePath& local_sync_directory,
const std::string& debug_identifier)
: sync_client_(std::move(sync_client)),
signin_(std::move(signin)),
@@ -65,6 +66,7 @@ SyncServiceBase::SyncServiceBase(std::unique_ptr<SyncClient> sync_client,
base_directory_(base_directory),
sync_data_folder_(
base_directory_.Append(base::FilePath(kSyncDataFolderName))),
+ local_sync_directory_(local_sync_directory),
debug_identifier_(debug_identifier),
sync_prefs_(sync_client_->GetPrefService()) {
ResetCryptoState();
@@ -145,33 +147,10 @@ void SyncServiceBase::InitializeEngine() {
bool SyncServiceBase::GetLocalSyncConfig(
base::FilePath* local_sync_backend_folder) const {
bool enable_local_sync_backend = false;
- *local_sync_backend_folder = sync_prefs_.GetLocalSyncBackendDir();
#if defined(OS_WIN)
enable_local_sync_backend = sync_prefs_.IsLocalSyncEnabled();
+ *local_sync_backend_folder = local_sync_directory_;
UMA_HISTOGRAM_BOOLEAN("Sync.Local.Enabled", enable_local_sync_backend);
- if (local_sync_backend_folder->empty()) {
- // TODO(pastarmovj): Add DIR_ROAMING_USER_DATA to PathService to simplify
- // this code and move the logic in its right place. See crbug/657810.
- if (!base::PathService::Get(base::DIR_APP_DATA,
- local_sync_backend_folder)) {
- SYSLOG(WARNING) << "Local sync can not get the roaming profile folder.";
- UMA_HISTOGRAM_BOOLEAN("Sync.Local.RoamingProfileUnavailable", false);
- return false;
- }
- *local_sync_backend_folder = local_sync_backend_folder->Append(
- FILE_PATH_LITERAL("Chrome/User Data"));
- }
- // This code as it is now will assume the same profile order is present on all
- // machines, which is not a given. It is to be defined if only the Default
- // profile should get this treatment or all profile as is the case now. The
- // solution for now will be to assume profiles are created in the same order
- // on all machines and in the future decide if only the Default one should be
- // considered roamed.
- // See http://crbug.com/674928.
- *local_sync_backend_folder =
- local_sync_backend_folder->Append(base_directory_.BaseName());
- *local_sync_backend_folder =
- local_sync_backend_folder->Append(kLoopbackServerBackendFilename);
#endif // defined(OS_WIN)
return enable_local_sync_backend;
}
« components/sync/driver/sync_service_base.h ('K') | « components/sync/driver/sync_service_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698