New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 628302 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 622847



Sign in to add a comment

Add an abstraction layer between renderer and Android View system to have a requested size

Project Member Reported by yus...@chromium.org, Jul 14 2016

Issue description

For prerendering in Android, the API allows a size to be declared beforehand. This size propagates to the renderer in a very flaky way since during initialization and later all sizing related info is always strictly routed through Java ContentViewCore which only gets sized through Android View system.

There should be an abstraction layer in between, where it is possible to have a renderer with a requested size and have that size be persisted until this View is attached to the Android View system in a smooth way.

This abstraction layer could be used for non prerender purposes that have the renderer and browser sizes being initialized independently.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c8d964d95350a8a63ed75d761ae37a36ade3e85

commit 7c8d964d95350a8a63ed75d761ae37a36ade3e85
Author: yusufo <yusufo@chromium.org>
Date: Mon Aug 22 17:41:07 2016

Use bounds instead of size for prerender requests

This changes the pipeline that initializes prerender contents
with a size to use bounds instead. Note that not all addPrerenderX
calls are switched to use Rect since for everywhere except Android
this won't be needed. Android needs bounds instead of size to get
info about the Physical Backing Size, also the top container height
(to be used for toolbar hide on scroll). With a Rect, all these can
be initialized and we can avoid extra Resizes that happen when the
native View is properly tied to the Android View hierarcy on swap.

This change only updates the params and shouldn't be making any
functional changes. A follow up Android only patch will start setting
the value to the origin.

BUG=628302

Review-Url: https://codereview.chromium.org/2259533003
Cr-Commit-Position: refs/heads/master@{#413469}

[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/android/javatests/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandlerTest.java
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/android/offline_pages/prerender_adapter_unittest.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/external_prerender_handler_android.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/external_prerender_handler_android.h
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/prerender_contents.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/prerender_contents.h
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/prerender_manager.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/prerender_manager.h
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/prerender/prerender_unittest.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/apps/chrome_app_delegate.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/browser_tabrestore.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/search/instant_search_prerenderer_unittest.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/tabs/tab_strip_model.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/web_contents_sizer.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/web_contents_sizer.h
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/web_contents_sizer.mm
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc
[modify] https://crrev.com/7c8d964d95350a8a63ed75d761ae37a36ade3e85/chrome/test/android/javatests/src/org/chromium/chrome/test/util/PrerenderTestHelper.java

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bde2d5f7208fc394099df2cc65011cd0c21f5547

commit bde2d5f7208fc394099df2cc65011cd0c21f5547
Author: yusufo <yusufo@chromium.org>
Date: Tue Aug 23 01:03:39 2016

Swap size values for bounds in Android prerenders

On https://codereview.chromium.org/2259533003/ the bounds rectangle
for Android prerenders were initialized with Android style values which
flips the size values and also declares the size wrong if the origin is
not 0,0

BUG=628302

Review-Url: https://codereview.chromium.org/2264313002
Cr-Commit-Position: refs/heads/master@{#413612}

[modify] https://crrev.com/bde2d5f7208fc394099df2cc65011cd0c21f5547/chrome/browser/prerender/external_prerender_handler_android.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa

commit 8c230b2f62cd2e5f83983047f6ba56ecc9a024aa
Author: yusufo <yusufo@chromium.org>
Date: Tue Aug 30 04:45:14 2016

Initialize RWHV with default bounds rather than only size

This starts sending bounds information from exteral prerenders
and uses that to store a default_bounds_ rectangle in RWHV Android
rather than a size. This basically updates the
default size to also take into account the top controls offset needed in the physical backing size.
With this we can get the page composited properly during prerendering.

Note that this doesn't resolve the bug yet, since we still need an
abstraction layer (possibly a NativeView) that will hold this
default_bounds_ information.

BUG=628302

Review-Url: https://codereview.chromium.org/2268323003
Cr-Commit-Position: refs/heads/master@{#415112}

[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/chrome/android/java/AndroidManifest.xml
[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java
[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/chrome/browser/ui/web_contents_sizer.cc
[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/8c230b2f62cd2e5f83983047f6ba56ecc9a024aa/content/browser/renderer_host/render_widget_host_view_android.h

Cc: flaviop@chromium.org

Sign in to add a comment