Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2721)

Unified Diff: base/time/time_posix.cc

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix Mac CQ errors. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/time/time_posix.cc
diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc
index 0897f9c64e64e669d64c122d7a3b6c8852a082a4..b049f367d32a9528a96998d9f06f80ef8dfdb1fc 100644
--- a/base/time/time_posix.cc
+++ b/base/time/time_posix.cc
@@ -110,6 +110,12 @@ int64_t ClockNow(clockid_t clk_id) {
namespace base {
+// static
+TimeDelta TimeDelta::FromTimeSpec(const timespec& ts) {
+ return TimeDelta(ts.tv_sec * Time::kMicrosecondsPerSecond +
+ ts.tv_nsec / Time::kNanosecondsPerMicrosecond);
+}
+
struct timespec TimeDelta::ToTimeSpec() const {
int64_t microseconds = InMicroseconds();
time_t seconds = 0;

Powered by Google App Engine
This is Rietveld 408576698