| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 void SyncBackendHost::Core::OnClearServerDataSucceeded() { | 498 void SyncBackendHost::Core::OnClearServerDataSucceeded() { |
| 499 if (!sync_loop_) | 499 if (!sync_loop_) |
| 500 return; | 500 return; |
| 501 DCHECK_EQ(MessageLoop::current(), sync_loop_); | 501 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| 502 host_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, | 502 host_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, |
| 503 &Core::HandleClearServerDataSucceededOnFrontendLoop)); | 503 &Core::HandleClearServerDataSucceededOnFrontendLoop)); |
| 504 } | 504 } |
| 505 | 505 |
| 506 void SyncBackendHost::Core::OnEncryptionComplete( | 506 void SyncBackendHost::Core::OnEncryptionComplete( |
| 507 const syncable::ModelTypeSet& encrypted_types) { | 507 const syncable::ModelTypeSet& encrypted_types, |
| 508 bool encrypt_everything) { |
| 508 if (!sync_loop_) | 509 if (!sync_loop_) |
| 509 return; | 510 return; |
| 510 DCHECK_EQ(MessageLoop::current(), sync_loop_); | 511 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| 511 host_->frontend_loop_->PostTask( | 512 host_->frontend_loop_->PostTask( |
| 512 FROM_HERE, | 513 FROM_HERE, |
| 513 NewRunnableMethod(this, &Core::NotifyEncryptionComplete, | 514 NewRunnableMethod(this, &Core::NotifyEncryptionComplete, |
| 514 encrypted_types)); | 515 encrypted_types, encrypt_everything)); |
| 515 } | 516 } |
| 516 | 517 |
| 517 void SyncBackendHost::Core::OnActionableError( | 518 void SyncBackendHost::Core::OnActionableError( |
| 518 const browser_sync::SyncProtocolError& sync_error) { | 519 const browser_sync::SyncProtocolError& sync_error) { |
| 519 if (!sync_loop_) | 520 if (!sync_loop_) |
| 520 return; | 521 return; |
| 521 DCHECK_EQ(MessageLoop::current(), sync_loop_); | 522 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| 522 host_->frontend_loop_->PostTask( | 523 host_->frontend_loop_->PostTask( |
| 523 FROM_HERE, | 524 FROM_HERE, |
| 524 NewRunnableMethod(this, &Core::HandleActionableErrorEventOnFrontendLoop, | 525 NewRunnableMethod(this, &Core::HandleActionableErrorEventOnFrontendLoop, |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 return; | 789 return; |
| 789 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 790 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 790 TokenAvailableDetails details(GaiaConstants::kSyncService, token); | 791 TokenAvailableDetails details(GaiaConstants::kSyncService, token); |
| 791 content::NotificationService::current()->Notify( | 792 content::NotificationService::current()->Notify( |
| 792 chrome::NOTIFICATION_TOKEN_UPDATED, | 793 chrome::NOTIFICATION_TOKEN_UPDATED, |
| 793 content::Source<Profile>(host_->profile_), | 794 content::Source<Profile>(host_->profile_), |
| 794 content::Details<const TokenAvailableDetails>(&details)); | 795 content::Details<const TokenAvailableDetails>(&details)); |
| 795 } | 796 } |
| 796 | 797 |
| 797 void SyncBackendHost::Core::NotifyEncryptionComplete( | 798 void SyncBackendHost::Core::NotifyEncryptionComplete( |
| 798 const syncable::ModelTypeSet& encrypted_types) { | 799 const syncable::ModelTypeSet& encrypted_types, |
| 800 bool encrypt_everything) { |
| 799 if (!host_) | 801 if (!host_) |
| 800 return; | 802 return; |
| 801 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 803 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
| 802 host_->frontend_->OnEncryptionComplete(encrypted_types); | 804 host_->frontend_->OnEncryptionComplete( |
| 805 encrypted_types, encrypt_everything); |
| 803 } | 806 } |
| 804 | 807 |
| 805 void SyncBackendHost::Core::HandleSyncCycleCompletedOnFrontendLoop( | 808 void SyncBackendHost::Core::HandleSyncCycleCompletedOnFrontendLoop( |
| 806 SyncSessionSnapshot* snapshot) { | 809 SyncSessionSnapshot* snapshot) { |
| 807 if (!host_ || !host_->frontend_) | 810 if (!host_ || !host_->frontend_) |
| 808 return; | 811 return; |
| 809 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 812 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
| 810 | 813 |
| 811 host_->last_snapshot_.reset(snapshot); | 814 host_->last_snapshot_.reset(snapshot); |
| 812 | 815 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 FROM_HERE, | 1047 FROM_HERE, |
| 1045 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, | 1048 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, |
| 1046 core_.get(), sync_thread_done_callback)); | 1049 core_.get(), sync_thread_done_callback)); |
| 1047 } | 1050 } |
| 1048 | 1051 |
| 1049 #undef SVLOG | 1052 #undef SVLOG |
| 1050 | 1053 |
| 1051 #undef SLOG | 1054 #undef SLOG |
| 1052 | 1055 |
| 1053 } // namespace browser_sync | 1056 } // namespace browser_sync |
| OLD | NEW |