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

Side by Side Diff: sync/internal_api/base_node.cc

Issue 1942593002: [Sync] Do not check IS_DIR bit on nigori node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base_node.h" 5 #include "sync/internal_api/public/base_node.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <stack> 9 #include <stack>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return GetEntry()->GetMtime(); 156 return GetEntry()->GetMtime();
157 } 157 }
158 158
159 bool BaseNode::GetIsFolder() const { 159 bool BaseNode::GetIsFolder() const {
160 return GetEntry()->GetIsDir(); 160 return GetEntry()->GetIsDir();
161 } 161 }
162 162
163 bool BaseNode::GetIsPermanentFolder() const { 163 bool BaseNode::GetIsPermanentFolder() const {
164 bool is_permanent_folder = !GetEntry()->GetUniqueServerTag().empty(); 164 bool is_permanent_folder = !GetEntry()->GetUniqueServerTag().empty();
165 if (is_permanent_folder) { 165 if (is_permanent_folder) {
166 // If the node is a permanent folder it must also have IS_DIR bit set. 166 // If the node is a permanent folder it must also have IS_DIR bit set,
167 DCHECK(GetIsFolder()); 167 // except some nigori nodes on old accounts.
168 DCHECK(GetIsFolder() || GetModelType() == NIGORI);
168 } 169 }
169 return is_permanent_folder; 170 return is_permanent_folder;
170 } 171 }
171 172
172 std::string BaseNode::GetTitle() const { 173 std::string BaseNode::GetTitle() const {
173 std::string result; 174 std::string result;
174 // TODO(zea): refactor bookmarks to not need this functionality. 175 // TODO(zea): refactor bookmarks to not need this functionality.
175 if (BOOKMARKS == GetModelType() && 176 if (BOOKMARKS == GetModelType() &&
176 GetEntry()->GetSpecifics().has_encrypted()) { 177 GetEntry()->GetSpecifics().has_encrypted()) {
177 // Special case for legacy bookmarks dealing with encryption. 178 // Special case for legacy bookmarks dealing with encryption.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 const sync_pb::EntitySpecifics& specifics) { 282 const sync_pb::EntitySpecifics& specifics) {
282 ModelType type = GetModelTypeFromSpecifics(specifics); 283 ModelType type = GetModelTypeFromSpecifics(specifics);
283 DCHECK_NE(UNSPECIFIED, type); 284 DCHECK_NE(UNSPECIFIED, type);
284 if (GetModelType() != UNSPECIFIED) { 285 if (GetModelType() != UNSPECIFIED) {
285 DCHECK_EQ(GetModelType(), type); 286 DCHECK_EQ(GetModelType(), type);
286 } 287 }
287 unencrypted_data_.CopyFrom(specifics); 288 unencrypted_data_.CopyFrom(specifics);
288 } 289 }
289 290
290 } // namespace syncer 291 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698