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

Side by Side Diff: base/time_posix.cc

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 years, 10 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
« no previous file with comments | « base/time_mac.cc ('k') | base/timer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/time.h" 5 #include <sys/_structs.h>
6
7 #include <sys/time.h>
8 #include <time.h> 6 #include <time.h>
9 7
10 #include <limits>
11
12 #include "base/basictypes.h" 8 #include "base/basictypes.h"
13 #include "base/logging.h" 9 #include "base/time.h"
10 #include "build/build_config.h"
14 11
15 namespace base { 12 namespace base {
16 13
17 struct timespec TimeDelta::ToTimeSpec() const { 14 struct timespec TimeDelta::ToTimeSpec() const {
18 int64 microseconds = InMicroseconds(); 15 int64 microseconds = InMicroseconds();
19 time_t seconds = 0; 16 time_t seconds = 0;
20 if (microseconds >= Time::kMicrosecondsPerSecond) { 17 if (microseconds >= Time::kMicrosecondsPerSecond) {
21 seconds = InSeconds(); 18 seconds = InSeconds();
22 microseconds -= seconds * Time::kMicrosecondsPerSecond; 19 microseconds -= seconds * Time::kMicrosecondsPerSecond;
23 } 20 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 189
193 struct timeval Time::ToTimeVal() const { 190 struct timeval Time::ToTimeVal() const {
194 struct timeval result; 191 struct timeval result;
195 int64 us = us_ - kTimeTToMicrosecondsOffset; 192 int64 us = us_ - kTimeTToMicrosecondsOffset;
196 result.tv_sec = us / Time::kMicrosecondsPerSecond; 193 result.tv_sec = us / Time::kMicrosecondsPerSecond;
197 result.tv_usec = us % Time::kMicrosecondsPerSecond; 194 result.tv_usec = us % Time::kMicrosecondsPerSecond;
198 return result; 195 return result;
199 } 196 }
200 197
201 } // namespace base 198 } // namespace base
OLDNEW
« no previous file with comments | « base/time_mac.cc ('k') | base/timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698