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

Side by Side Diff: sync/internal_api/sync_manager_impl.cc

Issue 1275743002: [Sync] Remove backend unrecoverable error handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leak Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/internal_api/sync_manager_impl.h" 5 #include "sync/internal_api/sync_manager_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 change_delegate_ = args->change_delegate; 236 change_delegate_ = args->change_delegate;
237 237
238 AddObserver(&js_sync_manager_observer_); 238 AddObserver(&js_sync_manager_observer_);
239 SetJsEventHandler(args->event_handler); 239 SetJsEventHandler(args->event_handler);
240 240
241 AddObserver(&debug_info_event_listener_); 241 AddObserver(&debug_info_event_listener_);
242 242
243 database_path_ = args->database_location.Append( 243 database_path_ = args->database_location.Append(
244 syncable::Directory::kSyncDatabaseFilename); 244 syncable::Directory::kSyncDatabaseFilename);
245 unrecoverable_error_handler_ = args->unrecoverable_error_handler.Pass();
246 report_unrecoverable_error_function_ = 245 report_unrecoverable_error_function_ =
247 args->report_unrecoverable_error_function; 246 args->report_unrecoverable_error_function;
248 247
249 allstatus_.SetHasKeystoreKey( 248 allstatus_.SetHasKeystoreKey(
250 !args->restored_keystore_key_for_bootstrapping.empty()); 249 !args->restored_keystore_key_for_bootstrapping.empty());
251 sync_encryption_handler_.reset(new SyncEncryptionHandlerImpl( 250 sync_encryption_handler_.reset(new SyncEncryptionHandlerImpl(
252 &share_, args->encryptor, args->restored_key_for_bootstrapping, 251 &share_, args->encryptor, args->restored_key_for_bootstrapping,
253 args->restored_keystore_key_for_bootstrapping, args->clear_data_option)); 252 args->restored_keystore_key_for_bootstrapping, args->clear_data_option));
254 sync_encryption_handler_->AddObserver(this); 253 sync_encryption_handler_->AddObserver(this);
255 sync_encryption_handler_->AddObserver(&debug_info_event_listener_); 254 sync_encryption_handler_->AddObserver(&debug_info_event_listener_);
256 sync_encryption_handler_->AddObserver(&js_sync_encryption_handler_observer_); 255 sync_encryption_handler_->AddObserver(&js_sync_encryption_handler_observer_);
257 256
258 base::FilePath absolute_db_path = database_path_; 257 base::FilePath absolute_db_path = database_path_;
259 DCHECK(absolute_db_path.IsAbsolute()); 258 DCHECK(absolute_db_path.IsAbsolute());
260 259
261 scoped_ptr<syncable::DirectoryBackingStore> backing_store = 260 scoped_ptr<syncable::DirectoryBackingStore> backing_store =
262 args->internal_components_factory->BuildDirectoryBackingStore( 261 args->internal_components_factory->BuildDirectoryBackingStore(
263 InternalComponentsFactory::STORAGE_ON_DISK, 262 InternalComponentsFactory::STORAGE_ON_DISK,
264 args->credentials.email, absolute_db_path).Pass(); 263 args->credentials.email, absolute_db_path).Pass();
265 264
266 DCHECK(backing_store.get()); 265 DCHECK(backing_store.get());
267 share_.directory.reset( 266 share_.directory.reset(
268 new syncable::Directory( 267 new syncable::Directory(
269 backing_store.release(), 268 backing_store.release(),
270 unrecoverable_error_handler_.get(), 269 args->unrecoverable_error_handler,
271 report_unrecoverable_error_function_, 270 report_unrecoverable_error_function_,
272 sync_encryption_handler_.get(), 271 sync_encryption_handler_.get(),
273 sync_encryption_handler_->GetCryptographerUnsafe())); 272 sync_encryption_handler_->GetCryptographerUnsafe()));
274 share_.sync_credentials = args->credentials; 273 share_.sync_credentials = args->credentials;
275 274
276 // UserShare is accessible to a lot of code that doesn't need access to the 275 // UserShare is accessible to a lot of code that doesn't need access to the
277 // sync token so clear sync_token from the UserShare. 276 // sync token so clear sync_token from the UserShare.
278 share_.sync_credentials.sync_token = ""; 277 share_.sync_credentials.sync_token = "";
279 278
280 const std::string& username = args->credentials.email; 279 const std::string& username = args->credentials.email;
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } 1040 }
1042 1041
1043 void SyncManagerImpl::ClearServerData(const ClearServerDataCallback& callback) { 1042 void SyncManagerImpl::ClearServerData(const ClearServerDataCallback& callback) {
1044 DCHECK(thread_checker_.CalledOnValidThread()); 1043 DCHECK(thread_checker_.CalledOnValidThread());
1045 scheduler_->Start(SyncScheduler::CLEAR_SERVER_DATA_MODE, base::Time()); 1044 scheduler_->Start(SyncScheduler::CLEAR_SERVER_DATA_MODE, base::Time());
1046 ClearParams params(callback); 1045 ClearParams params(callback);
1047 scheduler_->ScheduleClearServerData(params); 1046 scheduler_->ScheduleClearServerData(params);
1048 } 1047 }
1049 1048
1050 } // namespace syncer 1049 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698