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

Unified Diff: components/sync_driver/generic_change_processor.cc

Issue 1246063003: Sync: Don't set/use Parent ID for non-hierarchical sync data types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: components/sync_driver/generic_change_processor.cc
diff --git a/components/sync_driver/generic_change_processor.cc b/components/sync_driver/generic_change_processor.cc
index 114c6554ab9748bd850cbc4bc63b321f3fe6b3b8..ab390be2a6f8b8a03a24040fcff1126320bd1336 100644
--- a/components/sync_driver/generic_change_processor.cc
+++ b/components/sync_driver/generic_change_processor.cc
@@ -494,22 +494,10 @@ syncer::SyncError GenericChangeProcessor::HandleActionAdd(
syncer::AttachmentIdSet* new_attachments) {
// TODO(sync): Handle other types of creation (custom parents, folders,
// etc.).
- syncer::ReadNode root_node(&trans);
const syncer::SyncDataLocal sync_data_local(change.sync_data());
- if (root_node.InitTypeRoot(sync_data_local.GetDataType()) !=
- syncer::BaseNode::INIT_OK) {
- syncer::SyncError error(FROM_HERE,
- syncer::SyncError::DATATYPE_ERROR,
- "Failed to look up root node for type " + type_str,
- type_);
- error_handler()->OnSingleDataTypeUnrecoverableError(error);
- NOTREACHED();
- LOG(ERROR) << "Create: no root node.";
- return error;
- }
syncer::WriteNode::InitUniqueByCreationResult result =
- sync_node->InitUniqueByCreation(
- sync_data_local.GetDataType(), root_node, sync_data_local.GetTag());
+ sync_node->InitUniqueByCreation(sync_data_local.GetDataType(),
+ sync_data_local.GetTag());
if (result != syncer::WriteNode::INIT_SUCCESS) {
std::string error_prefix = "Failed to create " + type_str + " node: " +
change.location().ToString() + ", ";

Powered by Google App Engine
This is Rietveld 408576698