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

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

Issue 1146533005: [Sync] InvalidationService shouldn't CHECK when registering ObjectId for more than one handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from Bartosz. Created 5 years, 7 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 base::Unretained(detached_registrar))); 311 base::Unretained(detached_registrar)));
312 312
313 if (sync_thread_claimed) 313 if (sync_thread_claimed)
314 return detached_registrar->ReleaseSyncThread(); 314 return detached_registrar->ReleaseSyncThread();
315 else 315 else
316 return scoped_ptr<base::Thread>(); 316 return scoped_ptr<base::Thread>();
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 CHECK(invalidator_->UpdateRegisteredInvalidationIds(this,
322 this, 322 syncer::ObjectIdSet()));
323 syncer::ObjectIdSet());
324 } 323 }
325 } 324 }
326 325
327 syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( 326 syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes(
328 syncer::ConfigureReason reason, 327 syncer::ConfigureReason reason,
329 const DataTypeConfigStateMap& config_state_map, 328 const DataTypeConfigStateMap& config_state_map,
330 const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>& 329 const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
331 ready_task, 330 ready_task,
332 const base::Callback<void()>& retry_callback) { 331 const base::Callback<void()>& retry_callback) {
333 // Only one configure is allowed at a time. This is guaranteed by our 332 // Only one configure is allowed at a time. This is guaranteed by our
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 syncer::ModelTypeSet)>& ready_task) { 616 syncer::ModelTypeSet)>& ready_task) {
618 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/458406 is 617 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/458406 is
619 // fixed. 618 // fixed.
620 tracked_objects::ScopedTracker tracking_profile1( 619 tracked_objects::ScopedTracker tracking_profile1(
621 FROM_HERE_WITH_EXPLICIT_FUNCTION( 620 FROM_HERE_WITH_EXPLICIT_FUNCTION(
622 "458406 SyncBackendHostImpl::FinishConfigureDataTOFL")); 621 "458406 SyncBackendHostImpl::FinishConfigureDataTOFL"));
623 if (!frontend_) 622 if (!frontend_)
624 return; 623 return;
625 624
626 if (invalidator_) { 625 if (invalidator_) {
627 invalidator_->UpdateRegisteredInvalidationIds( 626 CHECK(invalidator_->UpdateRegisteredInvalidationIds(
628 this, 627 this, ModelTypeSetToObjectIdSet(enabled_types)));
629 ModelTypeSetToObjectIdSet(enabled_types));
630 } 628 }
631 629
632 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/458406 is 630 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/458406 is
633 // fixed. 631 // fixed.
634 tracked_objects::ScopedTracker tracking_profile2( 632 tracked_objects::ScopedTracker tracking_profile2(
635 FROM_HERE_WITH_EXPLICIT_FUNCTION( 633 FROM_HERE_WITH_EXPLICIT_FUNCTION(
636 "458406 SyncBackendHostImpl::FinishConfigureDataTOFL::ReadyTask")); 634 "458406 SyncBackendHostImpl::FinishConfigureDataTOFL::ReadyTask"));
637 if (!ready_task.is_null()) 635 if (!ready_task.is_null())
638 ready_task.Run(succeeded_configuration_types, failed_configuration_types); 636 ready_task.Run(succeeded_configuration_types, failed_configuration_types);
639 } 637 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 896
899 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { 897 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() {
900 return registrar_->sync_thread()->message_loop(); 898 return registrar_->sync_thread()->message_loop();
901 } 899 }
902 900
903 } // namespace browser_sync 901 } // namespace browser_sync
904 902
905 #undef SDVLOG 903 #undef SDVLOG
906 904
907 #undef SLOG 905 #undef SLOG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698