Commit c88cbd51 authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

Use DCHECK_IS_ON() to determine if DCHECKs are enabled in InputHandlerProxy

We use NDEBUG for the condition to enable DCHECKs related to scroll
event sequence validity, but this doesn't consider that DCHECKs could be
enabled in release builds with dcheck_always_on.

Bug: 897791
Change-Id: I8bf894b9fcfd56d5c8256bafa4d00b3e1eb37ed2
Reviewed-on: https://chromium-review.googlesource.com/c/1348253Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610473}
parent 29391ef5
...@@ -144,7 +144,7 @@ InputHandlerProxy::InputHandlerProxy(cc::InputHandler* input_handler, ...@@ -144,7 +144,7 @@ InputHandlerProxy::InputHandlerProxy(cc::InputHandler* input_handler,
input_handler_(input_handler), input_handler_(input_handler),
synchronous_input_handler_(nullptr), synchronous_input_handler_(nullptr),
allow_root_animate_(true), allow_root_animate_(true),
#ifndef NDEBUG #if DCHECK_IS_ON()
expect_scroll_update_end_(false), expect_scroll_update_end_(false),
#endif #endif
gesture_scroll_on_impl_thread_(false), gesture_scroll_on_impl_thread_(false),
...@@ -585,7 +585,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin( ...@@ -585,7 +585,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
if (compositor_event_queue_ && scroll_predictor_) if (compositor_event_queue_ && scroll_predictor_)
scroll_predictor_->ResetOnGestureScrollBegin(gesture_event); scroll_predictor_->ResetOnGestureScrollBegin(gesture_event);
#ifndef NDEBUG #if DCHECK_IS_ON()
expect_scroll_update_end_ = true; expect_scroll_update_end_ = true;
#endif #endif
cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event); cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event);
...@@ -645,7 +645,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin( ...@@ -645,7 +645,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
InputHandlerProxy::EventDisposition InputHandlerProxy::EventDisposition
InputHandlerProxy::HandleGestureScrollUpdate( InputHandlerProxy::HandleGestureScrollUpdate(
const WebGestureEvent& gesture_event) { const WebGestureEvent& gesture_event) {
#ifndef NDEBUG #if DCHECK_IS_ON()
DCHECK(expect_scroll_update_end_); DCHECK(expect_scroll_update_end_);
#endif #endif
...@@ -696,7 +696,7 @@ InputHandlerProxy::HandleGestureScrollUpdate( ...@@ -696,7 +696,7 @@ InputHandlerProxy::HandleGestureScrollUpdate(
if (snap_fling_controller_->HandleGestureScrollUpdate( if (snap_fling_controller_->HandleGestureScrollUpdate(
GetGestureScrollUpdateInfo(gesture_event))) { GetGestureScrollUpdateInfo(gesture_event))) {
#ifndef NDEBUG #if DCHECK_IS_ON()
expect_scroll_update_end_ = false; expect_scroll_update_end_ = false;
#endif #endif
gesture_scroll_on_impl_thread_ = false; gesture_scroll_on_impl_thread_ = false;
...@@ -726,7 +726,7 @@ InputHandlerProxy::HandleGestureScrollUpdate( ...@@ -726,7 +726,7 @@ InputHandlerProxy::HandleGestureScrollUpdate(
InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd( InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd(
const WebGestureEvent& gesture_event) { const WebGestureEvent& gesture_event) {
TRACE_EVENT0("input", "InputHandlerProxy::HandleGestureScrollEnd"); TRACE_EVENT0("input", "InputHandlerProxy::HandleGestureScrollEnd");
#ifndef NDEBUG #if DCHECK_IS_ON()
DCHECK(expect_scroll_update_end_); DCHECK(expect_scroll_update_end_);
expect_scroll_update_end_ = false; expect_scroll_update_end_ = false;
#endif #endif
......
...@@ -186,7 +186,7 @@ class InputHandlerProxy : public cc::InputHandlerClient, ...@@ -186,7 +186,7 @@ class InputHandlerProxy : public cc::InputHandlerClient,
SynchronousInputHandler* synchronous_input_handler_; SynchronousInputHandler* synchronous_input_handler_;
bool allow_root_animate_; bool allow_root_animate_;
#ifndef NDEBUG #if DCHECK_IS_ON()
bool expect_scroll_update_end_; bool expect_scroll_update_end_;
#endif #endif
bool gesture_scroll_on_impl_thread_; bool gesture_scroll_on_impl_thread_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment