Commit c01b897f authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

[CodeHealth] Remove QueryClientInternal in RenderWidgetTargeter

QueryClientInternal was introduced to distinguish v1 and v2 query paths.
It's no longer needed.

Bug: 1029012
Change-Id: Ie7682848335b98a7a54052372b4509fda6cb1dfe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1950707Reviewed-by: default avatarJonathan Ross <jonross@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721616}
parent 9a64914c
...@@ -230,18 +230,21 @@ void RenderWidgetTargeter::ResolveTargetingRequest(TargetingRequest request) { ...@@ -230,18 +230,21 @@ void RenderWidgetTargeter::ResolveTargetingRequest(TargetingRequest request) {
} }
RenderWidgetTargetResult result; RenderWidgetTargetResult result;
auto* request_target = request.GetRootView();
auto request_target_location = request.GetLocation();
if (request.IsWebInputEventRequest()) { if (request.IsWebInputEventRequest()) {
result = is_autoscroll_in_progress_ result = is_autoscroll_in_progress_
? middle_click_result_ ? middle_click_result_
: delegate_->FindTargetSynchronously(request.GetRootView(), : delegate_->FindTargetSynchronously(request_target,
request.GetEvent()); request.GetEvent());
if (!is_autoscroll_in_progress_ && IsMouseMiddleClick(request.GetEvent())) { if (!is_autoscroll_in_progress_ && IsMouseMiddleClick(request.GetEvent())) {
if (!result.should_query_view) if (!result.should_query_view)
middle_click_result_ = result; middle_click_result_ = result;
} }
} else { } else {
result = delegate_->FindTargetSynchronouslyAtPoint(request.GetRootView(), result = delegate_->FindTargetSynchronouslyAtPoint(request_target,
request.GetLocation()); request_target_location);
} }
RenderWidgetHostViewBase* target = result.view; RenderWidgetHostViewBase* target = result.view;
async_depth_ = 0; async_depth_ = 0;
...@@ -259,7 +262,8 @@ void RenderWidgetTargeter::ResolveTargetingRequest(TargetingRequest request) { ...@@ -259,7 +262,8 @@ void RenderWidgetTargeter::ResolveTargetingRequest(TargetingRequest request) {
// root_view and the original event location for the initial query. // root_view and the original event location for the initial query.
// Do not compare hit test results if we are forced to do async hit testing // Do not compare hit test results if we are forced to do async hit testing
// by HitTestQuery. // by HitTestQuery.
QueryClient(std::move(request)); QueryClient(request_target, request_target_location, nullptr, gfx::PointF(),
std::move(request));
} else { } else {
FoundTarget(target, result.target_location, result.latched_target, FoundTarget(target, result.target_location, result.latched_target,
&request); &request);
...@@ -287,7 +291,7 @@ void RenderWidgetTargeter::SetIsAutoScrollInProgress( ...@@ -287,7 +291,7 @@ void RenderWidgetTargeter::SetIsAutoScrollInProgress(
middle_click_result_ = RenderWidgetTargetResult(); middle_click_result_ = RenderWidgetTargetResult();
} }
void RenderWidgetTargeter::QueryClientInternal( void RenderWidgetTargeter::QueryClient(
RenderWidgetHostViewBase* target, RenderWidgetHostViewBase* target,
const gfx::PointF& target_location, const gfx::PointF& target_location,
RenderWidgetHostViewBase* last_request_target, RenderWidgetHostViewBase* last_request_target,
...@@ -302,8 +306,8 @@ void RenderWidgetTargeter::QueryClientInternal( ...@@ -302,8 +306,8 @@ void RenderWidgetTargeter::QueryClientInternal(
return; return;
} }
request_in_flight_ = std::move(request); request_in_flight_ = std::move(request);
async_depth_++; async_depth_++;
TracingUmaTracker tracker("Event.AsyncTargeting.ResponseTime"); TracingUmaTracker tracker("Event.AsyncTargeting.ResponseTime");
async_hit_test_timeout_.reset(new OneShotTimeoutMonitor( async_hit_test_timeout_.reset(new OneShotTimeoutMonitor(
...@@ -326,13 +330,6 @@ void RenderWidgetTargeter::QueryClientInternal( ...@@ -326,13 +330,6 @@ void RenderWidgetTargeter::QueryClientInternal(
++last_request_id_, target_location, std::move(tracker))); ++last_request_id_, target_location, std::move(tracker)));
} }
void RenderWidgetTargeter::QueryClient(TargetingRequest request) {
auto* target = request.GetRootView();
auto target_location = request.GetLocation();
QueryClientInternal(target, target_location, nullptr, gfx::PointF(),
std::move(request));
}
void RenderWidgetTargeter::FlushEventQueue() { void RenderWidgetTargeter::FlushEventQueue() {
bool events_being_flushed = false; bool events_being_flushed = false;
while (!request_in_flight_ && !requests_.empty()) { while (!request_in_flight_ && !requests_.empty()) {
...@@ -408,8 +405,8 @@ void RenderWidgetTargeter::FoundFrameSinkId( ...@@ -408,8 +405,8 @@ void RenderWidgetTargeter::FoundFrameSinkId(
FoundTarget(view, transformed_location, false, &request); FoundTarget(view, transformed_location, false, &request);
} else { } else {
QueryClientInternal(view, transformed_location, target.get(), QueryClient(view, transformed_location, target.get(), target_location,
target_location, std::move(request)); std::move(request));
} }
} }
......
...@@ -188,13 +188,11 @@ class RenderWidgetTargeter { ...@@ -188,13 +188,11 @@ class RenderWidgetTargeter {
// |last_request_target| and |last_target_location| provide a fallback target // |last_request_target| and |last_target_location| provide a fallback target
// in the case that the query times out. These should be null values when // in the case that the query times out. These should be null values when
// querying the root view, and the target's immediate parent view otherwise. // querying the root view, and the target's immediate parent view otherwise.
void QueryClientInternal(RenderWidgetHostViewBase* target, void QueryClient(RenderWidgetHostViewBase* target,
const gfx::PointF& target_location, const gfx::PointF& target_location,
RenderWidgetHostViewBase* last_request_target, RenderWidgetHostViewBase* last_request_target,
const gfx::PointF& last_target_location, const gfx::PointF& last_target_location,
TargetingRequest request); TargetingRequest request);
void QueryClient(TargetingRequest request);
// |target_location|, if // |target_location|, if
// set, is the location in |target|'s coordinate space. // set, is the location in |target|'s coordinate space.
......
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