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

Side by Side Diff: chrome/browser/webdata/autocomplete_syncable_service.cc

Issue 10698014: [Sync] Rename csync namespace to syncer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/webdata/autocomplete_syncable_service.h" 5 #include "chrome/browser/webdata/autocomplete_syncable_service.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 AutocompleteSyncableService::~AutocompleteSyncableService() { 101 AutocompleteSyncableService::~AutocompleteSyncableService() {
102 DCHECK(CalledOnValidThread()); 102 DCHECK(CalledOnValidThread());
103 } 103 }
104 104
105 AutocompleteSyncableService::AutocompleteSyncableService() 105 AutocompleteSyncableService::AutocompleteSyncableService()
106 : web_data_service_(NULL) { 106 : web_data_service_(NULL) {
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
108 } 108 }
109 109
110 csync::SyncError AutocompleteSyncableService::MergeDataAndStartSyncing( 110 syncer::SyncError AutocompleteSyncableService::MergeDataAndStartSyncing(
111 syncable::ModelType type, 111 syncable::ModelType type,
112 const csync::SyncDataList& initial_sync_data, 112 const syncer::SyncDataList& initial_sync_data,
113 scoped_ptr<csync::SyncChangeProcessor> sync_processor, 113 scoped_ptr<syncer::SyncChangeProcessor> sync_processor,
114 scoped_ptr<csync::SyncErrorFactory> error_handler) { 114 scoped_ptr<syncer::SyncErrorFactory> error_handler) {
115 DCHECK(CalledOnValidThread()); 115 DCHECK(CalledOnValidThread());
116 DCHECK(!sync_processor_.get()); 116 DCHECK(!sync_processor_.get());
117 DCHECK(sync_processor.get()); 117 DCHECK(sync_processor.get());
118 DCHECK(error_handler.get()); 118 DCHECK(error_handler.get());
119 VLOG(1) << "Associating Autocomplete: MergeDataAndStartSyncing"; 119 VLOG(1) << "Associating Autocomplete: MergeDataAndStartSyncing";
120 120
121 error_handler_ = error_handler.Pass(); 121 error_handler_ = error_handler.Pass();
122 std::vector<AutofillEntry> entries; 122 std::vector<AutofillEntry> entries;
123 if (!LoadAutofillData(&entries)) { 123 if (!LoadAutofillData(&entries)) {
124 return error_handler_->CreateAndUploadError( 124 return error_handler_->CreateAndUploadError(
125 FROM_HERE, 125 FROM_HERE,
126 "Could not get the autocomplete data from WebDatabase."); 126 "Could not get the autocomplete data from WebDatabase.");
127 } 127 }
128 128
129 AutocompleteEntryMap new_db_entries; 129 AutocompleteEntryMap new_db_entries;
130 for (std::vector<AutofillEntry>::iterator it = entries.begin(); 130 for (std::vector<AutofillEntry>::iterator it = entries.begin();
131 it != entries.end(); ++it) { 131 it != entries.end(); ++it) {
132 new_db_entries[it->key()] = 132 new_db_entries[it->key()] =
133 std::make_pair(csync::SyncChange::ACTION_ADD, it); 133 std::make_pair(syncer::SyncChange::ACTION_ADD, it);
134 } 134 }
135 135
136 sync_processor_ = sync_processor.Pass(); 136 sync_processor_ = sync_processor.Pass();
137 137
138 std::vector<AutofillEntry> new_synced_entries; 138 std::vector<AutofillEntry> new_synced_entries;
139 // Go through and check for all the entries that sync already knows about. 139 // Go through and check for all the entries that sync already knows about.
140 // CreateOrUpdateEntry() will remove entries that are same with the synced 140 // CreateOrUpdateEntry() will remove entries that are same with the synced
141 // ones from |new_db_entries|. 141 // ones from |new_db_entries|.
142 for (csync::SyncDataList::const_iterator sync_iter = 142 for (syncer::SyncDataList::const_iterator sync_iter =
143 initial_sync_data.begin(); 143 initial_sync_data.begin();
144 sync_iter != initial_sync_data.end(); ++sync_iter) { 144 sync_iter != initial_sync_data.end(); ++sync_iter) {
145 CreateOrUpdateEntry(*sync_iter, &new_db_entries, &new_synced_entries); 145 CreateOrUpdateEntry(*sync_iter, &new_db_entries, &new_synced_entries);
146 } 146 }
147 147
148 if (!SaveChangesToWebData(new_synced_entries)) { 148 if (!SaveChangesToWebData(new_synced_entries)) {
149 return error_handler_->CreateAndUploadError( 149 return error_handler_->CreateAndUploadError(
150 FROM_HERE, 150 FROM_HERE,
151 "Failed to update webdata."); 151 "Failed to update webdata.");
152 } 152 }
153 153
154 WebDataService::NotifyOfMultipleAutofillChanges(web_data_service_); 154 WebDataService::NotifyOfMultipleAutofillChanges(web_data_service_);
155 155
156 csync::SyncChangeList new_changes; 156 syncer::SyncChangeList new_changes;
157 for (AutocompleteEntryMap::iterator i = new_db_entries.begin(); 157 for (AutocompleteEntryMap::iterator i = new_db_entries.begin();
158 i != new_db_entries.end(); ++i) { 158 i != new_db_entries.end(); ++i) {
159 new_changes.push_back( 159 new_changes.push_back(
160 csync::SyncChange( 160 syncer::SyncChange(
161 i->second.first, CreateSyncData(*(i->second.second)))); 161 i->second.first, CreateSyncData(*(i->second.second))));
162 } 162 }
163 163
164 if (ShouldCullSyncedData()) { 164 if (ShouldCullSyncedData()) {
165 // This will schedule a deletion operation on the DB thread, which will 165 // This will schedule a deletion operation on the DB thread, which will
166 // trigger a notification to propagate the deletion to Sync. 166 // trigger a notification to propagate the deletion to Sync.
167 web_data_service_->RemoveExpiredFormElements(); 167 web_data_service_->RemoveExpiredFormElements();
168 } 168 }
169 169
170 csync::SyncError error = 170 syncer::SyncError error =
171 sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes); 171 sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes);
172 172
173 return error; 173 return error;
174 } 174 }
175 175
176 void AutocompleteSyncableService::StopSyncing(syncable::ModelType type) { 176 void AutocompleteSyncableService::StopSyncing(syncable::ModelType type) {
177 DCHECK(CalledOnValidThread()); 177 DCHECK(CalledOnValidThread());
178 DCHECK_EQ(syncable::AUTOFILL, type); 178 DCHECK_EQ(syncable::AUTOFILL, type);
179 179
180 sync_processor_.reset(NULL); 180 sync_processor_.reset(NULL);
181 error_handler_.reset(); 181 error_handler_.reset();
182 } 182 }
183 183
184 csync::SyncDataList AutocompleteSyncableService::GetAllSyncData( 184 syncer::SyncDataList AutocompleteSyncableService::GetAllSyncData(
185 syncable::ModelType type) const { 185 syncable::ModelType type) const {
186 DCHECK(CalledOnValidThread()); 186 DCHECK(CalledOnValidThread());
187 DCHECK(sync_processor_.get()); 187 DCHECK(sync_processor_.get());
188 DCHECK_EQ(type, syncable::AUTOFILL); 188 DCHECK_EQ(type, syncable::AUTOFILL);
189 189
190 csync::SyncDataList current_data; 190 syncer::SyncDataList current_data;
191 191
192 std::vector<AutofillEntry> entries; 192 std::vector<AutofillEntry> entries;
193 if (!LoadAutofillData(&entries)) 193 if (!LoadAutofillData(&entries))
194 return current_data; 194 return current_data;
195 195
196 for (std::vector<AutofillEntry>::iterator it = entries.begin(); 196 for (std::vector<AutofillEntry>::iterator it = entries.begin();
197 it != entries.end(); ++it) { 197 it != entries.end(); ++it) {
198 current_data.push_back(CreateSyncData(*it)); 198 current_data.push_back(CreateSyncData(*it));
199 } 199 }
200 200
201 return current_data; 201 return current_data;
202 } 202 }
203 203
204 csync::SyncError AutocompleteSyncableService::ProcessSyncChanges( 204 syncer::SyncError AutocompleteSyncableService::ProcessSyncChanges(
205 const tracked_objects::Location& from_here, 205 const tracked_objects::Location& from_here,
206 const csync::SyncChangeList& change_list) { 206 const syncer::SyncChangeList& change_list) {
207 DCHECK(CalledOnValidThread()); 207 DCHECK(CalledOnValidThread());
208 DCHECK(sync_processor_.get()); 208 DCHECK(sync_processor_.get());
209 209
210 if (!sync_processor_.get()) { 210 if (!sync_processor_.get()) {
211 csync::SyncError error(FROM_HERE, "Models not yet associated.", 211 syncer::SyncError error(FROM_HERE, "Models not yet associated.",
212 syncable::AUTOFILL); 212 syncable::AUTOFILL);
213 return error; 213 return error;
214 } 214 }
215 215
216 // Data is loaded only if we get new ADD/UPDATE change. 216 // Data is loaded only if we get new ADD/UPDATE change.
217 std::vector<AutofillEntry> entries; 217 std::vector<AutofillEntry> entries;
218 scoped_ptr<AutocompleteEntryMap> db_entries; 218 scoped_ptr<AutocompleteEntryMap> db_entries;
219 std::vector<AutofillEntry> new_entries; 219 std::vector<AutofillEntry> new_entries;
220 220
221 csync::SyncError list_processing_error; 221 syncer::SyncError list_processing_error;
222 222
223 for (csync::SyncChangeList::const_iterator i = change_list.begin(); 223 for (syncer::SyncChangeList::const_iterator i = change_list.begin();
224 i != change_list.end() && !list_processing_error.IsSet(); ++i) { 224 i != change_list.end() && !list_processing_error.IsSet(); ++i) {
225 DCHECK(i->IsValid()); 225 DCHECK(i->IsValid());
226 switch (i->change_type()) { 226 switch (i->change_type()) {
227 case csync::SyncChange::ACTION_ADD: 227 case syncer::SyncChange::ACTION_ADD:
228 case csync::SyncChange::ACTION_UPDATE: 228 case syncer::SyncChange::ACTION_UPDATE:
229 if (!db_entries.get()) { 229 if (!db_entries.get()) {
230 if (!LoadAutofillData(&entries)) { 230 if (!LoadAutofillData(&entries)) {
231 return error_handler_->CreateAndUploadError( 231 return error_handler_->CreateAndUploadError(
232 FROM_HERE, 232 FROM_HERE,
233 "Could not get the autocomplete data from WebDatabase."); 233 "Could not get the autocomplete data from WebDatabase.");
234 } 234 }
235 db_entries.reset(new AutocompleteEntryMap); 235 db_entries.reset(new AutocompleteEntryMap);
236 for (std::vector<AutofillEntry>::iterator it = entries.begin(); 236 for (std::vector<AutofillEntry>::iterator it = entries.begin();
237 it != entries.end(); ++it) { 237 it != entries.end(); ++it) {
238 (*db_entries)[it->key()] = 238 (*db_entries)[it->key()] =
239 std::make_pair(csync::SyncChange::ACTION_ADD, it); 239 std::make_pair(syncer::SyncChange::ACTION_ADD, it);
240 } 240 }
241 } 241 }
242 CreateOrUpdateEntry(i->sync_data(), db_entries.get(), &new_entries); 242 CreateOrUpdateEntry(i->sync_data(), db_entries.get(), &new_entries);
243 break; 243 break;
244 case csync::SyncChange::ACTION_DELETE: { 244 case syncer::SyncChange::ACTION_DELETE: {
245 DCHECK(i->sync_data().GetSpecifics().has_autofill()) 245 DCHECK(i->sync_data().GetSpecifics().has_autofill())
246 << "Autofill specifics data not present on delete!"; 246 << "Autofill specifics data not present on delete!";
247 const sync_pb::AutofillSpecifics& autofill = 247 const sync_pb::AutofillSpecifics& autofill =
248 i->sync_data().GetSpecifics().autofill(); 248 i->sync_data().GetSpecifics().autofill();
249 if (autofill.has_value()) { 249 if (autofill.has_value()) {
250 list_processing_error = AutofillEntryDelete(autofill); 250 list_processing_error = AutofillEntryDelete(autofill);
251 } else { 251 } else {
252 DLOG(WARNING) 252 DLOG(WARNING)
253 << "Delete for old-style autofill profile being dropped!"; 253 << "Delete for old-style autofill profile being dropped!";
254 } 254 }
255 } break; 255 } break;
256 default: 256 default:
257 NOTREACHED() << "Unexpected sync change state."; 257 NOTREACHED() << "Unexpected sync change state.";
258 return error_handler_->CreateAndUploadError( 258 return error_handler_->CreateAndUploadError(
259 FROM_HERE, 259 FROM_HERE,
260 "ProcessSyncChanges failed on ChangeType " + 260 "ProcessSyncChanges failed on ChangeType " +
261 csync::SyncChange::ChangeTypeToString(i->change_type())); 261 syncer::SyncChange::ChangeTypeToString(i->change_type()));
262 } 262 }
263 } 263 }
264 264
265 if (!SaveChangesToWebData(new_entries)) { 265 if (!SaveChangesToWebData(new_entries)) {
266 return error_handler_->CreateAndUploadError( 266 return error_handler_->CreateAndUploadError(
267 FROM_HERE, 267 FROM_HERE,
268 "Failed to update webdata."); 268 "Failed to update webdata.");
269 } 269 }
270 270
271 WebDataService::NotifyOfMultipleAutofillChanges(web_data_service_); 271 WebDataService::NotifyOfMultipleAutofillChanges(web_data_service_);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if (!new_entries.empty() && 312 if (!new_entries.empty() &&
313 !web_data_service_->GetDatabase()-> 313 !web_data_service_->GetDatabase()->
314 GetAutofillTable()->UpdateAutofillEntries(new_entries)) { 314 GetAutofillTable()->UpdateAutofillEntries(new_entries)) {
315 return false; 315 return false;
316 } 316 }
317 return true; 317 return true;
318 } 318 }
319 319
320 // Creates or updates an autocomplete entry based on |data|. 320 // Creates or updates an autocomplete entry based on |data|.
321 void AutocompleteSyncableService::CreateOrUpdateEntry( 321 void AutocompleteSyncableService::CreateOrUpdateEntry(
322 const csync::SyncData& data, 322 const syncer::SyncData& data,
323 AutocompleteEntryMap* loaded_data, 323 AutocompleteEntryMap* loaded_data,
324 std::vector<AutofillEntry>* new_entries) { 324 std::vector<AutofillEntry>* new_entries) {
325 const sync_pb::EntitySpecifics& specifics = data.GetSpecifics(); 325 const sync_pb::EntitySpecifics& specifics = data.GetSpecifics();
326 const sync_pb::AutofillSpecifics& autofill_specifics( 326 const sync_pb::AutofillSpecifics& autofill_specifics(
327 specifics.autofill()); 327 specifics.autofill());
328 328
329 if (!autofill_specifics.has_value()) { 329 if (!autofill_specifics.has_value()) {
330 DLOG(WARNING) 330 DLOG(WARNING)
331 << "Add/Update for old-style autofill profile being dropped!"; 331 << "Add/Update for old-style autofill profile being dropped!";
332 return; 332 return;
(...skipping 20 matching lines...) Expand all
353 } else { 353 } else {
354 // Entry already present - merge if necessary. 354 // Entry already present - merge if necessary.
355 std::vector<base::Time> timestamps; 355 std::vector<base::Time> timestamps;
356 bool different = MergeTimestamps( 356 bool different = MergeTimestamps(
357 autofill_specifics, it->second.second->timestamps(), &timestamps); 357 autofill_specifics, it->second.second->timestamps(), &timestamps);
358 if (different) { 358 if (different) {
359 AutofillEntry new_entry(it->second.second->key(), timestamps); 359 AutofillEntry new_entry(it->second.second->key(), timestamps);
360 new_entries->push_back(new_entry); 360 new_entries->push_back(new_entry);
361 // Update the sync db if the list of timestamps have changed. 361 // Update the sync db if the list of timestamps have changed.
362 *(it->second.second) = new_entry; 362 *(it->second.second) = new_entry;
363 it->second.first = csync::SyncChange::ACTION_UPDATE; 363 it->second.first = syncer::SyncChange::ACTION_UPDATE;
364 } else { 364 } else {
365 loaded_data->erase(it); 365 loaded_data->erase(it);
366 } 366 }
367 } 367 }
368 } 368 }
369 369
370 // static 370 // static
371 void AutocompleteSyncableService::WriteAutofillEntry( 371 void AutocompleteSyncableService::WriteAutofillEntry(
372 const AutofillEntry& entry, sync_pb::EntitySpecifics* autofill_specifics) { 372 const AutofillEntry& entry, sync_pb::EntitySpecifics* autofill_specifics) {
373 sync_pb::AutofillSpecifics* autofill = 373 sync_pb::AutofillSpecifics* autofill =
374 autofill_specifics->mutable_autofill(); 374 autofill_specifics->mutable_autofill();
375 autofill->set_name(UTF16ToUTF8(entry.key().name())); 375 autofill->set_name(UTF16ToUTF8(entry.key().name()));
376 autofill->set_value(UTF16ToUTF8(entry.key().value())); 376 autofill->set_value(UTF16ToUTF8(entry.key().value()));
377 const std::vector<base::Time>& ts(entry.timestamps()); 377 const std::vector<base::Time>& ts(entry.timestamps());
378 for (std::vector<base::Time>::const_iterator timestamp = ts.begin(); 378 for (std::vector<base::Time>::const_iterator timestamp = ts.begin();
379 timestamp != ts.end(); ++timestamp) { 379 timestamp != ts.end(); ++timestamp) {
380 autofill->add_usage_timestamp(timestamp->ToInternalValue()); 380 autofill->add_usage_timestamp(timestamp->ToInternalValue());
381 } 381 }
382 } 382 }
383 383
384 csync::SyncError AutocompleteSyncableService::AutofillEntryDelete( 384 syncer::SyncError AutocompleteSyncableService::AutofillEntryDelete(
385 const sync_pb::AutofillSpecifics& autofill) { 385 const sync_pb::AutofillSpecifics& autofill) {
386 if (!web_data_service_->GetDatabase()->GetAutofillTable()->RemoveFormElement( 386 if (!web_data_service_->GetDatabase()->GetAutofillTable()->RemoveFormElement(
387 UTF8ToUTF16(autofill.name()), UTF8ToUTF16(autofill.value()))) { 387 UTF8ToUTF16(autofill.name()), UTF8ToUTF16(autofill.value()))) {
388 return error_handler_->CreateAndUploadError( 388 return error_handler_->CreateAndUploadError(
389 FROM_HERE, 389 FROM_HERE,
390 "Could not remove autocomplete entry from WebDatabase."); 390 "Could not remove autocomplete entry from WebDatabase.");
391 } 391 }
392 return csync::SyncError(); 392 return syncer::SyncError();
393 } 393 }
394 394
395 void AutocompleteSyncableService::ActOnChanges( 395 void AutocompleteSyncableService::ActOnChanges(
396 const AutofillChangeList& changes) { 396 const AutofillChangeList& changes) {
397 DCHECK(sync_processor_.get()); 397 DCHECK(sync_processor_.get());
398 csync::SyncChangeList new_changes; 398 syncer::SyncChangeList new_changes;
399 for (AutofillChangeList::const_iterator change = changes.begin(); 399 for (AutofillChangeList::const_iterator change = changes.begin();
400 change != changes.end(); ++change) { 400 change != changes.end(); ++change) {
401 switch (change->type()) { 401 switch (change->type()) {
402 case AutofillChange::ADD: 402 case AutofillChange::ADD:
403 case AutofillChange::UPDATE: { 403 case AutofillChange::UPDATE: {
404 std::vector<base::Time> timestamps; 404 std::vector<base::Time> timestamps;
405 if (!web_data_service_->GetDatabase()-> 405 if (!web_data_service_->GetDatabase()->
406 GetAutofillTable()->GetAutofillTimestamps( 406 GetAutofillTable()->GetAutofillTimestamps(
407 change->key().name(), 407 change->key().name(),
408 change->key().value(), 408 change->key().value(),
409 &timestamps)) { 409 &timestamps)) {
410 NOTREACHED(); 410 NOTREACHED();
411 return; 411 return;
412 } 412 }
413 AutofillEntry entry(change->key(), timestamps); 413 AutofillEntry entry(change->key(), timestamps);
414 csync::SyncChange::SyncChangeType change_type = 414 syncer::SyncChange::SyncChangeType change_type =
415 (change->type() == AutofillChange::ADD) ? 415 (change->type() == AutofillChange::ADD) ?
416 csync::SyncChange::ACTION_ADD : csync::SyncChange::ACTION_UPDATE; 416 syncer::SyncChange::ACTION_ADD :
417 new_changes.push_back(csync::SyncChange(change_type, 417 syncer::SyncChange::ACTION_UPDATE;
418 new_changes.push_back(syncer::SyncChange(change_type,
418 CreateSyncData(entry))); 419 CreateSyncData(entry)));
419 break; 420 break;
420 } 421 }
421 case AutofillChange::REMOVE: { 422 case AutofillChange::REMOVE: {
422 std::vector<base::Time> timestamps; 423 std::vector<base::Time> timestamps;
423 AutofillEntry entry(change->key(), timestamps); 424 AutofillEntry entry(change->key(), timestamps);
424 new_changes.push_back( 425 new_changes.push_back(
425 csync::SyncChange(csync::SyncChange::ACTION_DELETE, 426 syncer::SyncChange(syncer::SyncChange::ACTION_DELETE,
426 CreateSyncData(entry))); 427 CreateSyncData(entry)));
427 break; 428 break;
428 } 429 }
429 default: 430 default:
430 NOTREACHED(); 431 NOTREACHED();
431 break; 432 break;
432 } 433 }
433 } 434 }
434 csync::SyncError error = 435 syncer::SyncError error =
435 sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes); 436 sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes);
436 if (error.IsSet()) { 437 if (error.IsSet()) {
437 DLOG(WARNING) << "[AUTOCOMPLETE SYNC]" 438 DLOG(WARNING) << "[AUTOCOMPLETE SYNC]"
438 << " Failed processing change:" 439 << " Failed processing change:"
439 << " Error:" << error.message(); 440 << " Error:" << error.message();
440 } 441 }
441 } 442 }
442 443
443 csync::SyncData AutocompleteSyncableService::CreateSyncData( 444 syncer::SyncData AutocompleteSyncableService::CreateSyncData(
444 const AutofillEntry& entry) const { 445 const AutofillEntry& entry) const {
445 sync_pb::EntitySpecifics autofill_specifics; 446 sync_pb::EntitySpecifics autofill_specifics;
446 WriteAutofillEntry(entry, &autofill_specifics); 447 WriteAutofillEntry(entry, &autofill_specifics);
447 std::string tag(KeyToTag(UTF16ToUTF8(entry.key().name()), 448 std::string tag(KeyToTag(UTF16ToUTF8(entry.key().name()),
448 UTF16ToUTF8(entry.key().value()))); 449 UTF16ToUTF8(entry.key().value())));
449 return csync::SyncData::CreateLocalData(tag, tag, autofill_specifics); 450 return syncer::SyncData::CreateLocalData(tag, tag, autofill_specifics);
450 } 451 }
451 452
452 // static 453 // static
453 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, 454 std::string AutocompleteSyncableService::KeyToTag(const std::string& name,
454 const std::string& value) { 455 const std::string& value) {
455 std::string ns(kAutofillEntryNamespaceTag); 456 std::string ns(kAutofillEntryNamespaceTag);
456 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); 457 return ns + net::EscapePath(name) + "|" + net::EscapePath(value);
457 } 458 }
OLDNEW
« no previous file with comments | « chrome/browser/webdata/autocomplete_syncable_service.h ('k') | chrome/browser/webdata/autofill_profile_syncable_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698