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

Side by Side Diff: net/quic/quic_time.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_time.h" 5 #include "net/quic/quic_time.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 // Highest number of microseconds that DateTimeOffset can hold. 11 // Highest number of microseconds that DateTimeOffset can hold.
12 const int64 kQuicInfiniteTimeUs = GG_INT64_C(0x7fffffffffffffff) / 10; 12 const int64 kQuicInfiniteTimeUs = GG_INT64_C(0x7fffffffffffffff) / 10;
13 13
14 QuicTime::Delta::Delta(base::TimeDelta delta) 14 QuicTime::Delta::Delta(base::TimeDelta delta) : delta_(delta) {
15 : delta_(delta) {
16 } 15 }
17 16
18 // static 17 // static
19 QuicTime::Delta QuicTime::Delta::Zero() { 18 QuicTime::Delta QuicTime::Delta::Zero() {
20 return QuicTime::Delta::FromMicroseconds(0); 19 return QuicTime::Delta::FromMicroseconds(0);
21 } 20 }
22 21
23 // static 22 // static
24 QuicTime::Delta QuicTime::Delta::Infinite() { 23 QuicTime::Delta QuicTime::Delta::Infinite() {
25 return QuicTime::Delta::FromMicroseconds(kQuicInfiniteTimeUs); 24 return QuicTime::Delta::FromMicroseconds(kQuicInfiniteTimeUs);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // static 86 // static
88 QuicTime QuicTime::Zero() { 87 QuicTime QuicTime::Zero() {
89 return QuicTime(base::TimeTicks()); 88 return QuicTime(base::TimeTicks());
90 } 89 }
91 90
92 // static 91 // static
93 QuicTime QuicTime::Max(QuicTime time1, QuicTime time2) { 92 QuicTime QuicTime::Max(QuicTime time1, QuicTime time2) {
94 return time1 > time2 ? time1 : time2; 93 return time1 > time2 ? time1 : time2;
95 } 94 }
96 95
97 QuicTime::QuicTime(base::TimeTicks ticks) 96 QuicTime::QuicTime(base::TimeTicks ticks) : ticks_(ticks) {
98 : ticks_(ticks) {
99 } 97 }
100 98
101 int64 QuicTime::ToDebuggingValue() const { 99 int64 QuicTime::ToDebuggingValue() const {
102 return (ticks_ - base::TimeTicks()).InMicroseconds(); 100 return (ticks_ - base::TimeTicks()).InMicroseconds();
103 } 101 }
104 102
105 bool QuicTime::IsInitialized() const { 103 bool QuicTime::IsInitialized() const {
106 return ticks_ != base::TimeTicks(); 104 return ticks_ != base::TimeTicks();
107 } 105 }
108 106
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 166 }
169 167
170 QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const { 168 QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const {
171 uint64 seconds = seconds_ - delta.ToSeconds(); 169 uint64 seconds = seconds_ - delta.ToSeconds();
172 if (seconds > seconds_) { 170 if (seconds > seconds_) {
173 seconds = 0; 171 seconds = 0;
174 } 172 }
175 return QuicWallTime(seconds); 173 return QuicWallTime(seconds);
176 } 174 }
177 175
178 QuicWallTime::QuicWallTime(uint64 seconds) 176 QuicWallTime::QuicWallTime(uint64 seconds) : seconds_(seconds) {
179 : seconds_(seconds) {
180 } 177 }
181 178
182 } // namespace net 179 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698