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

Side by Side Diff: components/autofill/core/browser/webdata/autocomplete_syncable_service.cc

Issue 2142123002: [Autofill] Run autofill-profile de-dupe after sync starts if sync is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better logging and fix mathp's comments Created 4 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
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 "components/autofill/core/browser/webdata/autocomplete_syncable_service .h" 5 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service .h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 merge_result.set_error( 151 merge_result.set_error(
152 sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes)); 152 sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes));
153 153
154 // This will schedule a deletion operation on the DB thread, which will 154 // This will schedule a deletion operation on the DB thread, which will
155 // trigger a notification to propagate the deletion to Sync. 155 // trigger a notification to propagate the deletion to Sync.
156 // NOTE: This must be called *after* the ProcessSyncChanges call above. 156 // NOTE: This must be called *after* the ProcessSyncChanges call above.
157 // Otherwise, an item that Sync is not yet aware of might expire, causing a 157 // Otherwise, an item that Sync is not yet aware of might expire, causing a
158 // Sync error when that item's deletion is propagated to Sync. 158 // Sync error when that item's deletion is propagated to Sync.
159 web_data_backend_->RemoveExpiredFormElements(); 159 web_data_backend_->RemoveExpiredFormElements();
160 160
161 web_data_backend_->NotifyThatSyncHasStarted(type);
162
161 return merge_result; 163 return merge_result;
162 } 164 }
163 165
164 void AutocompleteSyncableService::StopSyncing(syncer::ModelType type) { 166 void AutocompleteSyncableService::StopSyncing(syncer::ModelType type) {
165 DCHECK(CalledOnValidThread()); 167 DCHECK(CalledOnValidThread());
166 DCHECK_EQ(syncer::AUTOFILL, type); 168 DCHECK_EQ(syncer::AUTOFILL, type);
167 169
168 sync_processor_.reset(); 170 sync_processor_.reset();
169 error_handler_.reset(); 171 error_handler_.reset();
170 } 172 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 419 }
418 420
419 // static 421 // static
420 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, 422 std::string AutocompleteSyncableService::KeyToTag(const std::string& name,
421 const std::string& value) { 423 const std::string& value) {
422 std::string prefix(kAutofillEntryNamespaceTag); 424 std::string prefix(kAutofillEntryNamespaceTag);
423 return prefix + net::EscapePath(name) + "|" + net::EscapePath(value); 425 return prefix + net::EscapePath(name) + "|" + net::EscapePath(value);
424 } 426 }
425 427
426 } // namespace autofill 428 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698