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

Unified Diff: chrome/browser/sync/glue/generic_change_processor.cc

Issue 217063005: Separate SyncData methods into three groups, local, remote, and common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@syncapi
Patch Set: Reorganize Local and Remote based on offline feedback. Created 6 years, 9 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: chrome/browser/sync/glue/generic_change_processor.cc
diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc
index 36811d4d966d232ff9634cd3e2d350b67ffd2710..3ab885d733316602f24cc7ebcfa975ab7fc71af0 100644
--- a/chrome/browser/sync/glue/generic_change_processor.cc
+++ b/chrome/browser/sync/glue/generic_change_processor.cc
@@ -291,7 +291,7 @@ syncer::SyncError AttemptDelete(
DataTypeErrorHandler* error_handler) {
DCHECK_EQ(change.change_type(), syncer::SyncChange::ACTION_DELETE);
if (change.sync_data().IsLocal()) {
- const std::string& tag = change.sync_data().GetTag();
+ const std::string& tag = change.sync_data().AsLocal().GetTag();
if (tag.empty()) {
syncer::SyncError error(
FROM_HERE,
@@ -316,7 +316,7 @@ syncer::SyncError AttemptDelete(
}
} else {
syncer::BaseNode::InitByLookupResult result =
- node->InitByIdLookup(change.sync_data().GetRemoteId());
+ node->InitByIdLookup(change.sync_data().AsRemote().GetId());
if (result != syncer::BaseNode::INIT_OK) {
return LogLookupFailure(
result, FROM_HERE,
@@ -417,7 +417,7 @@ syncer::SyncError GenericChangeProcessor::HandleActionAdd(
syncer::WriteNode::InitUniqueByCreationResult result =
sync_node->InitUniqueByCreation(change.sync_data().GetDataType(),
root_node,
- change.sync_data().GetTag());
+ change.sync_data().AsLocal().GetTag());
if (result != syncer::WriteNode::INIT_SUCCESS) {
std::string error_prefix = "Failed to create " + type_str + " node: " +
change.location().ToString() + ", ";
@@ -486,7 +486,7 @@ syncer::SyncError GenericChangeProcessor::HandleActionUpdate(
// TODO(zea): consider having this logic for all possible changes?
syncer::BaseNode::InitByLookupResult result =
sync_node->InitByClientTagLookup(change.sync_data().GetDataType(),
- change.sync_data().GetTag());
+ change.sync_data().AsLocal().GetTag());
if (result != syncer::BaseNode::INIT_OK) {
std::string error_prefix = "Failed to load " + type_str + " node. " +
change.location().ToString() + ", ";

Powered by Google App Engine
This is Rietveld 408576698