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

Unified Diff: sync/syncable/entry_kernel.cc

Issue 1226213002: Sync: Support nodes with implicit permanent folders: Node Browser and out-of-order loading from DB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/write_node.cc ('k') | sync/syncable/entry_kernel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/entry_kernel.cc
diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc
index 52481f2f9d7ca3e3b81befb73b19e2fd3bc66e85..d73acafd850f76d58590ed2a70cb17fe976b0fb9 100644
--- a/sync/syncable/entry_kernel.cc
+++ b/sync/syncable/entry_kernel.cc
@@ -52,16 +52,16 @@ ModelType EntryKernel::GetServerModelType() const {
bool EntryKernel::ShouldMaintainPosition() const {
// We maintain positions for all bookmarks, except those that are
// server-created top-level folders.
- return (GetModelTypeFromSpecifics(ref(SPECIFICS)) == syncer::BOOKMARKS)
- && !(!ref(UNIQUE_SERVER_TAG).empty() && ref(IS_DIR));
+ return TypeSupportsOrdering(GetModelTypeFromSpecifics(ref(SPECIFICS))) &&
+ !(!ref(UNIQUE_SERVER_TAG).empty() && ref(IS_DIR));
}
bool EntryKernel::ShouldMaintainHierarchy() const {
// We maintain hierarchy for bookmarks and top-level folders,
// but no other types. Note that the Nigori node consists of a single
// top-level folder, so it's included in this set.
- return (GetModelTypeFromSpecifics(ref(SPECIFICS)) == syncer::BOOKMARKS)
- || (!ref(UNIQUE_SERVER_TAG).empty());
+ return TypeSupportsHierarchy(GetModelTypeFromSpecifics(ref(SPECIFICS))) ||
+ (!ref(UNIQUE_SERVER_TAG).empty());
}
namespace {
@@ -148,7 +148,10 @@ base::DictionaryValue* EntryKernel::ToValue(
Cryptographer* cryptographer) const {
base::DictionaryValue* kernel_info = new base::DictionaryValue();
kernel_info->SetBoolean("isDirty", is_dirty());
- kernel_info->Set("serverModelType", ModelTypeToValue(GetServerModelType()));
+ ModelType dataType = GetServerModelType();
+ if (!IsRealDataType(dataType))
+ dataType = GetModelType();
+ kernel_info->Set("modelType", ModelTypeToValue(dataType));
// Int64 fields.
SetFieldValues(*this, kernel_info,
« no previous file with comments | « sync/internal_api/write_node.cc ('k') | sync/syncable/entry_kernel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698