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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_impl.cc

Issue 1368683003: USS SyncContextProxy / data type activation refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/sync/glue/sync_backend_host_impl.h" 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 DCHECK(syncer::Intersection(active_types, inactive_types).Empty()); 445 DCHECK(syncer::Intersection(active_types, inactive_types).Empty());
446 return syncer::Difference(active_types, types_to_download); 446 return syncer::Difference(active_types, types_to_download);
447 } 447 }
448 448
449 void SyncBackendHostImpl::EnableEncryptEverything() { 449 void SyncBackendHostImpl::EnableEncryptEverything() {
450 registrar_->sync_thread()->task_runner()->PostTask( 450 registrar_->sync_thread()->task_runner()->PostTask(
451 FROM_HERE, 451 FROM_HERE,
452 base::Bind(&SyncBackendHostCore::DoEnableEncryptEverything, core_.get())); 452 base::Bind(&SyncBackendHostCore::DoEnableEncryptEverything, core_.get()));
453 } 453 }
454 454
455 void SyncBackendHostImpl::ActivateDataType( 455 void SyncBackendHostImpl::ActivateDirectoryDataType(
456 syncer::ModelType type, syncer::ModelSafeGroup group, 456 syncer::ModelType type,
457 syncer::ModelSafeGroup group,
457 sync_driver::ChangeProcessor* change_processor) { 458 sync_driver::ChangeProcessor* change_processor) {
458 registrar_->ActivateDataType(type, group, change_processor, GetUserShare()); 459 registrar_->ActivateDataType(type, group, change_processor, GetUserShare());
459 } 460 }
460 461
461 void SyncBackendHostImpl::DeactivateDataType(syncer::ModelType type) { 462 void SyncBackendHostImpl::DeactivateDirectoryDataType(syncer::ModelType type) {
462 registrar_->DeactivateDataType(type); 463 registrar_->DeactivateDataType(type);
463 } 464 }
464 465
466 void SyncBackendHostImpl::ActivateNonBlockingDataType(
467 syncer::ModelType type,
468 scoped_ptr<syncer_v2::ActivationContext> activation_context) {
469 sync_context_proxy_->ConnectTypeToSync(type, activation_context.Pass());
470 }
471
472 void SyncBackendHostImpl::DeactivateNonBlockingDataType(
473 syncer::ModelType type) {
474 sync_context_proxy_->Disconnect(type);
475 }
476
465 syncer::UserShare* SyncBackendHostImpl::GetUserShare() const { 477 syncer::UserShare* SyncBackendHostImpl::GetUserShare() const {
466 return core_->sync_manager()->GetUserShare(); 478 return core_->sync_manager()->GetUserShare();
467 } 479 }
468 480
469 scoped_ptr<syncer_v2::SyncContextProxy> 481 scoped_ptr<syncer_v2::SyncContextProxy>
470 SyncBackendHostImpl::GetSyncContextProxy() { 482 SyncBackendHostImpl::GetSyncContextProxy() {
471 return sync_context_proxy_.get() ? scoped_ptr<syncer_v2::SyncContextProxy>( 483 return sync_context_proxy_.get() ? scoped_ptr<syncer_v2::SyncContextProxy>(
472 sync_context_proxy_->Clone()) 484 sync_context_proxy_->Clone())
473 : scoped_ptr<syncer_v2::SyncContextProxy>(); 485 : scoped_ptr<syncer_v2::SyncContextProxy>();
474 } 486 }
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) { 909 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) {
898 DCHECK(ui_thread_->BelongsToCurrentThread()); 910 DCHECK(ui_thread_->BelongsToCurrentThread());
899 frontend_callback.Run(); 911 frontend_callback.Run();
900 } 912 }
901 913
902 } // namespace browser_sync 914 } // namespace browser_sync
903 915
904 #undef SDVLOG 916 #undef SDVLOG
905 917
906 #undef SLOG 918 #undef SLOG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698