Commit fc677cb3 authored by Ayu Ishii's avatar Ayu Ishii Committed by Commit Bot

Convert base::Bind and base::Callback in components/cast_channel to Once/Repeating

Bug: 1007674
Change-Id: Ia49ed4cc47e67776e7d13a29803d092e46e828b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1979138Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728806}
parent b3f92034
......@@ -231,8 +231,8 @@ void CastSocketImpl::Connect() {
// Set up connection timeout.
if (open_params_.connect_timeout.InMicroseconds() > 0) {
DCHECK(connect_timeout_callback_.IsCancelled());
connect_timeout_callback_.Reset(
base::Bind(&CastSocketImpl::OnConnectTimeout, base::Unretained(this)));
connect_timeout_callback_.Reset(base::BindOnce(
&CastSocketImpl::OnConnectTimeout, base::Unretained(this)));
GetTimer()->Start(FROM_HERE, open_params_.connect_timeout,
connect_timeout_callback_.callback());
}
......
......@@ -374,7 +374,7 @@ class CastSocketImpl : public CastSocket {
std::vector<OnOpenCallback> connect_callbacks_;
// Callback invoked by |connect_timeout_timer_| to cancel the connection.
base::CancelableClosure connect_timeout_callback_;
base::CancelableOnceClosure connect_timeout_callback_;
// Timer invoked when the connection has timed out.
std::unique_ptr<base::OneShotTimer> connect_timeout_timer_;
......
......@@ -96,13 +96,13 @@ class MockCastSocketService : public CastSocketService {
MOCK_METHOD2(OpenSocketInternal,
void(const net::IPEndPoint& ip_endpoint,
const base::Callback<void(CastSocket*)>& open_cb));
const base::RepeatingCallback<void(CastSocket*)>& open_cb));
MOCK_CONST_METHOD1(GetSocket, CastSocket*(int channel_id));
};
class MockCastSocket : public CastSocket {
public:
using MockOnOpenCallback = base::Callback<void(CastSocket* socket)>;
using MockOnOpenCallback = base::RepeatingCallback<void(CastSocket* socket)>;
MockCastSocket();
~MockCastSocket() override;
......
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