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

Unified Diff: chrome/browser/webdata/autocomplete_syncable_service.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/webdata/autocomplete_syncable_service.cc
diff --git a/chrome/browser/webdata/autocomplete_syncable_service.cc b/chrome/browser/webdata/autocomplete_syncable_service.cc
index b2b2ce795bc8c8b5c13de4ea38d8b9e42ec2441e..d36f7e37854c947d04bfb6622e9acc3368ea29ec 100644
--- a/chrome/browser/webdata/autocomplete_syncable_service.cc
+++ b/chrome/browser/webdata/autocomplete_syncable_service.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/api/sync_error.h"
#include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
+#include "chrome/browser/sync/protocol/sync.pb.h"
#include "chrome/browser/webdata/autofill_table.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/browser/webdata/web_database.h"
@@ -193,10 +194,10 @@ SyncError AutocompleteSyncableService::ProcessSyncChanges(
CreateOrUpdateEntry(i->sync_data(), db_entries.get(), &new_entries);
break;
case SyncChange::ACTION_DELETE: {
- DCHECK(i->sync_data().GetSpecifics().HasExtension(sync_pb::autofill))
+ DCHECK(i->sync_data().GetSpecifics().has_autofill())
<< "Autofill specifics data not present on delete!";
const sync_pb::AutofillSpecifics& autofill =
- i->sync_data().GetSpecifics().GetExtension(sync_pb::autofill);
+ i->sync_data().GetSpecifics().autofill();
if (autofill.has_value()) {
list_processing_error = AutofillEntryDelete(autofill);
} else {
@@ -265,7 +266,7 @@ void AutocompleteSyncableService::CreateOrUpdateEntry(
std::vector<AutofillEntry>* new_entries) {
const sync_pb::EntitySpecifics& specifics = data.GetSpecifics();
const sync_pb::AutofillSpecifics& autofill_specifics(
- specifics.GetExtension(sync_pb::autofill));
+ specifics.autofill());
if (!autofill_specifics.has_value()) {
DLOG(WARNING)
@@ -308,7 +309,7 @@ void AutocompleteSyncableService::CreateOrUpdateEntry(
void AutocompleteSyncableService::WriteAutofillEntry(
const AutofillEntry& entry, sync_pb::EntitySpecifics* autofill_specifics) {
sync_pb::AutofillSpecifics* autofill =
- autofill_specifics->MutableExtension(sync_pb::autofill);
+ autofill_specifics->mutable_autofill();
autofill->set_name(UTF16ToUTF8(entry.key().name()));
autofill->set_value(UTF16ToUTF8(entry.key().value()));
const std::vector<base::Time>& ts(entry.timestamps());
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | chrome/browser/webdata/autofill_profile_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698