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

Unified Diff: sync/api/sync_change.cc

Issue 220043002: [Sync] Add sync api support for context changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review 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: sync/api/sync_change.cc
diff --git a/sync/api/sync_change.cc b/sync/api/sync_change.cc
index 8dedd9cb1768fbb0b3f99aebe8ae38e0cad773f7..ca33fbe7ac367ede9211726f6323dfa42539db3e 100644
--- a/sync/api/sync_change.cc
+++ b/sync/api/sync_change.cc
@@ -27,6 +27,12 @@ bool SyncChange::IsValid() const {
if (change_type_ == ACTION_INVALID || !sync_data_.IsValid())
return false;
+ // Context changes must not have valid specifics.
+ if (change_type_ == CONTEXT_UPDATE &&
+ GetModelTypeFromSpecifics(sync_data_.GetSpecifics()) != UNSPECIFIED) {
+ return false;
+ }
+
// Data from the syncer must always have valid specifics.
if (!sync_data_.IsLocal())
return IsRealDataType(sync_data_.GetDataType());

Powered by Google App Engine
This is Rietveld 408576698