Commit 9b309f29 authored by Anna Malova's avatar Anna Malova Committed by Commit Bot

Convert TCPSocketWin to use OnceCallback.

Bug: 1007815
Change-Id: I264f5bc31c07711065a4840ce6836e3e5cc9777c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087588
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746893}
parent a036278c
...@@ -489,9 +489,9 @@ int TCPSocketWin::Read(IOBuffer* buf, ...@@ -489,9 +489,9 @@ int TCPSocketWin::Read(IOBuffer* buf,
DCHECK(!core_->read_iobuffer_.get()); DCHECK(!core_->read_iobuffer_.get());
// base::Unretained() is safe because RetryRead() won't be called when |this| // base::Unretained() is safe because RetryRead() won't be called when |this|
// is gone. // is gone.
int rv = int rv = ReadIfReady(
ReadIfReady(buf, buf_len, buf, buf_len,
base::Bind(&TCPSocketWin::RetryRead, base::Unretained(this))); base::BindOnce(&TCPSocketWin::RetryRead, base::Unretained(this)));
if (rv != ERR_IO_PENDING) if (rv != ERR_IO_PENDING)
return rv; return rv;
read_callback_ = std::move(callback); read_callback_ = std::move(callback);
...@@ -932,7 +932,7 @@ void TCPSocketWin::RetryRead(int rv) { ...@@ -932,7 +932,7 @@ void TCPSocketWin::RetryRead(int rv) {
// |this| is gone. // |this| is gone.
rv = ReadIfReady( rv = ReadIfReady(
core_->read_iobuffer_.get(), core_->read_buffer_length_, core_->read_iobuffer_.get(), core_->read_buffer_length_,
base::Bind(&TCPSocketWin::RetryRead, base::Unretained(this))); base::BindOnce(&TCPSocketWin::RetryRead, base::Unretained(this)));
if (rv == ERR_IO_PENDING) if (rv == ERR_IO_PENDING)
return; return;
} }
......
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