Commit 741ba863 authored by Yuzu Saijo's avatar Yuzu Saijo Committed by Commit Bot

[code health]Convert content/common away from base::Bind

base::Bind is deprecated in favor of either base::BindOnce or
base::BindRepeating, depending on whether the callback is invoked once
or multiple times.

Bug: 1007762
Change-Id: I138c46449a3c998eb35e6cca5a9beb1050727b92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1924175Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716930}
parent 44964b29
...@@ -70,12 +70,12 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -70,12 +70,12 @@ class ServiceManagerConnectionImpl::IOThreadContext
} }
// Safe to call from any thread. // Safe to call from any thread.
void Start(const base::Closure& stop_callback) { void Start(base::OnceClosure stop_callback) {
DCHECK(!started_); DCHECK(!started_);
started_ = true; started_ = true;
callback_task_runner_ = base::ThreadTaskRunnerHandle::Get(); callback_task_runner_ = base::ThreadTaskRunnerHandle::Get();
stop_callback_ = stop_callback; stop_callback_ = std::move(stop_callback);
io_task_runner_->PostTask( io_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&IOThreadContext::StartOnIOThread, this)); FROM_HERE, base::BindOnce(&IOThreadContext::StartOnIOThread, this));
} }
...@@ -290,7 +290,7 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -290,7 +290,7 @@ class ServiceManagerConnectionImpl::IOThreadContext
void OnDisconnected() override { void OnDisconnected() override {
ClearConnectionFiltersOnIOThread(); ClearConnectionFiltersOnIOThread();
callback_task_runner_->PostTask(FROM_HERE, stop_callback_); callback_task_runner_->PostTask(FROM_HERE, std::move(stop_callback_));
} }
base::ThreadChecker io_thread_checker_; base::ThreadChecker io_thread_checker_;
...@@ -311,7 +311,7 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -311,7 +311,7 @@ class ServiceManagerConnectionImpl::IOThreadContext
scoped_refptr<base::SequencedTaskRunner> callback_task_runner_; scoped_refptr<base::SequencedTaskRunner> callback_task_runner_;
// Callback to run if the service is stopped by the service manager. // Callback to run if the service is stopped by the service manager.
base::Closure stop_callback_; base::OnceClosure stop_callback_;
std::unique_ptr<service_manager::ServiceBinding> service_binding_; std::unique_ptr<service_manager::ServiceBinding> service_binding_;
...@@ -408,8 +408,8 @@ ServiceManagerConnectionImpl::~ServiceManagerConnectionImpl() { ...@@ -408,8 +408,8 @@ ServiceManagerConnectionImpl::~ServiceManagerConnectionImpl() {
void ServiceManagerConnectionImpl::Start() { void ServiceManagerConnectionImpl::Start() {
context_->Start( context_->Start(
base::Bind(&ServiceManagerConnectionImpl::OnConnectionLost, base::BindOnce(&ServiceManagerConnectionImpl::OnConnectionLost,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
void ServiceManagerConnectionImpl::Stop() { void ServiceManagerConnectionImpl::Stop() {
......
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