| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "sync/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 // the lookup of the root node will fail and we will skip encryption for that | 1136 // the lookup of the root node will fail and we will skip encryption for that |
| 1137 // type. | 1137 // type. |
| 1138 void SyncManagerImpl::ReEncryptEverything( | 1138 void SyncManagerImpl::ReEncryptEverything( |
| 1139 WriteTransaction* trans) { | 1139 WriteTransaction* trans) { |
| 1140 Cryptographer* cryptographer = trans->GetCryptographer(); | 1140 Cryptographer* cryptographer = trans->GetCryptographer(); |
| 1141 if (!cryptographer || !cryptographer->is_ready()) | 1141 if (!cryptographer || !cryptographer->is_ready()) |
| 1142 return; | 1142 return; |
| 1143 ModelTypeSet encrypted_types = GetEncryptedTypes(trans); | 1143 ModelTypeSet encrypted_types = GetEncryptedTypes(trans); |
| 1144 for (ModelTypeSet::Iterator iter = encrypted_types.First(); | 1144 for (ModelTypeSet::Iterator iter = encrypted_types.First(); |
| 1145 iter.Good(); iter.Inc()) { | 1145 iter.Good(); iter.Inc()) { |
| 1146 if (iter.Get() == PASSWORDS || iter.Get() == NIGORI) | 1146 if (iter.Get() == PASSWORDS || IsControlType(iter.Get())) |
| 1147 continue; // These types handle encryption differently. | 1147 continue; // These types handle encryption differently. |
| 1148 | 1148 |
| 1149 ReadNode type_root(trans); | 1149 ReadNode type_root(trans); |
| 1150 std::string tag = ModelTypeToRootTag(iter.Get()); | 1150 std::string tag = ModelTypeToRootTag(iter.Get()); |
| 1151 if (type_root.InitByTagLookup(tag) != BaseNode::INIT_OK) | 1151 if (type_root.InitByTagLookup(tag) != BaseNode::INIT_OK) |
| 1152 continue; // Don't try to reencrypt if the type's data is unavailable. | 1152 continue; // Don't try to reencrypt if the type's data is unavailable. |
| 1153 | 1153 |
| 1154 // Iterate through all children of this datatype. | 1154 // Iterate through all children of this datatype. |
| 1155 std::queue<int64> to_visit; | 1155 std::queue<int64> to_visit; |
| 1156 int64 child_id = type_root.GetFirstChildId(); | 1156 int64 child_id = type_root.GetFirstChildId(); |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1917 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1917 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1918 return kDefaultNudgeDelayMilliseconds; | 1918 return kDefaultNudgeDelayMilliseconds; |
| 1919 } | 1919 } |
| 1920 | 1920 |
| 1921 // static. | 1921 // static. |
| 1922 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1922 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1923 return kPreferencesNudgeDelayMilliseconds; | 1923 return kPreferencesNudgeDelayMilliseconds; |
| 1924 } | 1924 } |
| 1925 | 1925 |
| 1926 } // namespace syncer | 1926 } // namespace syncer |
| OLD | NEW |