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

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

Issue 2847763003: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: Created 3 years, 7 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 }; 278 };
279 279
280 } // namespace 280 } // namespace
281 281
282 // static 282 // static
283 void AutocompleteSyncBridge::CreateForWebDataServiceAndBackend( 283 void AutocompleteSyncBridge::CreateForWebDataServiceAndBackend(
284 AutofillWebDataService* web_data_service, 284 AutofillWebDataService* web_data_service,
285 AutofillWebDataBackend* web_data_backend) { 285 AutofillWebDataBackend* web_data_backend) {
286 web_data_service->GetDBUserData()->SetUserData( 286 web_data_service->GetDBUserData()->SetUserData(
287 UserDataKey(), 287 UserDataKey(),
288 new AutocompleteSyncBridge( 288 base::MakeUnique<AutocompleteSyncBridge>(
289 web_data_backend, 289 web_data_backend,
290 base::BindRepeating( 290 base::BindRepeating(
291 &ModelTypeChangeProcessor::Create, 291 &ModelTypeChangeProcessor::Create,
292 base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing))))); 292 base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing)))));
293 } 293 }
294 294
295 // static 295 // static
296 base::WeakPtr<ModelTypeSyncBridge> AutocompleteSyncBridge::FromWebDataService( 296 base::WeakPtr<ModelTypeSyncBridge> AutocompleteSyncBridge::FromWebDataService(
297 AutofillWebDataService* web_data_service) { 297 AutofillWebDataService* web_data_service) {
298 return static_cast<AutocompleteSyncBridge*>( 298 return static_cast<AutocompleteSyncBridge*>(
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 const AutofillChangeList& changes) { 482 const AutofillChangeList& changes) {
483 DCHECK(thread_checker_.CalledOnValidThread()); 483 DCHECK(thread_checker_.CalledOnValidThread());
484 ActOnLocalChanges(changes); 484 ActOnLocalChanges(changes);
485 } 485 }
486 486
487 AutofillTable* AutocompleteSyncBridge::GetAutofillTable() const { 487 AutofillTable* AutocompleteSyncBridge::GetAutofillTable() const {
488 return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase()); 488 return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase());
489 } 489 }
490 490
491 } // namespace autofill 491 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698