Index: remoting/protocol/fake_datagram_socket.cc |
diff --git a/remoting/protocol/fake_datagram_socket.cc b/remoting/protocol/fake_datagram_socket.cc |
index 75a50b39a74af4b0b4c315443877a0c7c683168a..9bd4ede48b336e0356aebfa8b7342676f68dd1cc 100644 |
--- a/remoting/protocol/fake_datagram_socket.cc |
+++ b/remoting/protocol/fake_datagram_socket.cc |
@@ -5,6 +5,7 @@ |
#include "remoting/protocol/fake_datagram_socket.h" |
#include "base/bind.h" |
+#include "base/callback_helpers.h" |
#include "base/single_thread_task_runner.h" |
#include "base/thread_task_runner_handle.h" |
#include "net/base/address_list.h" |
@@ -36,9 +37,7 @@ void FakeDatagramSocket::AppendInputPacket(const std::string& data) { |
int result = CopyReadData(read_buffer_.get(), read_buffer_size_); |
read_buffer_ = nullptr; |
- net::CompletionCallback callback = read_callback_; |
- read_callback_.Reset(); |
- callback.Run(result); |
+ base::ResetAndReturn(&read_callback_).Run(result); |
} |
} |