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

Side by Side Diff: sync/syncable/nigori_util.cc

Issue 805633004: Enable Null Syncable ID which is different than Root ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 6 years 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
« no previous file with comments | « sync/syncable/mutable_entry.cc ('k') | sync/syncable/parent_child_index_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « sync/syncable/mutable_entry.cc ('k') | sync/syncable/parent_child_index_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698