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