summaryrefslogtreecommitdiffstats
path: root/base/time_posix.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move timing files into base/time and base/timer, install forwarding headers.avi@chromium.org2013-06-271-328/+0
| | | | | | | | | | BUG=254986 TEST=none TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/18063004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208951 0039d316-1c4b-4281-b951-d872f2087c98
* base/time_posix.cc: Work around new integer overflow warning.hans@chromium.org2013-05-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | A new version of Clang warns about the previous version of this code: ../../base/time_posix.cc:212:58: warning: overflow in expression; result is 0 with type 'long' [-Winteger-overflow] milliseconds = std::numeric_limits<SysTime>::min() * ^ ../../base/time_posix.cc:215:59: warning: overflow in expression; result is -1000 with type 'long' [-Winteger-overflow] milliseconds = (std::numeric_limits<SysTime>::max() * ^ The warning is legitimate: that code does overflow on LP64 platforms. However, we will never hit that code on 64-bit platforms, because mktime() will not overflow when time_t is a 64-bit type. I have added a CHECK about this and worked around the warning by splitting up the expression. BUG=24737 R=brettw@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/15560002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201735 0039d316-1c4b-4281-b951-d872f2087c98
* Remove define _POSIX_MONOTONIC_CLOCK for OS_ANDROIDboliu@chromium.org2013-01-031-4/+0
| | | | | | | | | | | | It is only defined in the cc file and does not appear to be used. BUG= TBR=brettw,michaelbai Review URL: https://chromiumcodereview.appspot.com/11748011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174936 0039d316-1c4b-4281-b951-d872f2087c98
* base/time_posix.cc: Use time64_t on Android.digit@chromium.org2012-12-031-12/+50
| | | | | | | | | | | | | | | | | Android's time_t is 32-bit by default, but the platform provides a <time64.h> providing for time64_t and associated functions. Use time64_t in base/time_posix.cc to implement base::Time::Exploded conversion routines. This avoids un-necessary clamping of the year to the 1901-2038 range when calling base::Time::Explode() or base::Time::FromExploded(). BUG=162007 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11308176 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170738 0039d316-1c4b-4281-b951-d872f2087c98
* Update Time and TimeTicks for NaCl now that it has CLOCK_MONOTONIC.bbudge@chromium.org2012-11-071-11/+1
| | | | | | | | | BUG=116317 TEST=browser_tests, PPB_Core Review URL: https://chromiumcodereview.appspot.com/11363114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166359 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix the possible bug in base::Time:Now() that can cause the crashing ↵jennyz@chromium.org2012-09-111-0/+4
| | | | | | | | | | later in icu code called from ash tray TimeView::UpdateTextInternal() if the call to gettimeofday fails. BUG=147570 Review URL: https://chromiumcodereview.appspot.com/10907178 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156134 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing Time::Max()'s behavior with Time::ToTimeT() and friends.mkwst@chromium.org2012-09-081-0/+15
| | | | | | | | | | | | | | It looks like the math that's done to convert epoch times between platforms is giving incorrect results when confronted with a "max" time. This CL adjusts the various conversion methods to persist maxness in the same way they currently persist zeroness. BUG=146328 Review URL: https://chromiumcodereview.appspot.com/10916089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155591 0039d316-1c4b-4281-b951-d872f2087c98
* Enable parts of base_untrusted that are used by remoting clientsergeyu@chromium.org2012-07-261-1/+1
| | | | | | | | | | | | | | 1. base64, rand_util, threading, time and threads were previosly disabled in base_untrusted. Remoting code depends on these parts of base, so they need to be enabled. 2. Implemented NaCl version of rand_util. 3. Enabled glibc version of base_untrusted BUG=134216 Review URL: https://chromiumcodereview.appspot.com/10795083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148641 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Enable message loop start UMA measurement on Macjeremy@chromium.org2012-06-151-0/+10
| | | | | | | | | | | | | | Turned out we were only recording this information on Windows. Bug=None TEST=All unit tests should pass BUG= Review URL: https://chromiumcodereview.appspot.com/10557007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142459 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing gcc 4.7 building problems.shenhan@google.com2012-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | a) - gcc-4.7 improved the implicit headers that it includes. with <4.7, the gthr-default.h file always pulls in unistd.h. with >=4.7, they avoided that include when possible. so code that isn't including unistd.h itself but needs it now breaks. b) - narrowing conversion in initiliazation list now raises an 'ill-formed conversion' warning, which causes error when -Werror is given. [THIS PART IS NOW REVERTED IN THE PATCH} c) - included patches from pastebin - http://pastebin.com/raw.php?i=p3UKs7Cg Note - this may not be fixing all the gcc 4.7 build problems for all parts, but rather than submitting one big-fix-for-all CL, we'd better do it incrementally (given that all the modification is reasonable and minor) so that at least some parts get a successful gcc 4.7 build. BUG=None TEST=Built successfully using GCC-4.7 under chromium chroot Review URL: https://chromiumcodereview.appspot.com/10451068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140470 0039d316-1c4b-4281-b951-d872f2087c98
* Enable system trace clock use on chrome os.sleffler@chromium.org2012-05-151-4/+8
| | | | | | | | | | | | | | | | Enable CLOCK_SYSTEM_TRACE use when built with chromeos=1. Handle the case of building for chrome os but running on a non-chromeos platform by handling clock_gettime failure and falling back to HighResNow. BUG=chromium-os:30502 TEST=base_unittests + verify chrome:tracing works w/ a chromeos=1 build on linux and on cros (using the correct clock in each case) Change-Id: I1627e414524c04db27ddf2a62798a802ea440919 Review URL: https://chromiumcodereview.appspot.com/10384154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137300 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 136389 - Enable system trace clock use on chrome os.yzshen@chromium.org2012-05-101-6/+0
| | | | | | | | | | | | | | | | | Manually define CLOCK_SYSTEM_TRACE for OS_CHROMEOS. This is in the code (and not gyp) to minimize scope. BUG=chromium-os:30502 TEST=verify chrome:tracing works w/ a chromeos=1 build on linux and on cros (using the correct clock in each case) Change-Id: I9439a1de9fe30cb2f34652020a29a4450b71e1ea Review URL: https://chromiumcodereview.appspot.com/10356028 TBR=sleffler@chromium.org Review URL: https://chromiumcodereview.appspot.com/10382112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136397 0039d316-1c4b-4281-b951-d872f2087c98
* Enable system trace clock use on chrome os.sleffler@chromium.org2012-05-101-0/+6
| | | | | | | | | | | | | | Manually define CLOCK_SYSTEM_TRACE for OS_CHROMEOS. This is in the code (and not gyp) to minimize scope. BUG=chromium-os:30502 TEST=verify chrome:tracing works w/ a chromeos=1 build on linux and on cros (using the correct clock in each case) Change-Id: I9439a1de9fe30cb2f34652020a29a4450b71e1ea Review URL: https://chromiumcodereview.appspot.com/10356028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136389 0039d316-1c4b-4281-b951-d872f2087c98
* Add interface to system trace clock.sleffler@chromium.org2012-05-011-0/+28
| | | | | | | | | | | | | | | | | | Add TimeTicks::NowFromSystemTraceTime to return the current system trace event clock (falling back to TimeTicks::HighResNow when not supported). On systems where the system trace clock is available this allows system and chrome events to be stamped with a common clock (eliminating post-processing time shift adjustment that can be hard). BUG=chromium-os:27809 TEST=unit tests + collect trace data on chrome os w/ kernel that supports clock_gettime(CLOCK_SYSTEM_TRACE) Change-Id: Ia6a500bd13a6f09c49052a1dd1421027960d8dea Review URL: http://codereview.chromium.org/10257020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134772 0039d316-1c4b-4281-b951-d872f2087c98
* Make more of base compile with the Native Client toolchain.bbudge@chromium.org2012-02-251-0/+2
| | | | | | | | | | | | This is needed to get parts of the PPAPI proxy to compile as untrusted code. Leaving base.gypi unchanged even though this adds files, as they are only used by experimental target. BUG=none TEST=none Review URL: http://codereview.chromium.org/9465017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123613 0039d316-1c4b-4281-b951-d872f2087c98
* Fix POSIX and Mac Time::Explode().viettrungluu@chromium.org2012-01-101-5/+23
| | | | | | | | | | Also add a test for the case that failed. BUG=109437,109465 Review URL: http://codereview.chromium.org/9124016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116969 0039d316-1c4b-4281-b951-d872f2087c98
* define OS_BSD on *BSD and replace the ifdefs to use thatrobert.nagy@gmail.com2011-11-151-1/+1
| | | | | | | | | | BUG= TEST=compile Review URL: http://codereview.chromium.org/8564020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109986 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream misc changes for android.michaelbai@google.com2011-08-261-0/+8
| | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/7701014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98432 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream process and thread related code.michaelbai@google.com2011-06-291-1/+1
| | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/7247015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91009 0039d316-1c4b-4281-b951-d872f2087c98
* Patch for Solaris support, mostly ifdefs and header files, plus adds ↵chromium@hybridsource.org2011-06-251-1/+1
| | | | | | | | | | | libevent configuration. BUG=30101 TEST=compiles Review URL: http://codereview.chromium.org/7238021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90494 0039d316-1c4b-4281-b951-d872f2087c98
* Adding missing inclusionstzik@chromium.org2011-06-181-1/+2
| | | | | | | | | | BUG=None TEST='LoggingTest.*,FileUtilTest.*,PlatformFile.*,StringNumberConversionsTest.*,Time,TimeTicks,TimeDelta' Review URL: http://codereview.chromium.org/7108033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89595 0039d316-1c4b-4281-b951-d872f2087c98
* Make time_posix.cc build in Native Clientabarth@chromium.org2011-03-131-0/+11
| | | | | | | | | | | Time handling in Native Client isn't quite as robust as on other posix systems. This patch adds a handful of ifdefs to work around these limitations. I've filed the underlying bugs with NaCl, but they aren't likely to be fixed until after NaCl switches to glibc. Review URL: http://codereview.chromium.org/6683025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77966 0039d316-1c4b-4281-b951-d872f2087c98
* Order function definitions in base/ according to the header.erg@google.com2011-01-111-37/+37
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6085015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70975 0039d316-1c4b-4281-b951-d872f2087c98
* BSD port changes for base/ (OS_POSIX/GTK instead of OS_LINUXpvalchev@google.com2010-03-101-1/+1
| | | | | | | | where applicable, missing includes, etc) Review URL: http://codereview.chromium.org/774001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41143 0039d316-1c4b-4281-b951-d872f2087c98
* Actually delete databases in CookiesTreeModel.jochen@chromium.org2010-02-181-1/+9
| | | | | | | | | BUG=34633 TEST=delete a database while it's opened in the renderer Review URL: http://codereview.chromium.org/600104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39346 0039d316-1c4b-4281-b951-d872f2087c98
* Make ProcessWatcher use kqueues on Mac.jeremy@chromium.org2009-12-151-0/+16
| | | | | | | | | | | | | * Port ProcessWatcher::EnsureProcessTerminated() to kqueue() APIs on OS X. * Make ProcessWatcher::EnsureProcessGetsReaped() Linux-only, since it's only used there. * Add a unit test. BUG=12731 TEST=Open Chrome/Mac, open and close a few tabs. Processes shouldn't stay around. Review URL: http://codereview.chromium.org/496007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34547 0039d316-1c4b-4281-b951-d872f2087c98
* Port some of the base module to FreeBSD. Extracted fromwtc@chromium.org2009-08-311-3/+4
| | | | | | | | | | | | | | http://codereview.chromium.org/172032. The patch is contributed by Ben Laurie of Google. Original review URL: http://codereview.chromium.org/180037 R=wtc BUG=none TEST=none Review URL: http://codereview.chromium.org/183016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24950 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-1/+1
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-1/+1
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Convert internal time format to Windows 1601 epoch on Linux & Mac.brettw@chromium.org2009-08-261-42/+34
| | | | | | | | | | | Although we represent time internally starting from 1601, there are still things like time explosion that will not work before the year 1900. This limitation is the same as it was previously. BUG=14734 Review URL: http://codereview.chromium.org/173296 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24417 0039d316-1c4b-4281-b951-d872f2087c98
* Retrial of the first step to port file_util::CountFilesCreatedAfter()erikkay@google.com2009-04-181-0/+6
| | | | | | | | | Submitting http://codereview.chromium.org/75033 on behalf of hamaji Review URL: http://codereview.chromium.org/67276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13993 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-21/+21
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-5/+5
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Handle time overflow more gracefully in base/time_posix.cc. Instead ofmark@chromium.org2008-11-041-5/+38
| | | | | | | | | asserting when encountering time overflow, use the most distant future or past time representation possible. This fixes assertions that occur when handling cookies that expire well in the future. Review URL: http://codereview.chromium.org/8771 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4631 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r4473 to fix build breakage (local time zone tests failed)amanda@chromium.org2008-11-031-1/+29
| | | | | | | TBR mmentovai@chromium.org Review URL: http://codereview.chromium.org/9274 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4496 0039d316-1c4b-4281-b951-d872f2087c98
* Update Mac implemention of Time to prevent problems withamanda@chromium.org2008-11-031-30/+1
| | | | | | | | | times later than the UNIX epoch 32 bit rollover in 2038 (such as cookie expirations). time_t is only 32 bits in MacOS X, so we can't just use time_posix.cc Review URL: http://codereview.chromium.org/9249 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4473 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-0/+4
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Change to Hi Res timers on Windows.mbelshe@google.com2008-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two parts of this: 1) TimeTicks:Now() Don't call timeBeginPeriod() in all cases. Use the new SystemMonitor class to watch battery on/off transitions and use the timeBeginPeriod() only when we're using the battery. 2) TimeTicks::UnreliableHiResNow() Change this function from "UnreliableHiResNow()" to "HiResNow()". We still use QPC, but we detect if we're on AMD Athlon XP machines which fail on QPC. For those systems, we fall back to TimeTicks::Now(). Updated tests to detect hardware specifics of timers. Output of the test will contain lines such as these: [ RUN ] TimeTicks.SubMillisecondTimers Min timer is: 1us [ OK ] TimeTicks.SubMillisecondTimers [ RUN ] TimeTicks.TimeGetTimeCaps timeGetTime range is 1 to 1000000ms [ OK ] TimeTicks.TimeGetTimeCaps [ RUN ] TimeTicks.QueryPerformanceFrequency QueryPerformanceFrequency is 2394.18MHz [ OK ] TimeTicks.QueryPerformanceFrequency [ RUN ] TimeTicks.TimerPerformance Time::Now: 0.11us per call TimeTicks::Now: 0.09us per call TimeTicks::HighResNow: 0.26us per call [ OK ] TimeTicks.TimerPerformance Review URL: http://codereview.chromium.org/4092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2625 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use the Windows high-resolution Time::Now hacks on Posix, the normal ↵deanm@chromium.org2008-09-111-1/+1
| | | | | | | | resultion from the time APIs there should be enough. Review URL: http://codereview.chromium.org/2420 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2056 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of an unneded static variable in the Mac TimeTicks::Nowmmentovai@google.com2008-09-091-6/+10
| | | | | | Review URL: http://codereview.chromium.org/1849 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1911 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Make POSIX time routines work on Linux by providing a POSIX-conformant ↵mmentovai@google.com2008-08-111-0/+162
version of TimeTicks::Now() to replace the Mach-specific one used on the Mac. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@664 0039d316-1c4b-4281-b951-d872f2087c98