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

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

Issue 398423002: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed wrong signin_scoped_device_id assert from LocalDeviceInfoProvider. Created 6 years, 5 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 "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 if (!frontend_) 644 if (!frontend_)
645 return; 645 return;
646 646
647 frontend_->OnSyncConfigureRetry(); 647 frontend_->OnSyncConfigureRetry();
648 } 648 }
649 649
650 void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop( 650 void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop(
651 const syncer::WeakHandle<syncer::JsBackend> js_backend, 651 const syncer::WeakHandle<syncer::JsBackend> js_backend,
652 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener> 652 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>
653 debug_info_listener, 653 debug_info_listener,
654 syncer::SyncContextProxy* sync_context_proxy) { 654 syncer::SyncContextProxy* sync_context_proxy,
655 const std::string& cache_guid) {
655 DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); 656 DCHECK_EQ(base::MessageLoop::current(), frontend_loop_);
656 657
657 if (sync_context_proxy) 658 if (sync_context_proxy)
658 sync_context_proxy_ = sync_context_proxy->Clone(); 659 sync_context_proxy_ = sync_context_proxy->Clone();
659 660
660 if (!frontend_) 661 if (!frontend_)
661 return; 662 return;
662 663
663 initialized_ = true; 664 initialized_ = true;
664 665
665 if (invalidator_) { 666 if (invalidator_) {
666 invalidator_->RegisterInvalidationHandler(this); 667 invalidator_->RegisterInvalidationHandler(this);
667 invalidation_handler_registered_ = true; 668 invalidation_handler_registered_ = true;
668 669
669 // Fake a state change to initialize the SyncManager's cached invalidator 670 // Fake a state change to initialize the SyncManager's cached invalidator
670 // state. 671 // state.
671 OnInvalidatorStateChange(invalidator_->GetInvalidatorState()); 672 OnInvalidatorStateChange(invalidator_->GetInvalidatorState());
672 } 673 }
673 674
674 // Start forwarding refresh requests to the SyncManager 675 // Start forwarding refresh requests to the SyncManager
675 notification_registrar_.Add(this, chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, 676 notification_registrar_.Add(this, chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
676 content::Source<Profile>(profile_)); 677 content::Source<Profile>(profile_));
677 678
678 // Now that we've downloaded the control types, we can see if there are any 679 // Now that we've downloaded the control types, we can see if there are any
679 // experimental types to enable. This should be done before we inform 680 // experimental types to enable. This should be done before we inform
680 // the frontend to ensure they're visible in the customize screen. 681 // the frontend to ensure they're visible in the customize screen.
681 AddExperimentalTypes(); 682 AddExperimentalTypes();
682 frontend_->OnBackendInitialized(js_backend, 683 frontend_->OnBackendInitialized(js_backend,
683 debug_info_listener, 684 debug_info_listener,
685 cache_guid,
684 true); 686 true);
685 } 687 }
686 688
687 void SyncBackendHostImpl::HandleInitializationFailureOnFrontendLoop() { 689 void SyncBackendHostImpl::HandleInitializationFailureOnFrontendLoop() {
688 DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); 690 DCHECK_EQ(base::MessageLoop::current(), frontend_loop_);
689 if (!frontend_) 691 if (!frontend_)
690 return; 692 return;
691 693
692 frontend_->OnBackendInitialized( 694 frontend_->OnBackendInitialized(
693 syncer::WeakHandle<syncer::JsBackend>(), 695 syncer::WeakHandle<syncer::JsBackend>(),
694 syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), 696 syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(),
697 "",
695 false); 698 false);
696 } 699 }
697 700
698 void SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop( 701 void SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop(
699 const syncer::sessions::SyncSessionSnapshot& snapshot) { 702 const syncer::sessions::SyncSessionSnapshot& snapshot) {
700 if (!frontend_) 703 if (!frontend_)
701 return; 704 return;
702 DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); 705 DCHECK_EQ(base::MessageLoop::current(), frontend_loop_);
703 706
704 last_snapshot_ = snapshot; 707 last_snapshot_ = snapshot;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 884
882 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { 885 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() {
883 return registrar_->sync_thread()->message_loop(); 886 return registrar_->sync_thread()->message_loop();
884 } 887 }
885 888
886 } // namespace browser_sync 889 } // namespace browser_sync
887 890
888 #undef SDVLOG 891 #undef SDVLOG
889 892
890 #undef SLOG 893 #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