| OLD | NEW |
| 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 "components/sync/driver/glue/sync_backend_host_impl.h" | 5 #include "components/sync/driver/glue/sync_backend_host_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 DCHECK(initialized()); | 515 DCHECK(initialized()); |
| 516 registrar_->sync_thread()->task_runner()->PostTask( | 516 registrar_->sync_thread()->task_runner()->PostTask( |
| 517 FROM_HERE, | 517 FROM_HERE, |
| 518 base::Bind(&SyncBackendHostCore::DisableDirectoryTypeDebugInfoForwarding, | 518 base::Bind(&SyncBackendHostCore::DisableDirectoryTypeDebugInfoForwarding, |
| 519 core_)); | 519 core_)); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void SyncBackendHostImpl::GetAllNodesForTypes( | 522 void SyncBackendHostImpl::GetAllNodesForTypes( |
| 523 syncer::ModelTypeSet types, | 523 syncer::ModelTypeSet types, |
| 524 base::Callback<void(const std::vector<syncer::ModelType>&, | 524 base::Callback<void(const std::vector<syncer::ModelType>&, |
| 525 ScopedVector<base::ListValue>)> callback) { | 525 std::vector<std::unique_ptr<base::ListValue>>)> |
| 526 callback) { |
| 526 DCHECK(initialized()); | 527 DCHECK(initialized()); |
| 527 registrar_->sync_thread()->task_runner()->PostTask( | 528 registrar_->sync_thread()->task_runner()->PostTask( |
| 528 FROM_HERE, base::Bind(&SyncBackendHostCore::GetAllNodesForTypes, core_, | 529 FROM_HERE, base::Bind(&SyncBackendHostCore::GetAllNodesForTypes, core_, |
| 529 types, frontend_task_runner_, callback)); | 530 types, frontend_task_runner_, callback)); |
| 530 } | 531 } |
| 531 | 532 |
| 532 void SyncBackendHostImpl::InitCore( | 533 void SyncBackendHostImpl::InitCore( |
| 533 std::unique_ptr<DoInitializeOptions> options) { | 534 std::unique_ptr<DoInitializeOptions> options) { |
| 534 registrar_->sync_thread()->task_runner()->PostTask( | 535 registrar_->sync_thread()->task_runner()->PostTask( |
| 535 FROM_HERE, base::Bind(&SyncBackendHostCore::DoInitialize, core_.get(), | 536 FROM_HERE, base::Bind(&SyncBackendHostCore::DoInitialize, core_.get(), |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 return; | 775 return; |
| 775 | 776 |
| 776 DCHECK(frontend_task_runner_->BelongsToCurrentThread()); | 777 DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
| 777 | 778 |
| 778 DVLOG(1) << "Connection status changed: " | 779 DVLOG(1) << "Connection status changed: " |
| 779 << syncer::ConnectionStatusToString(status); | 780 << syncer::ConnectionStatusToString(status); |
| 780 frontend_->OnConnectionStatusChange(status); | 781 frontend_->OnConnectionStatusChange(status); |
| 781 } | 782 } |
| 782 | 783 |
| 783 void SyncBackendHostImpl::HandleProtocolEventOnFrontendLoop( | 784 void SyncBackendHostImpl::HandleProtocolEventOnFrontendLoop( |
| 784 syncer::ProtocolEvent* event) { | 785 std::unique_ptr<syncer::ProtocolEvent> event) { |
| 785 std::unique_ptr<syncer::ProtocolEvent> scoped_event(event); | |
| 786 if (!frontend_) | 786 if (!frontend_) |
| 787 return; | 787 return; |
| 788 frontend_->OnProtocolEvent(*scoped_event); | 788 frontend_->OnProtocolEvent(*event); |
| 789 } | 789 } |
| 790 | 790 |
| 791 void SyncBackendHostImpl::HandleDirectoryCommitCountersUpdatedOnFrontendLoop( | 791 void SyncBackendHostImpl::HandleDirectoryCommitCountersUpdatedOnFrontendLoop( |
| 792 syncer::ModelType type, | 792 syncer::ModelType type, |
| 793 const syncer::CommitCounters& counters) { | 793 const syncer::CommitCounters& counters) { |
| 794 if (!frontend_) | 794 if (!frontend_) |
| 795 return; | 795 return; |
| 796 frontend_->OnDirectoryTypeCommitCounterUpdated(type, counters); | 796 frontend_->OnDirectoryTypeCommitCounterUpdated(type, counters); |
| 797 } | 797 } |
| 798 | 798 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) { | 849 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) { |
| 850 DCHECK(ui_thread_->BelongsToCurrentThread()); | 850 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 851 frontend_callback.Run(); | 851 frontend_callback.Run(); |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace browser_sync | 854 } // namespace browser_sync |
| 855 | 855 |
| 856 #undef SDVLOG | 856 #undef SDVLOG |
| 857 | 857 |
| 858 #undef SLOG | 858 #undef SLOG |
| OLD | NEW |