Commit b7552c2a authored by Reilly Grant's avatar Reilly Grant Committed by Chromium LUCI CQ

Convert callbacks in //chrome/browser/chromeos/net

This change converts callbacks from base::Bind and base::Callback to
Once/Repeating in //chrome/browser/chromeos/net.

Bug: 1148570
Change-Id: Id99cfb67bd2831576576b0c01c2cd9b3d5d4444f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2645505
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Satoru Takabayashi <satorux@chromium.org>
Reviewed-by: default avatarSatoru Takabayashi <satorux@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846382}
parent d267990c
...@@ -40,10 +40,10 @@ const unsigned char kAuthority1DN[] = {0x30, 0x0f, 0x31, 0x0d, 0x30, 0x0b, ...@@ -40,10 +40,10 @@ const unsigned char kAuthority1DN[] = {0x30, 0x0f, 0x31, 0x0d, 0x30, 0x0b,
0x04, 0x42, 0x20, 0x43, 0x41}; 0x04, 0x42, 0x20, 0x43, 0x41};
void SaveIdentitiesAndQuitCallback(net::ClientCertIdentityList* out_identities, void SaveIdentitiesAndQuitCallback(net::ClientCertIdentityList* out_identities,
base::Closure quit_closure, base::OnceClosure quit_closure,
net::ClientCertIdentityList in_identities) { net::ClientCertIdentityList in_identities) {
*out_identities = std::move(in_identities); *out_identities = std::move(in_identities);
quit_closure.Run(); std::move(quit_closure).Run();
} }
} // namespace } // namespace
......
...@@ -298,7 +298,7 @@ void NetworkPortalDetectorImpl::ScheduleAttempt(const base::TimeDelta& delay) { ...@@ -298,7 +298,7 @@ void NetworkPortalDetectorImpl::ScheduleAttempt(const base::TimeDelta& delay) {
state_ = STATE_PORTAL_CHECK_PENDING; state_ = STATE_PORTAL_CHECK_PENDING;
next_attempt_delay_ = std::max(delay, strategy_->GetDelayTillNextAttempt()); next_attempt_delay_ = std::max(delay, strategy_->GetDelayTillNextAttempt());
attempt_task_.Reset(base::Bind(&NetworkPortalDetectorImpl::StartAttempt, attempt_task_.Reset(base::BindOnce(&NetworkPortalDetectorImpl::StartAttempt,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, attempt_task_.callback(), next_attempt_delay_); FROM_HERE, attempt_task_.callback(), next_attempt_delay_);
...@@ -317,7 +317,7 @@ void NetworkPortalDetectorImpl::StartAttempt() { ...@@ -317,7 +317,7 @@ void NetworkPortalDetectorImpl::StartAttempt() {
weak_factory_.GetWeakPtr()), weak_factory_.GetWeakPtr()),
NO_TRAFFIC_ANNOTATION_YET); NO_TRAFFIC_ANNOTATION_YET);
attempt_timeout_.Reset( attempt_timeout_.Reset(
base::Bind(&NetworkPortalDetectorImpl::OnAttemptTimeout, base::BindOnce(&NetworkPortalDetectorImpl::OnAttemptTimeout,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
......
...@@ -185,8 +185,8 @@ class NetworkPortalDetectorImpl : public NetworkPortalDetector, ...@@ -185,8 +185,8 @@ class NetworkPortalDetectorImpl : public NetworkPortalDetector,
State state_ = STATE_IDLE; State state_ = STATE_IDLE;
base::ObserverList<Observer>::Unchecked observers_; base::ObserverList<Observer>::Unchecked observers_;
base::CancelableClosure attempt_task_; base::CancelableOnceClosure attempt_task_;
base::CancelableClosure attempt_timeout_; base::CancelableOnceClosure attempt_timeout_;
// Reference to a SharedURLLoaderFactory used to detect portals. // Reference to a SharedURLLoaderFactory used to detect portals.
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_;
......
...@@ -23,7 +23,7 @@ NetworkThrottlingObserver::NetworkThrottlingObserver(PrefService* local_state) ...@@ -23,7 +23,7 @@ NetworkThrottlingObserver::NetworkThrottlingObserver(PrefService* local_state)
: local_state_(local_state) { : local_state_(local_state) {
pref_change_registrar_.Init(local_state_); pref_change_registrar_.Init(local_state_);
base::Callback<void(const std::string&)> throttle_callback = base::Bind( auto throttle_callback = base::BindRepeating(
&NetworkThrottlingObserver::OnPreferenceChanged, base::Unretained(this)); &NetworkThrottlingObserver::OnPreferenceChanged, base::Unretained(this));
pref_change_registrar_.Add(prefs::kNetworkThrottlingEnabled, pref_change_registrar_.Add(prefs::kNetworkThrottlingEnabled,
......
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