From 2f159a5f93250706ad5bed6c2e8521ead4df749f Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 25 Nov 2016 12:22:32 +0000 Subject: Introduce Chrono to the Connection class. NFCI. llvm-svn: 287922 --- lldb/source/Plugins/Platform/Android/AdbClient.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lldb/source/Plugins/Platform/Android/AdbClient.cpp') diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp index 05004406c04..eb684ad0fbc 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -74,10 +74,9 @@ Error ReadAllBytes(Connection &conn, void *buffer, size_t size) { const auto deadline = now + kReadTimeout; size_t total_read_bytes = 0; while (total_read_bytes < size && now < deadline) { - uint32_t timeout_usec = duration_cast(deadline - now).count(); auto read_bytes = conn.Read(read_buffer + total_read_bytes, size - total_read_bytes, - timeout_usec, status, &error); + duration_cast(deadline - now), status, &error); if (error.Fail()) return error; total_read_bytes += read_bytes; @@ -276,9 +275,9 @@ Error AdbClient::ReadMessageStream(std::vector &message, if (elapsed >= timeout) return Error("Timed out"); - size_t n = m_conn->Read( - buffer, sizeof(buffer), - duration_cast(timeout - elapsed).count(), status, &error); + size_t n = m_conn->Read(buffer, sizeof(buffer), + duration_cast(timeout - elapsed), + status, &error); if (n > 0) message.insert(message.end(), &buffer[0], &buffer[n]); } -- cgit v1.2.3