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

Side by Side Diff: components/sync/driver/sync_service_base.cc

Issue 2568743004: [Sync] Stop deleting LevelDB files when deleting Directory (Closed)
Patch Set: Only delete top level files in sync data folder. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/driver/sync_service_base.h" 5 #include "components/sync/driver/sync_service_base.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 SyncServiceBase::SyncServiceBase(std::unique_ptr<SyncClient> sync_client, 55 SyncServiceBase::SyncServiceBase(std::unique_ptr<SyncClient> sync_client,
56 std::unique_ptr<SigninManagerWrapper> signin, 56 std::unique_ptr<SigninManagerWrapper> signin,
57 const version_info::Channel& channel, 57 const version_info::Channel& channel,
58 const base::FilePath& base_directory, 58 const base::FilePath& base_directory,
59 const std::string& debug_identifier) 59 const std::string& debug_identifier)
60 : sync_client_(std::move(sync_client)), 60 : sync_client_(std::move(sync_client)),
61 signin_(std::move(signin)), 61 signin_(std::move(signin)),
62 channel_(channel), 62 channel_(channel),
63 base_directory_(base_directory), 63 base_directory_(base_directory),
64 directory_path_( 64 sync_data_folder_(
65 base_directory_.Append(base::FilePath(kSyncDataFolderName))), 65 base_directory_.Append(base::FilePath(kSyncDataFolderName))),
66 debug_identifier_(debug_identifier), 66 debug_identifier_(debug_identifier),
67 sync_prefs_(sync_client_->GetPrefService()) {} 67 sync_prefs_(sync_client_->GetPrefService()) {}
68 68
69 SyncServiceBase::~SyncServiceBase() = default; 69 SyncServiceBase::~SyncServiceBase() = default;
70 70
71 void SyncServiceBase::InitializeEngine() { 71 void SyncServiceBase::InitializeEngine() {
72 DCHECK(engine_); 72 DCHECK(engine_);
73 73
74 if (!sync_thread_) { 74 if (!sync_thread_) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // considered roamed. 138 // considered roamed.
139 *local_sync_backend_folder = 139 *local_sync_backend_folder =
140 local_sync_backend_folder->Append(base_directory_.BaseName()); 140 local_sync_backend_folder->Append(base_directory_.BaseName());
141 *local_sync_backend_folder = 141 *local_sync_backend_folder =
142 local_sync_backend_folder->Append(kLoopbackServerBackendFilename); 142 local_sync_backend_folder->Append(kLoopbackServerBackendFilename);
143 #endif // defined(OS_WIN) 143 #endif // defined(OS_WIN)
144 return enable_local_sync_backend; 144 return enable_local_sync_backend;
145 } 145 }
146 146
147 } // namespace syncer 147 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698