Commit 77922eb9 authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

[Code Health] Rename function to eliminate ambiguity

The function WaitForHitTestDataChange() only waits for transform change.
The best place to wait for all types of data change in hit test should
be HitTestRegionObserver::WaitForHitTestData().

Bug: None
Change-Id: I51832e0ac133e59f4e58f09f4061f8d6d45c4241
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692191Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676094}
parent 4d4971eb
......@@ -464,7 +464,7 @@ IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
SynchronizeThreads();
// Wait for hit test data to change after scroll happens.
observer.WaitForHitTestDataChange();
observer.WaitForTransformChangeInHitTestData();
// Fling and wait for the parent to scroll up.
auto input_msg_watcher = std::make_unique<InputMsgWatcher>(
......
......@@ -121,7 +121,7 @@ HitTestTransformChangeObserver::HitTestTransformChangeObserver(
HitTestTransformChangeObserver::~HitTestTransformChangeObserver() = default;
void HitTestTransformChangeObserver::WaitForHitTestDataChange() {
void HitTestTransformChangeObserver::WaitForTransformChangeInHitTestData() {
DCHECK(!run_loop_);
// If the transform has already changed then don't run RunLoop.
......
......@@ -61,22 +61,19 @@ class HitTestRegionObserver : public viz::HitTestRegionObserver {
DISALLOW_COPY_AND_ASSIGN(HitTestRegionObserver);
};
// Test API which can wait until there is a change in hit test data for a
// particular FrameSinkId. The change can be one of the following:
// 1. Change in root to target transform.
// 1. Target that wasn't hit testable became hit testable.
// 2. Target that was hit testable became not hit testable.
// Test API which can wait until there is a transform change in hit test data
// for a particular FrameSinkId. i.e. change in root to target transform.
class HitTestTransformChangeObserver : public viz::HitTestRegionObserver {
public:
explicit HitTestTransformChangeObserver(
const viz::FrameSinkId& frame_sink_id);
~HitTestTransformChangeObserver() override;
// Waits until hit testing data for |frame_sink_id_| changes. If hit test data
// for |frame_sink_id_| has already changed since it was cached then this will
// return immediately. The cached transform will be updated when this returns
// so it can be called later.
void WaitForHitTestDataChange();
// Waits until transform changes in hit testing data for |frame_sink_id_|. If
// hit test data for |frame_sink_id_| has already changed since it was cached
// then this will return immediately. The cached transform will be updated
// when this returns so it can be called later.
void WaitForTransformChangeInHitTestData();
private:
// viz::HitTestRegionObserver:
......
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