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

Side by Side Diff: base/time/time.h

Issue 22791013: Method to convet base::Time to Java timestamp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ' Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/time/time.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) 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 // Time represents an absolute point in time, internally represented as 5 // Time represents an absolute point in time, internally represented as
6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC) 6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC)
7 // (See http://crbug.com/14734). System-dependent clock interface routines are 7 // (See http://crbug.com/14734). System-dependent clock interface routines are
8 // defined in time_PLATFORM.cc. 8 // defined in time_PLATFORM.cc.
9 // 9 //
10 // TimeDelta represents a duration of time, internally represented in 10 // TimeDelta represents a duration of time, internally represented in
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlu sDates. 293 // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlu sDates.
294 static Time FromTimeSpec(const timespec& ts); 294 static Time FromTimeSpec(const timespec& ts);
295 #endif 295 #endif
296 296
297 // Converts to/from the Javascript convention for times, a number of 297 // Converts to/from the Javascript convention for times, a number of
298 // milliseconds since the epoch: 298 // milliseconds since the epoch:
299 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/g etTime. 299 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/g etTime.
300 static Time FromJsTime(double ms_since_epoch); 300 static Time FromJsTime(double ms_since_epoch);
301 double ToJsTime() const; 301 double ToJsTime() const;
302 302
303 // Converts to Java convention for times, a number of
304 // milliseconds since the epoch.
305 int64 ToJavaTime() const;
306
303 #if defined(OS_POSIX) 307 #if defined(OS_POSIX)
304 static Time FromTimeVal(struct timeval t); 308 static Time FromTimeVal(struct timeval t);
305 struct timeval ToTimeVal() const; 309 struct timeval ToTimeVal() const;
306 #endif 310 #endif
307 311
308 #if defined(OS_MACOSX) 312 #if defined(OS_MACOSX)
309 static Time FromCFAbsoluteTime(CFAbsoluteTime t); 313 static Time FromCFAbsoluteTime(CFAbsoluteTime t);
310 CFAbsoluteTime ToCFAbsoluteTime() const; 314 CFAbsoluteTime ToCFAbsoluteTime() const;
311 #endif 315 #endif
312 316
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 #endif 673 #endif
670 }; 674 };
671 675
672 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { 676 inline TimeTicks TimeDelta::operator+(TimeTicks t) const {
673 return TimeTicks(t.ticks_ + delta_); 677 return TimeTicks(t.ticks_ + delta_);
674 } 678 }
675 679
676 } // namespace base 680 } // namespace base
677 681
678 #endif // BASE_TIME_TIME_H_ 682 #endif // BASE_TIME_TIME_H_
OLDNEW
« no previous file with comments | « no previous file | base/time/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698