Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Side by Side Diff: components/sync/core_impl/sync_encryption_handler_impl.cc

Issue 2278333002: Supplimentary identifier for passwords specific (Closed)
Patch Set: cleanup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/core_impl/sync_encryption_handler_impl.h" 5 #include "components/sync/core_impl/sync_encryption_handler_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 843
844 // Passwords are encrypted with their own legacy scheme. Passwords are always 844 // Passwords are encrypted with their own legacy scheme. Passwords are always
845 // encrypted so we don't need to check GetEncryptedTypes() here. 845 // encrypted so we don't need to check GetEncryptedTypes() here.
846 ReadNode passwords_root(trans); 846 ReadNode passwords_root(trans);
847 if (passwords_root.InitTypeRoot(PASSWORDS) == BaseNode::INIT_OK) { 847 if (passwords_root.InitTypeRoot(PASSWORDS) == BaseNode::INIT_OK) {
848 int64_t child_id = passwords_root.GetFirstChildId(); 848 int64_t child_id = passwords_root.GetFirstChildId();
849 while (child_id != kInvalidId) { 849 while (child_id != kInvalidId) {
850 WriteNode child(trans); 850 WriteNode child(trans);
851 if (child.InitByIdLookup(child_id) != BaseNode::INIT_OK) 851 if (child.InitByIdLookup(child_id) != BaseNode::INIT_OK)
852 break; // Possible if we failed to decrypt the data for some reason. 852 break; // Possible if we failed to decrypt the data for some reason.
853 child.SetPasswordSpecifics(child.GetPasswordSpecifics()); 853 child.SetPasswordSpecifics(child.GetPasswordSpecifics(),
854 GetPassphraseType(trans->GetWrappedTrans()));
854 child_id = child.GetSuccessorId(); 855 child_id = child.GetSuccessorId();
855 } 856 }
856 } 857 }
857 858
858 DVLOG(1) << "Re-encrypt everything complete."; 859 DVLOG(1) << "Re-encrypt everything complete.";
859 860
860 // NOTE: We notify from within a transaction. 861 // NOTE: We notify from within a transaction.
861 FOR_EACH_OBSERVER(SyncEncryptionHandler::Observer, observers_, 862 FOR_EACH_OBSERVER(SyncEncryptionHandler::Observer, observers_,
862 OnEncryptionComplete()); 863 OnEncryptionComplete());
863 } 864 }
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime( 1667 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime(
1667 PassphraseType passphrase_type) const { 1668 PassphraseType passphrase_type) const {
1668 if (passphrase_type == PassphraseType::FROZEN_IMPLICIT_PASSPHRASE) 1669 if (passphrase_type == PassphraseType::FROZEN_IMPLICIT_PASSPHRASE)
1669 return migration_time(); 1670 return migration_time();
1670 else if (passphrase_type == PassphraseType::CUSTOM_PASSPHRASE) 1671 else if (passphrase_type == PassphraseType::CUSTOM_PASSPHRASE)
1671 return custom_passphrase_time(); 1672 return custom_passphrase_time();
1672 return base::Time(); 1673 return base::Time();
1673 } 1674 }
1674 1675
1675 } // namespace syncer 1676 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698