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

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

Issue 9460047: sync: remove use of protobuf extensions in protocol to reduce static init overhead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fred's review Created 8 years, 10 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/engine/syncer_util.cc
diff --git a/chrome/browser/sync/engine/syncer_util.cc b/chrome/browser/sync/engine/syncer_util.cc
index 2efe5d06da9cd2448bf52752fc45d33b0575e5a3..6a1af32d17e2060647d2dc884e0b592843bd4761 100644
--- a/chrome/browser/sync/engine/syncer_util.cc
+++ b/chrome/browser/sync/engine/syncer_util.cc
@@ -280,9 +280,8 @@ UpdateAttemptResponse SyncerUtil::AttemptToUpdateEntry(
// priority on preserving the server's passphrase change to preserving local
// non-encryption changes. Next time the non-encryption changes are made to
// the nigori node (e.g. on restart), they will commit without issue.
- if (specifics.HasExtension(sync_pb::nigori)) {
- const sync_pb::NigoriSpecifics& nigori =
- specifics.GetExtension(sync_pb::nigori);
+ if (specifics.has_nigori()) {
+ const sync_pb::NigoriSpecifics& nigori = specifics.nigori();
cryptographer->Update(nigori);
// Make sure any unsynced changes are properly encrypted as necessary.
@@ -320,11 +319,10 @@ UpdateAttemptResponse SyncerUtil::AttemptToUpdateEntry(
<< syncable::ModelTypeToString(entry->GetServerModelType())
<< " update, returning encryption_conflict.";
return CONFLICT_ENCRYPTION;
- } else if (specifics.HasExtension(sync_pb::password) &&
+ } else if (specifics.has_password() &&
entry->Get(UNIQUE_SERVER_TAG).empty()) {
// Passwords use their own legacy encryption scheme.
- const sync_pb::PasswordSpecifics& password =
- specifics.GetExtension(sync_pb::password);
+ const sync_pb::PasswordSpecifics& password = specifics.password();
if (!cryptographer->CanDecrypt(password.encrypted())) {
DVLOG(1) << "Received an undecryptable password update, returning "
<< "encryption_conflict.";
@@ -396,7 +394,7 @@ void UpdateBookmarkSpecifics(const std::string& singleton_tag,
if (singleton_tag == "google_chrome")
return;
sync_pb::EntitySpecifics pb;
- sync_pb::BookmarkSpecifics* bookmark = pb.MutableExtension(sync_pb::bookmark);
+ sync_pb::BookmarkSpecifics* bookmark = pb.mutable_bookmark();
if (!url.empty())
bookmark->set_url(url);
if (!favicon_bytes.empty())
« no previous file with comments | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/engine/verify_updates_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698