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_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 "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/invalidation/invalidation_service.h" | 9 #include "chrome/browser/invalidation/invalidation_service.h" |
10 #include "chrome/browser/invalidation/invalidation_service_factory.h" | 10 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 | 655 |
656 void SyncBackendHostImpl::OnIncomingInvalidation( | 656 void SyncBackendHostImpl::OnIncomingInvalidation( |
657 const syncer::ObjectIdInvalidationMap& invalidation_map) { | 657 const syncer::ObjectIdInvalidationMap& invalidation_map) { |
658 registrar_->sync_thread()->message_loop()->PostTask( | 658 registrar_->sync_thread()->message_loop()->PostTask( |
659 FROM_HERE, | 659 FROM_HERE, |
660 base::Bind(&SyncBackendHostCore::DoOnIncomingInvalidation, | 660 base::Bind(&SyncBackendHostCore::DoOnIncomingInvalidation, |
661 core_.get(), | 661 core_.get(), |
662 invalidation_map)); | 662 invalidation_map)); |
663 } | 663 } |
664 | 664 |
| 665 std::string SyncBackendHostImpl::GetOwnerName() const { |
| 666 return "SyncBackendHostImpl"; |
| 667 } |
| 668 |
665 bool SyncBackendHostImpl::CheckPassphraseAgainstCachedPendingKeys( | 669 bool SyncBackendHostImpl::CheckPassphraseAgainstCachedPendingKeys( |
666 const std::string& passphrase) const { | 670 const std::string& passphrase) const { |
667 DCHECK(cached_pending_keys_.has_blob()); | 671 DCHECK(cached_pending_keys_.has_blob()); |
668 DCHECK(!passphrase.empty()); | 672 DCHECK(!passphrase.empty()); |
669 syncer::Nigori nigori; | 673 syncer::Nigori nigori; |
670 nigori.InitByDerivation("localhost", "dummy", passphrase); | 674 nigori.InitByDerivation("localhost", "dummy", passphrase); |
671 std::string plaintext; | 675 std::string plaintext; |
672 bool result = nigori.Decrypt(cached_pending_keys_.blob(), &plaintext); | 676 bool result = nigori.Decrypt(cached_pending_keys_.blob(), &plaintext); |
673 DVLOG_IF(1, result) << "Passphrase failed to decrypt pending keys."; | 677 DVLOG_IF(1, result) << "Passphrase failed to decrypt pending keys."; |
674 return result; | 678 return result; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { | 747 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { |
744 return registrar_->sync_thread()->message_loop(); | 748 return registrar_->sync_thread()->message_loop(); |
745 } | 749 } |
746 | 750 |
747 } // namespace browser_sync | 751 } // namespace browser_sync |
748 | 752 |
749 #undef SDVLOG | 753 #undef SDVLOG |
750 | 754 |
751 #undef SLOG | 755 #undef SLOG |
752 | 756 |
OLD | NEW |