summaryrefslogtreecommitdiffstats
path: root/base/timer
Commit message (Collapse)AuthorAgeFilesLines
* Revert of Attempting to resolve a race condition with PowerMonitor ↵scottmg@chromium.org2014-04-052-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/179923006/) Reason for revert: Failing interactive_ui_tests dbg: http://build.chromium.org/p/chromium.win/builders/Interactive%20Tests%20(dbg)/builds/47083/steps/interactive_ui_tests/logs/stdio Original issue's description: > Attempting to resolve a race condition with PowerMonitor. > > ThreadSanitizer caught multiple instances where PowerMonitor::Get or PowerMonitor::Add/RemoveObserver were being called concurrently with the PowerMonitor constructor in the main thread. These functions access a process-global PowerMontior instance (g_power_monitor), which was not thread safe. > > This change adds locks around PowerMonitor creation and deletion, and forces Add/RemoveObserver to be called in a threadsafe manner. It also removes the need to call PowerMonitor::Get. > > BUG=268924 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262018 TBR=mattm@chromium.org,jyasskin@chromium.org,kbr@chromium.org,bradnelson@chromium.org,brettw@chromium.org,bradchen@chromium.org,willchan@chromium.org,jam@chromium.org,jochen@chromium.org,timurrrr@chromium.org,glider@chromium.org,acolwell@chromium.org,scherkus@chromium.org,bajones@chromium.org NOTREECHECKS=true NOTRY=true BUG=268924 Review URL: https://codereview.chromium.org/226263008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262026 0039d316-1c4b-4281-b951-d872f2087c98
* Attempting to resolve a race condition with PowerMonitor.bajones@chromium.org2014-04-052-7/+6
| | | | | | | | | | | | ThreadSanitizer caught multiple instances where PowerMonitor::Get or PowerMonitor::Add/RemoveObserver were being called concurrently with the PowerMonitor constructor in the main thread. These functions access a process-global PowerMontior instance (g_power_monitor), which was not thread safe. This change adds locks around PowerMonitor creation and deletion, and forces Add/RemoveObserver to be called in a threadsafe manner. It also removes the need to call PowerMonitor::Get. BUG=268924 Review URL: https://codereview.chromium.org/179923006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262018 0039d316-1c4b-4281-b951-d872f2087c98
* base: add MockTimerellyjones@chromium.org2014-03-135-10/+203
| | | | | | | | | | | MockTimer is a subclass of Timer that will never fire on its own, but can be manually fired by a test with the Fire() method. BUG=131227 Review URL: https://codereview.chromium.org/197243003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256942 0039d316-1c4b-4281-b951-d872f2087c98
* Removes MessageLoop::TYPE_XXX where possiblesky@chromium.org2014-01-151-8/+8
| | | | | | | | | | | | This is part of attempting to get rid of MessageLoop::Type enum. BUG=none TEST=none R=darin@chromium.org Review URL: https://codereview.chromium.org/136683004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244996 0039d316-1c4b-4281-b951-d872f2087c98
* Adding tests for repeating timers with 0 delay.qsr@chromium.org2013-12-061-11/+30
| | | | | | | | R=mark@chromium.org Review URL: https://codereview.chromium.org/105103002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239222 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor base::Timer to not call TimeTicks::Now for task with 0 delay.qsr@chromium.org2013-12-042-8/+19
| | | | | | | | | | | | | This CL remove the calls to TimeTicks::Now when a timer is called with a delay null or negative. The reason is that TimeTicks::Now is costly on Android and is not useful in that use case. R=mark@chromium.org BUG=315070 Review URL: https://codereview.chromium.org/105003002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238741 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move PerfTimer out of test/ directory.tfarina@chromium.org2013-09-292-0/+47
| | | | | | | | | | | | | | | | | | Reason: PerfTimer is used by production code, so it doesn't make sense to have it as test only. - Rename it to ElapsedTimer. - Move into base namespace. - Move into timer/ directory. BUG=None TEST=None, no functional change R=brettw@chromium.org TBR=grt@chromium.org # for chrome_frame Review URL: https://codereview.chromium.org/24265005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225898 0039d316-1c4b-4281-b951-d872f2087c98
* test IWYU fixups for basemostynb@opera.com2013-09-032-1/+4
| | | | | | | | | | | | | These are some of the suggestions from running include-what-you-use[1] on the base target. [1] https://code.google.com/p/include-what-you-use/ BUG=259043 Review URL: https://chromiumcodereview.appspot.com/23540009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221067 0039d316-1c4b-4281-b951-d872f2087c98
* Created multi-process-friendly PowerMonitor interface.bajones@chromium.org2013-08-022-2/+7
| | | | | | | | | | | | | PowerMonitor status is now captured in the browser process, which has the appropriate UI thread, and then sent via IPC to other processes which are interested in the power state. BUG=236031 R=apatrick@chromium.org, jam@chromium.org, jar@chromium.org, jvoung@chromium.org, kbr@chromium.org, mpcomplete@chromium.org, palmer@chromium.org, piman@chromium.org, vandebo@chromium.org Review URL: https://codereview.chromium.org/17074009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215381 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of the message_loop header in base/.avi@chromium.org2013-07-182-2/+2
| | | | | | | | | | BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19224003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212281 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in base/, part 2.avi@chromium.org2013-06-282-2/+2
| | | | | | | | | | BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/18119002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209144 0039d316-1c4b-4281-b951-d872f2087c98
* Move timing files into base/time and base/timer, install forwarding headers.avi@chromium.org2013-06-277-0/+1075
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