[go: nahoru, domu]

Reland "Add IsMobileOptimized calculation in blink"

This is a reland of d49bc9b76c55fe41849c0e7ac0437957b1ddda01

I believe the TapDelayEnabled test fails because it doesn't wait
for the renderer to get all information related to the mobile
viewport before checking the TapDelayEnabled counter. This approach is
similar to what was done in MobileOptimizedStatus test in the same
file.

Original change's description:
> Add IsMobileOptimized calculation in blink
>
> Right now IsMobileOptimized is computed in the compositor [1] and is not
> available on the main thread.
> This CL adds plumbing to have IsMobileOptimized be available as a method
> on LayerTreeHost which is accessible on the main thread.
>
> The approach is to mirror the computation of IsMobileOptimized
> done in LayerTreeHostImpl in LayerTreeHost.
>
> Once LayerTreeHost::IsMobileOptimized exists, we add a use counter to
> track how often the new kRemoveMobileViewportDoubleTap feature is used.
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:cc/trees/layer_tree_host_impl.cc;drc=2d2bd807c3ed39f0ab8e05bf8526c3861940c8c1;l=176
>
>      DoubleTapToZoomBrowserTest.MainThreadMobileOptimizedStatus
>
> Bug: 1203803
> Change-Id: I67be5f355781f803485f51f11c06f39ecdb053c6
> TEST: DoubleTapToZoomBrowserTest.UseCountRemoveMobileViewportDoubleTap
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3028413
> Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
> Reviewed-by: Robert Flack <flackr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#903329}

Bug: 1203803
Change-Id: Ibcc3ff13c4d385536ca8570462a637f260219d71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3039763
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#905432}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 9ecaa2a..3234a484 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -373,6 +373,8 @@
     "trees/layer_tree_settings.h",
     "trees/managed_memory_policy.cc",
     "trees/managed_memory_policy.h",
+    "trees/mobile_optimized_viewport_util.cc",
+    "trees/mobile_optimized_viewport_util.h",
     "trees/mutator_host.h",
     "trees/mutator_host_client.h",
     "trees/occlusion.cc",