Commit 6468cd76 authored by Matthias Körber's avatar Matthias Körber Committed by Commit Bot

[Autofill] Exchange bare pointer with weak pointer for callbacks.

Change-Id: I9b1467d5f34d9381c8f944009b8f7511063fa30e
Bug: 1150004, 1148749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544706
Commit-Queue: Matthias Körber <koerber@google.com>
Reviewed-by: default avatarChristoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/master@{#828642}
parent 0679ab58
...@@ -34,7 +34,7 @@ void RegionComboboxModel::LoadRegionData(const std::string& country_code, ...@@ -34,7 +34,7 @@ void RegionComboboxModel::LoadRegionData(const std::string& country_code,
region_data_loader_->LoadRegionData( region_data_loader_->LoadRegionData(
country_code, country_code,
base::BindRepeating(&RegionComboboxModel::OnRegionDataLoaded, base::BindRepeating(&RegionComboboxModel::OnRegionDataLoaded,
base::Unretained(this)), weak_factory_.GetWeakPtr()),
timeout_ms); timeout_ms);
} }
......
...@@ -72,6 +72,9 @@ class RegionComboboxModel : public ui::ComboboxModel { ...@@ -72,6 +72,9 @@ class RegionComboboxModel : public ui::ComboboxModel {
// To be called when the data for the given country code was loaded. // To be called when the data for the given country code was loaded.
base::ObserverList<ui::ComboboxModelObserver> observers_; base::ObserverList<ui::ComboboxModelObserver> observers_;
// Weak pointer factory.
base::WeakPtrFactory<RegionComboboxModel> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(RegionComboboxModel); DISALLOW_COPY_AND_ASSIGN(RegionComboboxModel);
}; };
......
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