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

Unified Diff: base/message_loop.h

Issue 2822035: Change chrome from statically enabling high resolution timers on windows... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/hi_res_timer_manager_win.cc ('k') | base/message_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.h
===================================================================
--- base/message_loop.h (revision 51045)
+++ base/message_loop.h (working copy)
@@ -287,6 +287,20 @@
typedef base::MessagePumpForUI::Observer Observer;
#endif
+ // Returns true if the message loop has high resolution timers enabled.
+ // Provided for testing.
+ bool high_resolution_timers_enabled() {
+#if defined(OS_WIN)
+ return !high_resolution_timer_expiration_.is_null();
+#else
+ return true;
+#endif
+ }
+
+ // When we go into high resolution timer mode, we will stay in hi-res mode
+ // for at least 1s.
+ static const int kHighResolutionTimerModeLeaseTimeMs = 1000;
+
//----------------------------------------------------------------------------
protected:
struct RunState {
@@ -454,6 +468,10 @@
RunState* state_;
+#if defined(OS_WIN)
+ base::TimeTicks high_resolution_timer_expiration_;
+#endif
+
// The next sequence number to use for delayed tasks.
int next_sequence_num_;
« no previous file with comments | « app/hi_res_timer_manager_win.cc ('k') | base/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698