summaryrefslogtreecommitdiffstats
path: root/base/pending_task.h
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-22 04:29:58 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-22 04:29:58 +0000
commitf9855fb1637fbca5d0164ae602b98b6fe460e74b (patch)
tree7ddf928622a9e63095e7c395ed7a7b9a6f354354 /base/pending_task.h
parentb9e6a3d30f8ddda8bc64b31bb59982a062be588e (diff)
downloadchromium_src-f9855fb1637fbca5d0164ae602b98b6fe460e74b.zip
chromium_src-f9855fb1637fbca5d0164ae602b98b6fe460e74b.tar.gz
chromium_src-f9855fb1637fbca5d0164ae602b98b6fe460e74b.tar.bz2
This is jamesr@ code I am landing.
On Windows the message pump code tried to manage the systemwide timer resolution to fire delayed tasks with better than 15ms resolution but it was buggy: 1- A short task that was not followed by any other task will leave the systemwide timer pegged to 1ms 2- After we decided to crank up the timer we would 'lease' the timer for 1 second, for no good reason. Both issues are detrimental to battery power. The source of both problems is that we tried to decide with incomplete information. This patch solves that by having 1 bit for each pending task that requires a high resolution timer and a sum of the number of tasks that require high res timers. BUG=153139 TEST=included here, also see the bug for manual testing. Review URL: https://codereview.chromium.org/395913006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/pending_task.h')
-rw-r--r--base/pending_task.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/base/pending_task.h b/base/pending_task.h
index 65e17f8..a2edc69 100644
--- a/base/pending_task.h
+++ b/base/pending_task.h
@@ -18,9 +18,6 @@ namespace base {
// Contains data about a pending task. Stored in TaskQueue and DelayedTaskQueue
// for use by classes that queue and execute tasks.
struct BASE_EXPORT PendingTask : public TrackingInfo {
-#if _MSC_VER >= 1700
- PendingTask();
-#endif
PendingTask(const tracked_objects::Location& posted_from,
const Closure& task);
PendingTask(const tracked_objects::Location& posted_from,
@@ -43,6 +40,9 @@ struct BASE_EXPORT PendingTask : public TrackingInfo {
// OK to dispatch from a nested loop.
bool nestable;
+
+ // Needs high resolution timers.
+ bool is_high_res;
};
// Wrapper around std::queue specialized for PendingTask which adds a Swap