OLD | NEW |
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 "sync/syncable/nigori_util.h" | 5 #include "sync/syncable/nigori_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Mainly for testing. | 93 // Mainly for testing. |
94 bool VerifyDataTypeEncryptionForTest( | 94 bool VerifyDataTypeEncryptionForTest( |
95 BaseTransaction* const trans, | 95 BaseTransaction* const trans, |
96 ModelType type, | 96 ModelType type, |
97 bool is_encrypted) { | 97 bool is_encrypted) { |
98 Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans); | 98 Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans); |
99 if (type == PASSWORDS || IsControlType(type)) { | 99 if (type == PASSWORDS || IsControlType(type)) { |
100 NOTREACHED(); | 100 NOTREACHED(); |
101 return true; | 101 return true; |
102 } | 102 } |
103 std::string type_tag = ModelTypeToRootTag(type); | 103 Entry type_root(trans, GET_TYPE_ROOT, type); |
104 Entry type_root(trans, GET_BY_SERVER_TAG, type_tag); | |
105 if (!type_root.good()) { | 104 if (!type_root.good()) { |
106 NOTREACHED(); | 105 NOTREACHED(); |
107 return false; | 106 return false; |
108 } | 107 } |
109 | 108 |
110 std::queue<Id> to_visit; | 109 std::queue<Id> to_visit; |
111 Id id_string = type_root.GetFirstChildId(); | 110 Id id_string = type_root.GetFirstChildId(); |
112 to_visit.push(id_string); | 111 to_visit.push(id_string); |
113 while (!to_visit.empty()) { | 112 while (!to_visit.empty()) { |
114 id_string = to_visit.front(); | 113 id_string = to_visit.front(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 encrypted_types.Put(FAVICON_TRACKING); | 314 encrypted_types.Put(FAVICON_TRACKING); |
316 if (nigori.encrypt_articles()) | 315 if (nigori.encrypt_articles()) |
317 encrypted_types.Put(ARTICLES); | 316 encrypted_types.Put(ARTICLES); |
318 if (nigori.encrypt_app_list()) | 317 if (nigori.encrypt_app_list()) |
319 encrypted_types.Put(APP_LIST); | 318 encrypted_types.Put(APP_LIST); |
320 return encrypted_types; | 319 return encrypted_types; |
321 } | 320 } |
322 | 321 |
323 } // namespace syncable | 322 } // namespace syncable |
324 } // namespace syncer | 323 } // namespace syncer |
OLD | NEW |