diff options
author | sky <sky@chromium.org> | 2015-12-01 11:04:13 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-01 19:05:45 +0000 |
commit | cda09a9265714033da176c7e07584abac26321b2 (patch) | |
tree | 5854b9fb4dafac6448bc7c4f624371b18b279da0 /components | |
parent | eeff8955684831617c68212aea2da015be047703 (diff) | |
download | chromium_src-cda09a9265714033da176c7e07584abac26321b2.zip chromium_src-cda09a9265714033da176c7e07584abac26321b2.tar.gz chromium_src-cda09a9265714033da176c7e07584abac26321b2.tar.bz2 |
Increase event timer for debug builds
Without this I readily hit the timeout in a debug build on windows.
BUG=none
TEST=none
R=sadrul@chromium.org
Review URL: https://codereview.chromium.org/1490843002
Cr-Commit-Position: refs/heads/master@{#362466}
Diffstat (limited to 'components')
-rw-r--r-- | components/mus/ws/window_tree_host_impl.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/components/mus/ws/window_tree_host_impl.cc b/components/mus/ws/window_tree_host_impl.cc index da44bdb..7360710 100644 --- a/components/mus/ws/window_tree_host_impl.cc +++ b/components/mus/ws/window_tree_host_impl.cc @@ -4,6 +4,7 @@ #include "components/mus/ws/window_tree_host_impl.h" +#include "base/debug/debugger.h" #include "base/strings/utf_string_conversions.h" #include "components/mus/common/types.h" #include "components/mus/ws/connection_manager.h" @@ -16,6 +17,17 @@ namespace mus { namespace ws { +namespace { + +base::TimeDelta GetDefaultAckTimerDelay() { +#if defined(NDEBUG) + return base::TimeDelta::FromMilliseconds(100); +#else + return base::TimeDelta::FromMilliseconds(1000); +#endif +} + +} // namespace WindowTreeHostImpl::WindowTreeHostImpl( mojom::WindowTreeHostClientPtr client, @@ -363,10 +375,11 @@ void WindowTreeHostImpl::DispatchInputEventToWindow(ServerWindow* target, connection->DispatchInputEvent(target, event.Pass()); // TOOD(sad): Adjust this delay, possibly make this dynamic. - const int kMaxEventAckDelayMs = 100; - event_ack_timer_.Start(FROM_HERE, - base::TimeDelta::FromMilliseconds(kMaxEventAckDelayMs), - this, &WindowTreeHostImpl::OnEventAckTimeout); + const base::TimeDelta max_delay = base::debug::BeingDebugged() + ? base::TimeDelta::FromDays(1) + : GetDefaultAckTimerDelay(); + event_ack_timer_.Start(FROM_HERE, max_delay, this, + &WindowTreeHostImpl::OnEventAckTimeout); } void WindowTreeHostImpl::OnWindowDestroyed(ServerWindow* window) { |