Chromium Code Reviews

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 2815009: Client side changes to set and get nigori specifics. (Closed)
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/syncable/model_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 7018d74039942125429297c5a8c4ded96f5b24bd..1b1f7c8df36135e2f89b02bfcd20a199917cbb25 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -35,6 +35,7 @@
#include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
#include "chrome/browser/sync/protocol/bookmark_specifics.pb.h"
#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
+#include "chrome/browser/sync/protocol/nigori_specifics.pb.h"
#include "chrome/browser/sync/protocol/password_specifics.pb.h"
#include "chrome/browser/sync/protocol/preference_specifics.pb.h"
#include "chrome/browser/sync/protocol/service_constants.h"
@@ -245,6 +246,11 @@ const sync_pb::BookmarkSpecifics& BaseNode::GetBookmarkSpecifics() const {
return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::bookmark);
}
+const sync_pb::NigoriSpecifics& BaseNode::GetNigoriSpecifics() const {
+ DCHECK(GetModelType() == syncable::NIGORI);
+ return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::nigori);
+}
+
bool BaseNode::GetPasswordSpecifics(sync_pb::PasswordSpecificsData* data)
const {
DCHECK(GetModelType() == syncable::PASSWORDS);
@@ -333,6 +339,19 @@ void WriteNode::PutBookmarkSpecificsAndMarkForSyncing(
PutSpecificsAndMarkForSyncing(entity_specifics);
}
+void WriteNode::SetNigoriSpecifics(
+ const sync_pb::NigoriSpecifics& new_value) {
+ DCHECK(GetModelType() == syncable::NIGORI);
+ PutNigoriSpecificsAndMarkForSyncing(new_value);
+}
+
+void WriteNode::PutNigoriSpecificsAndMarkForSyncing(
+ const sync_pb::NigoriSpecifics& new_value) {
+ sync_pb::EntitySpecifics entity_specifics;
+ entity_specifics.MutableExtension(sync_pb::nigori)->CopyFrom(new_value);
+ PutSpecificsAndMarkForSyncing(entity_specifics);
+}
+
void WriteNode::SetPasswordSpecifics(
const sync_pb::PasswordSpecificsData& data) {
DCHECK(GetModelType() == syncable::PASSWORDS);
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/syncable/model_type.h » ('j') | no next file with comments »

Powered by Google App Engine