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

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

Issue 2803005: Reland: Client side changes to set and get nigori specifics with passing (Closed)
Patch Set: Created 10 years, 6 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 | « 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 74143320f6a972b567bddfd82bc057e2d4682957..76be27abae6698d9cf34790051a0d3358c99c8dd 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"
@@ -242,6 +243,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);
@@ -330,6 +336,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
This is Rietveld 408576698