| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 NOTREACHED(); | 105 NOTREACHED(); |
| 106 return false; | 106 return false; |
| 107 } | 107 } |
| 108 | 108 |
| 109 std::queue<Id> to_visit; | 109 std::queue<Id> to_visit; |
| 110 Id id_string = type_root.GetFirstChildId(); | 110 Id id_string = type_root.GetFirstChildId(); |
| 111 to_visit.push(id_string); | 111 to_visit.push(id_string); |
| 112 while (!to_visit.empty()) { | 112 while (!to_visit.empty()) { |
| 113 id_string = to_visit.front(); | 113 id_string = to_visit.front(); |
| 114 to_visit.pop(); | 114 to_visit.pop(); |
| 115 if (id_string.IsRoot()) | 115 if (id_string.IsNull()) |
| 116 continue; | 116 continue; |
| 117 | 117 |
| 118 Entry child(trans, GET_BY_ID, id_string); | 118 Entry child(trans, GET_BY_ID, id_string); |
| 119 if (!child.good()) { | 119 if (!child.good()) { |
| 120 NOTREACHED(); | 120 NOTREACHED(); |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 if (child.GetIsDir()) { | 123 if (child.GetIsDir()) { |
| 124 Id child_id_string = child.GetFirstChildId(); | 124 Id child_id_string = child.GetFirstChildId(); |
| 125 // Traverse the children. | 125 // Traverse the children. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 encrypted_types.Put(FAVICON_TRACKING); | 314 encrypted_types.Put(FAVICON_TRACKING); |
| 315 if (nigori.encrypt_articles()) | 315 if (nigori.encrypt_articles()) |
| 316 encrypted_types.Put(ARTICLES); | 316 encrypted_types.Put(ARTICLES); |
| 317 if (nigori.encrypt_app_list()) | 317 if (nigori.encrypt_app_list()) |
| 318 encrypted_types.Put(APP_LIST); | 318 encrypted_types.Put(APP_LIST); |
| 319 return encrypted_types; | 319 return encrypted_types; |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace syncable | 322 } // namespace syncable |
| 323 } // namespace syncer | 323 } // namespace syncer |
| OLD | NEW |