| 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 "chrome/browser/sync/glue/sync_backend_host_core.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_core.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/browser/sync/glue/invalidation_adapter.h" | 9 #include "chrome/browser/sync/glue/invalidation_adapter.h" |
| 10 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" | 10 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // UpdateCredentials can be called during backend initialization, possibly | 450 // UpdateCredentials can be called during backend initialization, possibly |
| 451 // when backend initialization has failed but hasn't notified the UI thread | 451 // when backend initialization has failed but hasn't notified the UI thread |
| 452 // yet. In that case, the sync manager may have been destroyed on the sync | 452 // yet. In that case, the sync manager may have been destroyed on the sync |
| 453 // thread before this task was executed, so we do nothing. | 453 // thread before this task was executed, so we do nothing. |
| 454 if (sync_manager_) { | 454 if (sync_manager_) { |
| 455 sync_manager_->UpdateCredentials(credentials); | 455 sync_manager_->UpdateCredentials(credentials); |
| 456 } | 456 } |
| 457 } | 457 } |
| 458 | 458 |
| 459 void SyncBackendHostCore::DoStartSyncing( | 459 void SyncBackendHostCore::DoStartSyncing( |
| 460 const syncer::ModelSafeRoutingInfo& routing_info) { | 460 const syncer::ModelSafeRoutingInfo& routing_info, |
| 461 base::Time last_poll_time) { |
| 461 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); | 462 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); |
| 462 sync_manager_->StartSyncingNormally(routing_info); | 463 sync_manager_->StartSyncingNormally(routing_info, last_poll_time); |
| 463 } | 464 } |
| 464 | 465 |
| 465 void SyncBackendHostCore::DoSetEncryptionPassphrase( | 466 void SyncBackendHostCore::DoSetEncryptionPassphrase( |
| 466 const std::string& passphrase, | 467 const std::string& passphrase, |
| 467 bool is_explicit) { | 468 bool is_explicit) { |
| 468 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); | 469 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); |
| 469 sync_manager_->GetEncryptionHandler()->SetEncryptionPassphrase( | 470 sync_manager_->GetEncryptionHandler()->SetEncryptionPassphrase( |
| 470 passphrase, is_explicit); | 471 passphrase, is_explicit); |
| 471 } | 472 } |
| 472 | 473 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 base::TimeDelta::FromSeconds(kSaveChangesIntervalSeconds), | 723 base::TimeDelta::FromSeconds(kSaveChangesIntervalSeconds), |
| 723 this, &SyncBackendHostCore::SaveChanges); | 724 this, &SyncBackendHostCore::SaveChanges); |
| 724 } | 725 } |
| 725 | 726 |
| 726 void SyncBackendHostCore::SaveChanges() { | 727 void SyncBackendHostCore::SaveChanges() { |
| 727 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); | 728 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); |
| 728 sync_manager_->SaveChanges(); | 729 sync_manager_->SaveChanges(); |
| 729 } | 730 } |
| 730 | 731 |
| 731 } // namespace browser_sync | 732 } // namespace browser_sync |
| OLD | NEW |