summaryrefslogtreecommitdiffstats
path: root/base/message_loop
diff options
context:
space:
mode:
authorbrucedawson <brucedawson@chromium.org>2015-08-24 10:38:07 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-24 17:38:56 +0000
commit3e74c7c6e2c4d3ca1e9876d81d95c66b7be512b5 (patch)
tree423add3b62da323c30f564ca7ee51f844f0ee217 /base/message_loop
parentc31f81d2b0da1ee93d6ae1995f50b3d733fcce1e (diff)
downloadchromium_src-3e74c7c6e2c4d3ca1e9876d81d95c66b7be512b5.zip
chromium_src-3e74c7c6e2c4d3ca1e9876d81d95c66b7be512b5.tar.gz
chromium_src-3e74c7c6e2c4d3ca1e9876d81d95c66b7be512b5.tar.bz2
Reland of move 1 ms rounding up of task delays on Windows (patchset #1 id:1 of https://codereview.chromium.org/1304293002/ )
Reason for revert: The original change was reverted in error. The Webkit Win10 builder has been hitting multiple failures for a long time. Neither my change nor the revert affected this. And, the linked build failures (builds/71) were before my change landed. By reverting the revert of my undo of a previous change we are putting the code back to its original state (see original description) Original issue's description: > Revert of Remove 1 ms rounding up of task delays on Windows (patchset #1 id:1 of https://codereview.chromium.org/1305873002/ ) > > Reason for revert: > Figuring out if this could cause Win10 failures: http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win10/builds/71 > > Original issue's description: > > Remove 1 ms rounding up of task delays on Windows > > > > Prior to a couple of attempts at fixing bug 487724 the message pump > > would sometimes end up spinning for up to a ms when waiting for a > > message's time to arrive. This was unintentional and non-obvious. > > > > The eventual fix was to round up the delay time to the next ms. > > Unfortunately this caused a regression in smoothness.top_25_smooth > > which has not been resolved (investigation was delayed due to some > > confusion about the results). Therefore this change reverts both > > fix attempts in order to leave time for a proper investigation and > > any necessary fixes. > > > > It is worth mentioning that the delay introduced by rounding up to 1 > > ms is actually worse than expected on some operating systems. On Windows > > 7 a call to Sleep(1) will, if the timer frequency is raised, return > > within a ms. On Windows 8.1 it will often take two ms to return, which > > increases the delay. If the timer frequency is at its default interval > > of 15.625 ms then the delay can be longer. > > > > BUG=487724,497536 > > > > Committed: https://crrev.com/2b1bf190a079709a1a6a769bf86e782423d23121 > > Cr-Commit-Position: refs/heads/master@{#344688} > > TBR=rvargas@chromium.org,brucedawson@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=487724,497536 > > Committed: https://crrev.com/189fc2149ec370a0a42b1bb63e9b49fa579aa1d7 > Cr-Commit-Position: refs/heads/master@{#344798} TBR=rvargas@chromium.org,pfeldman@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=487724,497536 Review URL: https://codereview.chromium.org/1311863002 Cr-Commit-Position: refs/heads/master@{#345110}
Diffstat (limited to 'base/message_loop')
-rw-r--r--base/message_loop/message_pump_default.cc9
1 files changed, 0 insertions, 9 deletions
diff --git a/base/message_loop/message_pump_default.cc b/base/message_loop/message_pump_default.cc
index daa80d8..27c19e0 100644
--- a/base/message_loop/message_pump_default.cc
+++ b/base/message_loop/message_pump_default.cc
@@ -4,8 +4,6 @@
#include "base/message_loop/message_pump_default.h"
-#include <algorithm>
-
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
@@ -54,13 +52,6 @@ void MessagePumpDefault::Run(Delegate* delegate) {
event_.Wait();
} else {
TimeDelta delay = delayed_work_time_ - TimeTicks::Now();
-#if defined(OS_WIN)
- // If the delay is greater than zero and under 1 ms we need to round up to
- // 1 ms or else we will end up spinning until it counts down to zero
- // because sub-ms waits aren't supported on Windows.
- if (delay > TimeDelta())
- delay = std::max(delay, TimeDelta::FromMilliseconds(1));
-#endif
if (delay > TimeDelta()) {
event_.TimedWait(delay);
} else {