Commit 3ed8a8e7 authored by avi's avatar avi Committed by Commit bot

Switch SupportsUserData uses to use unique_ptr.

The interface taking a raw pointer is deprecated and being removed.

BUG=690937

Review-Url: https://codereview.chromium.org/2847763003
Cr-Commit-Position: refs/heads/master@{#468004}
parent 14d9a1a8
...@@ -55,7 +55,7 @@ void ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( ...@@ -55,7 +55,7 @@ void ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
} }
contents->SetUserData(kContentAutofillDriverFactoryWebContentsUserDataKey, contents->SetUserData(kContentAutofillDriverFactoryWebContentsUserDataKey,
new_factory.release()); std::move(new_factory));
} }
// static // static
......
...@@ -285,7 +285,7 @@ void AutocompleteSyncBridge::CreateForWebDataServiceAndBackend( ...@@ -285,7 +285,7 @@ void AutocompleteSyncBridge::CreateForWebDataServiceAndBackend(
AutofillWebDataBackend* web_data_backend) { AutofillWebDataBackend* web_data_backend) {
web_data_service->GetDBUserData()->SetUserData( web_data_service->GetDBUserData()->SetUserData(
UserDataKey(), UserDataKey(),
new AutocompleteSyncBridge( base::MakeUnique<AutocompleteSyncBridge>(
web_data_backend, web_data_backend,
base::BindRepeating( base::BindRepeating(
&ModelTypeChangeProcessor::Create, &ModelTypeChangeProcessor::Create,
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/location.h" #include "base/location.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/webdata/autofill_table.h" #include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
...@@ -80,7 +81,8 @@ void AutocompleteSyncableService::CreateForWebDataServiceAndBackend( ...@@ -80,7 +81,8 @@ void AutocompleteSyncableService::CreateForWebDataServiceAndBackend(
AutofillWebDataService* web_data_service, AutofillWebDataService* web_data_service,
AutofillWebDataBackend* web_data_backend) { AutofillWebDataBackend* web_data_backend) {
web_data_service->GetDBUserData()->SetUserData( web_data_service->GetDBUserData()->SetUserData(
UserDataKey(), new AutocompleteSyncableService(web_data_backend)); UserDataKey(),
base::WrapUnique(new AutocompleteSyncableService(web_data_backend)));
} }
// static // static
......
...@@ -72,8 +72,8 @@ void AutofillProfileSyncableService::CreateForWebDataServiceAndBackend( ...@@ -72,8 +72,8 @@ void AutofillProfileSyncableService::CreateForWebDataServiceAndBackend(
AutofillWebDataBackend* webdata_backend, AutofillWebDataBackend* webdata_backend,
const std::string& app_locale) { const std::string& app_locale) {
web_data_service->GetDBUserData()->SetUserData( web_data_service->GetDBUserData()->SetUserData(
UserDataKey(), UserDataKey(), base::WrapUnique(new AutofillProfileSyncableService(
new AutofillProfileSyncableService(webdata_backend, app_locale)); webdata_backend, app_locale)));
} }
// static // static
......
...@@ -500,8 +500,8 @@ void AutofillWalletMetadataSyncableService::CreateForWebDataServiceAndBackend( ...@@ -500,8 +500,8 @@ void AutofillWalletMetadataSyncableService::CreateForWebDataServiceAndBackend(
AutofillWebDataBackend* web_data_backend, AutofillWebDataBackend* web_data_backend,
const std::string& app_locale) { const std::string& app_locale) {
web_data_service->GetDBUserData()->SetUserData( web_data_service->GetDBUserData()->SetUserData(
UserDataKey(), UserDataKey(), base::WrapUnique(new AutofillWalletMetadataSyncableService(
new AutofillWalletMetadataSyncableService(web_data_backend, app_locale)); web_data_backend, app_locale)));
} }
// static // static
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <utility> #include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
...@@ -240,8 +241,8 @@ void AutofillWalletSyncableService::CreateForWebDataServiceAndBackend( ...@@ -240,8 +241,8 @@ void AutofillWalletSyncableService::CreateForWebDataServiceAndBackend(
AutofillWebDataBackend* webdata_backend, AutofillWebDataBackend* webdata_backend,
const std::string& app_locale) { const std::string& app_locale) {
web_data_service->GetDBUserData()->SetUserData( web_data_service->GetDBUserData()->SetUserData(
UserDataKey(), UserDataKey(), base::WrapUnique(new AutofillWalletSyncableService(
new AutofillWalletSyncableService(webdata_backend, app_locale)); webdata_backend, app_locale)));
} }
// static // static
......
...@@ -26,6 +26,8 @@ namespace autofill { ...@@ -26,6 +26,8 @@ namespace autofill {
class AutofillDriverIOS : public AutofillDriver, class AutofillDriverIOS : public AutofillDriver,
public web::WebStateUserData<AutofillDriverIOS> { public web::WebStateUserData<AutofillDriverIOS> {
public: public:
~AutofillDriverIOS() override;
static void CreateForWebStateAndDelegate( static void CreateForWebStateAndDelegate(
web::WebState* web_state, web::WebState* web_state,
AutofillClient* client, AutofillClient* client,
...@@ -67,7 +69,6 @@ class AutofillDriverIOS : public AutofillDriver, ...@@ -67,7 +69,6 @@ class AutofillDriverIOS : public AutofillDriver,
id<AutofillDriverIOSBridge> bridge, id<AutofillDriverIOSBridge> bridge,
const std::string& app_locale, const std::string& app_locale,
AutofillManager::AutofillDownloadManagerState enable_download_manager); AutofillManager::AutofillDownloadManagerState enable_download_manager);
~AutofillDriverIOS() override;
// The WebState with which this object is associated. // The WebState with which this object is associated.
web::WebState* web_state_; web::WebState* web_state_;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "components/autofill/ios/browser/autofill_driver_ios.h" #include "components/autofill/ios/browser/autofill_driver_ios.h"
#include "base/memory/ptr_util.h"
#include "components/autofill/ios/browser/autofill_driver_ios_bridge.h" #include "components/autofill/ios/browser/autofill_driver_ios_bridge.h"
#include "ios/web/public/browser_state.h" #include "ios/web/public/browser_state.h"
#import "ios/web/public/origin_util.h" #import "ios/web/public/origin_util.h"
...@@ -27,8 +28,8 @@ void AutofillDriverIOS::CreateForWebStateAndDelegate( ...@@ -27,8 +28,8 @@ void AutofillDriverIOS::CreateForWebStateAndDelegate(
web_state->SetUserData( web_state->SetUserData(
UserDataKey(), UserDataKey(),
new AutofillDriverIOS(web_state, client, bridge, app_locale, base::WrapUnique(new AutofillDriverIOS(
enable_download_manager)); web_state, client, bridge, app_locale, enable_download_manager)));
} }
AutofillDriverIOS::AutofillDriverIOS( AutofillDriverIOS::AutofillDriverIOS(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment