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

Unified Diff: net/quic/quic_time.cc

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 5 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
« no previous file with comments | « net/quic/quic_time.h ('k') | net/quic/quic_time_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_time.cc
diff --git a/net/quic/quic_time.cc b/net/quic/quic_time.cc
deleted file mode 100644
index 2b3684bdca54109901e61ee029b12a444710e29c..0000000000000000000000000000000000000000
--- a/net/quic/quic_time.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// 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/quic_time.h"
-
-#include <limits>
-
-#include "base/logging.h"
-
-namespace net {
-
-uint64_t QuicWallTime::ToUNIXSeconds() const {
- return microseconds_ / 1000000;
-}
-
-uint64_t QuicWallTime::ToUNIXMicroseconds() const {
- return microseconds_;
-}
-
-bool QuicWallTime::IsAfter(QuicWallTime other) const {
- return microseconds_ > other.microseconds_;
-}
-
-bool QuicWallTime::IsBefore(QuicWallTime other) const {
- return microseconds_ < other.microseconds_;
-}
-
-bool QuicWallTime::IsZero() const {
- return microseconds_ == 0;
-}
-
-QuicTime::Delta QuicWallTime::AbsoluteDifference(QuicWallTime other) const {
- uint64_t d;
-
- if (microseconds_ > other.microseconds_) {
- d = microseconds_ - other.microseconds_;
- } else {
- d = other.microseconds_ - microseconds_;
- }
-
- if (d > static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
- d = std::numeric_limits<int64_t>::max();
- }
- return QuicTime::Delta::FromMicroseconds(d);
-}
-
-QuicWallTime QuicWallTime::Add(QuicTime::Delta delta) const {
- uint64_t microseconds = microseconds_ + delta.ToMicroseconds();
- if (microseconds < microseconds_) {
- microseconds = std::numeric_limits<uint64_t>::max();
- }
- return QuicWallTime(microseconds);
-}
-
-// TODO(ianswett) Test this.
-QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const {
- uint64_t microseconds = microseconds_ - delta.ToMicroseconds();
- if (microseconds > microseconds_) {
- microseconds = 0;
- }
- return QuicWallTime(microseconds);
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_time.h ('k') | net/quic/quic_time_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698