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

Unified Diff: net/quic/platform/impl/quic_chromium_clock.cc

Issue 2547233002: Add a QuicChromiumClock and make QuicClock abstract to match internal code. (Closed)
Patch Set: Created 4 years 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: net/quic/platform/impl/quic_chromium_clock.cc
diff --git a/net/quic/platform/impl/quic_chromium_clock.cc b/net/quic/platform/impl/quic_chromium_clock.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9493adae3d79ffb0885e89203b4b5ad72b5297d7
--- /dev/null
+++ b/net/quic/platform/impl/quic_chromium_clock.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/quic/platform/impl/quic_chromium_clock.h"
+
+#include "base/time/time.h"
+
+namespace net {
+
+QuicChromiumClock::QuicChromiumClock() {}
+
+QuicChromiumClock::~QuicChromiumClock() {}
+
+QuicTime QuicChromiumClock::ApproximateNow() const {
+ // At the moment, Chrome does not have a distinct notion of ApproximateNow().
+ // We should consider implementing this using MessageLoop::recent_time_.
+ return Now();
+}
+
+QuicTime QuicChromiumClock::Now() const {
+ return QuicTime(base::TimeTicks::Now());
+}
+
+QuicWallTime QuicChromiumClock::WallNow() const {
+ return QuicWallTime::FromUNIXMicroseconds(base::Time::Now().ToJavaTime() *
+ 1000);
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698