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

Unified Diff: base/message_loop/message_loop.cc

Issue 541203002: fix for high resolution timer on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits fixes Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 16b999c27845c3a6265372124bc632941339fa65..c01e5421bc3478605c5a0b16ef15d36a6bb9af78 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -616,8 +616,11 @@ bool MessageLoop::DoIdleWork() {
// _if_ triggered by the timer happens with good resolution. If we don't
// do this the default resolution is 15ms which might not be acceptable
// for some tasks.
- in_high_res_mode_ = pending_high_res_tasks_ > 0;
- Time::ActivateHighResolutionTimer(in_high_res_mode_);
+ bool high_res = pending_high_res_tasks_ > 0;
+ if (high_res != in_high_res_mode_) {
+ in_high_res_mode_ = high_res;
+ Time::ActivateHighResolutionTimer(in_high_res_mode_);
+ }
#endif
return false;
}
« no previous file with comments | « no previous file | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698