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

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

Issue 1081413003: [Sync] Have configuration specify which datatypes are ready to sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix components_unittests Created 5 years, 8 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/logging.h" 8 #include "base/logging.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 void SyncBackendHostImpl::UnregisterInvalidationIds() { 319 void SyncBackendHostImpl::UnregisterInvalidationIds() {
320 if (invalidation_handler_registered_) { 320 if (invalidation_handler_registered_) {
321 invalidator_->UpdateRegisteredInvalidationIds( 321 invalidator_->UpdateRegisteredInvalidationIds(
322 this, 322 this,
323 syncer::ObjectIdSet()); 323 syncer::ObjectIdSet());
324 } 324 }
325 } 325 }
326 326
327 void SyncBackendHostImpl::ConfigureDataTypes( 327 syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes(
328 syncer::ConfigureReason reason, 328 syncer::ConfigureReason reason,
329 const DataTypeConfigStateMap& config_state_map, 329 const DataTypeConfigStateMap& config_state_map,
330 const base::Callback<void(syncer::ModelTypeSet, 330 const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
331 syncer::ModelTypeSet)>& ready_task, 331 ready_task,
332 const base::Callback<void()>& retry_callback) { 332 const base::Callback<void()>& retry_callback) {
333 // Only one configure is allowed at a time. This is guaranteed by our 333 // Only one configure is allowed at a time. This is guaranteed by our
334 // callers. The SyncBackendHostImpl requests one configure as the backend is 334 // callers. The SyncBackendHostImpl requests one configure as the backend is
335 // initializing and waits for it to complete. After initialization, all 335 // initializing and waits for it to complete. After initialization, all
336 // configurations will pass through the DataTypeManager, which is careful to 336 // configurations will pass through the DataTypeManager, which is careful to
337 // never send a new configure request until the current request succeeds. 337 // never send a new configure request until the current request succeeds.
338 338
339 // The SyncBackendRegistrar's routing info will be updated by adding the 339 // The SyncBackendRegistrar's routing info will be updated by adding the
340 // types_to_add to the list then removing types_to_remove. Any types which 340 // types_to_add to the list then removing types_to_remove. Any types which
341 // are not in either of those sets will remain untouched. 341 // are not in either of those sets will remain untouched.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // touched. 438 // touched.
439 RequestConfigureSyncer(reason, 439 RequestConfigureSyncer(reason,
440 types_to_download, 440 types_to_download,
441 types_to_purge, 441 types_to_purge,
442 fatal_types, 442 fatal_types,
443 unapply_types, 443 unapply_types,
444 inactive_types, 444 inactive_types,
445 routing_info, 445 routing_info,
446 ready_task, 446 ready_task,
447 retry_callback); 447 retry_callback);
448
449 DCHECK(syncer::Intersection(active_types, types_to_purge).Empty());
450 DCHECK(syncer::Intersection(active_types, fatal_types).Empty());
451 DCHECK(syncer::Intersection(active_types, unapply_types).Empty());
452 DCHECK(syncer::Intersection(active_types, inactive_types).Empty());
453 return syncer::Difference(active_types, types_to_download);
448 } 454 }
449 455
450 void SyncBackendHostImpl::EnableEncryptEverything() { 456 void SyncBackendHostImpl::EnableEncryptEverything() {
451 registrar_->sync_thread()->message_loop()->PostTask(FROM_HERE, 457 registrar_->sync_thread()->message_loop()->PostTask(FROM_HERE,
452 base::Bind(&SyncBackendHostCore::DoEnableEncryptEverything, 458 base::Bind(&SyncBackendHostCore::DoEnableEncryptEverything,
453 core_.get())); 459 core_.get()));
454 } 460 }
455 461
456 void SyncBackendHostImpl::ActivateDataType( 462 void SyncBackendHostImpl::ActivateDataType(
457 syncer::ModelType type, syncer::ModelSafeGroup group, 463 syncer::ModelType type, syncer::ModelSafeGroup group,
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 895
890 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { 896 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() {
891 return registrar_->sync_thread()->message_loop(); 897 return registrar_->sync_thread()->message_loop();
892 } 898 }
893 899
894 } // namespace browser_sync 900 } // namespace browser_sync
895 901
896 #undef SDVLOG 902 #undef SDVLOG
897 903
898 #undef SLOG 904 #undef SLOG
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_impl.h ('k') | chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698