| 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/public/sync_manager.h" | 5 #include "sync/internal_api/public/sync_manager.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 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 // which data for some or all types is not currently available. In that case, | 1559 // which data for some or all types is not currently available. In that case, |
| 1560 // the lookup of the root node will fail and we will skip encryption for that | 1560 // the lookup of the root node will fail and we will skip encryption for that |
| 1561 // type. | 1561 // type. |
| 1562 void SyncManager::SyncInternal::ReEncryptEverything(WriteTransaction* trans) { | 1562 void SyncManager::SyncInternal::ReEncryptEverything(WriteTransaction* trans) { |
| 1563 Cryptographer* cryptographer = trans->GetCryptographer(); | 1563 Cryptographer* cryptographer = trans->GetCryptographer(); |
| 1564 if (!cryptographer || !cryptographer->is_ready()) | 1564 if (!cryptographer || !cryptographer->is_ready()) |
| 1565 return; | 1565 return; |
| 1566 syncable::ModelTypeSet encrypted_types = GetEncryptedTypes(trans); | 1566 syncable::ModelTypeSet encrypted_types = GetEncryptedTypes(trans); |
| 1567 for (syncable::ModelTypeSet::Iterator iter = encrypted_types.First(); | 1567 for (syncable::ModelTypeSet::Iterator iter = encrypted_types.First(); |
| 1568 iter.Good(); iter.Inc()) { | 1568 iter.Good(); iter.Inc()) { |
| 1569 if (iter.Get() == syncable::PASSWORDS || | 1569 if (iter.Get() == syncable::PASSWORDS || IsControlType(iter.Get())) |
| 1570 iter.Get() == syncable::NIGORI) | |
| 1571 continue; // These types handle encryption differently. | 1570 continue; // These types handle encryption differently. |
| 1572 | 1571 |
| 1573 ReadNode type_root(trans); | 1572 ReadNode type_root(trans); |
| 1574 std::string tag = syncable::ModelTypeToRootTag(iter.Get()); | 1573 std::string tag = syncable::ModelTypeToRootTag(iter.Get()); |
| 1575 if (type_root.InitByTagLookup(tag) != csync::BaseNode::INIT_OK) | 1574 if (type_root.InitByTagLookup(tag) != csync::BaseNode::INIT_OK) |
| 1576 continue; // Don't try to reencrypt if the type's data is unavailable. | 1575 continue; // Don't try to reencrypt if the type's data is unavailable. |
| 1577 | 1576 |
| 1578 // Iterate through all children of this datatype. | 1577 // Iterate through all children of this datatype. |
| 1579 std::queue<int64> to_visit; | 1578 std::queue<int64> to_visit; |
| 1580 int64 child_id = type_root.GetFirstChildId(); | 1579 int64 child_id = type_root.GetFirstChildId(); |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 share->directory->GetDownloadProgress(i.Get(), &marker); | 2481 share->directory->GetDownloadProgress(i.Get(), &marker); |
| 2483 | 2482 |
| 2484 if (marker.token().empty()) | 2483 if (marker.token().empty()) |
| 2485 result.Put(i.Get()); | 2484 result.Put(i.Get()); |
| 2486 | 2485 |
| 2487 } | 2486 } |
| 2488 return result; | 2487 return result; |
| 2489 } | 2488 } |
| 2490 | 2489 |
| 2491 } // namespace csync | 2490 } // namespace csync |
| OLD | NEW |