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

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

Issue 2672493002: [Sync] Switch bots to run integ tests for autofill as USS. (Closed)
Patch Set: Updated for Gang's comment. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_sync_bridge.h" 5 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <unordered_set> 9 #include <unordered_set>
10 #include <utility> 10 #include <utility>
(...skipping 17 matching lines...) Expand all
28 using base::Time; 28 using base::Time;
29 using base::debug::DumpWithoutCrashing; 29 using base::debug::DumpWithoutCrashing;
30 using sync_pb::AutofillSpecifics; 30 using sync_pb::AutofillSpecifics;
31 using syncer::EntityChange; 31 using syncer::EntityChange;
32 using syncer::EntityChangeList; 32 using syncer::EntityChangeList;
33 using syncer::EntityData; 33 using syncer::EntityData;
34 using syncer::EntityDataMap; 34 using syncer::EntityDataMap;
35 using syncer::MetadataChangeList; 35 using syncer::MetadataChangeList;
36 using syncer::ModelError; 36 using syncer::ModelError;
37 using syncer::ModelTypeChangeProcessor; 37 using syncer::ModelTypeChangeProcessor;
38 using syncer::ModelTypeSyncBridge;
38 using syncer::MutableDataBatch; 39 using syncer::MutableDataBatch;
39 40
40 namespace autofill { 41 namespace autofill {
41 42
42 namespace { 43 namespace {
43 44
44 const char kAutocompleteEntryNamespaceTag[] = "autofill_entry|"; 45 const char kAutocompleteEntryNamespaceTag[] = "autofill_entry|";
45 const char kAutocompleteTagDelimiter[] = "|"; 46 const char kAutocompleteTagDelimiter[] = "|";
46 47
47 // Simplify checking for optional errors and returning only when present. 48 // Simplify checking for optional errors and returning only when present.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 web_data_service->GetDBUserData()->SetUserData( 285 web_data_service->GetDBUserData()->SetUserData(
285 UserDataKey(), 286 UserDataKey(),
286 new AutocompleteSyncBridge( 287 new AutocompleteSyncBridge(
287 web_data_backend, 288 web_data_backend,
288 base::BindRepeating( 289 base::BindRepeating(
289 &ModelTypeChangeProcessor::Create, 290 &ModelTypeChangeProcessor::Create,
290 base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing))))); 291 base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing)))));
291 } 292 }
292 293
293 // static 294 // static
294 AutocompleteSyncBridge* AutocompleteSyncBridge::FromWebDataService( 295 base::WeakPtr<ModelTypeSyncBridge> AutocompleteSyncBridge::FromWebDataService(
295 AutofillWebDataService* web_data_service) { 296 AutofillWebDataService* web_data_service) {
296 return static_cast<AutocompleteSyncBridge*>( 297 return static_cast<AutocompleteSyncBridge*>(
297 web_data_service->GetDBUserData()->GetUserData(UserDataKey())); 298 web_data_service->GetDBUserData()->GetUserData(UserDataKey()))
299 ->AsWeakPtr();
298 } 300 }
299 301
300 AutocompleteSyncBridge::AutocompleteSyncBridge( 302 AutocompleteSyncBridge::AutocompleteSyncBridge(
301 AutofillWebDataBackend* backend, 303 AutofillWebDataBackend* backend,
302 const ChangeProcessorFactory& change_processor_factory) 304 const ChangeProcessorFactory& change_processor_factory)
303 : ModelTypeSyncBridge(change_processor_factory, syncer::AUTOFILL), 305 : ModelTypeSyncBridge(change_processor_factory, syncer::AUTOFILL),
304 web_data_backend_(backend), 306 web_data_backend_(backend),
305 scoped_observer_(this) { 307 scoped_observer_(this) {
306 DCHECK(web_data_backend_); 308 DCHECK(web_data_backend_);
307 309
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 const AutofillChangeList& changes) { 474 const AutofillChangeList& changes) {
473 DCHECK(thread_checker_.CalledOnValidThread()); 475 DCHECK(thread_checker_.CalledOnValidThread());
474 ActOnLocalChanges(changes); 476 ActOnLocalChanges(changes);
475 } 477 }
476 478
477 AutofillTable* AutocompleteSyncBridge::GetAutofillTable() const { 479 AutofillTable* AutocompleteSyncBridge::GetAutofillTable() const {
478 return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase()); 480 return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase());
479 } 481 }
480 482
481 } // namespace autofill 483 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698