Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Issue 1408393003: Propagate pageScaleFactor to GuestViews (Closed)

Created:
5 years, 2 months ago by Kevin McNee - google account
Modified:
5 years, 1 month ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, lfg, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Propagate pageScaleFactor to GuestViews. We make all changes to pageScaleFactor available to the browser process, so that WebContentsObservers may observe them. Previously, we were only sending notifications to the browser process when the PageScaleFactorIsOne changed. Now that we're notifying whenever the pageScaleFactor changed, we get rid of this extra message and have the browser process handle the PageScaleFactorIsOne logic as part of its handling of all pageScaleFactor changes. We also replace WebContentsImpl::ResetPageScale with WebContentsImpl::SetPageScale, so that the browser process can set any pageScaleFactor. BUG=445319 Committed: https://crrev.com/432e47d6fc9b1a154900d91ad4841632160af238 Cr-Commit-Position: refs/heads/master@{#358631}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Remove ResetPageScale and move PageScaleFactorIsOneChanged into browser #

Patch Set 3 : Add tests #

Total comments: 13

Patch Set 4 : Changes from code review #

Total comments: 2

Patch Set 5 : Fix TODO #

Patch Set 6 : Remove android_webview implementation of OnPageScaleFactorChanged #

Patch Set 7 : Give OnPageScaleFactorChanged suitable behaviour upon navigation #

Total comments: 2

Patch Set 8 : Remove extra IPC message #

Total comments: 1

Patch Set 9 : Only notify when the page scale factor actually changes #

Patch Set 10 : Initialize AwLayoutSizer with initial page scale factor #

Patch Set 11 : Remove redundant initialization of AwLayoutSizer's page scale factor in tests #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -90 lines) Patch
M android_webview/browser/renderer_host/aw_render_view_host_ext.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M android_webview/browser/renderer_host/aw_render_view_host_ext.cc View 1 2 3 4 5 3 chunks +4 lines, -6 lines 0 comments Download
M android_webview/common/render_view_messages.h View 1 2 3 4 5 1 chunk +0 lines, -4 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwLayoutSizer.java View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -3 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -4 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwLayoutSizerTest.java View 1 2 3 4 5 6 7 8 9 10 14 chunks +0 lines, -14 lines 0 comments Download
M android_webview/renderer/aw_render_view_ext.h View 1 2 3 4 5 1 chunk +2 lines, -4 lines 0 comments Download
M android_webview/renderer/aw_render_view_ext.cc View 1 2 3 4 5 2 chunks +6 lines, -12 lines 0 comments Download
M chrome/browser/profiles/host_zoom_map_browsertest.cc View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
M components/guest_view/browser/guest_view_base.cc View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download
M components/ui/zoom/page_zoom.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/host_zoom_map_impl.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 2 chunks +0 lines, -15 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -1 line 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 4 chunks +25 lines, -2 lines 2 comments Download
M content/browser/web_contents/web_contents_impl_browsertest.cc View 1 2 3 4 5 6 7 8 2 chunks +55 lines, -0 lines 0 comments Download
M content/common/swapped_out_messages.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -5 lines 0 comments Download
M content/public/browser/web_contents.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M content/public/browser/web_contents_observer.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 2 chunks +1 line, -3 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 4 chunks +7 lines, -11 lines 4 comments Download

Messages

Total messages: 74 (26 generated)
Kevin McNee - google account
5 years, 2 months ago (2015-10-19 15:31:59 UTC) #3
wjmaclean
Here are some initial comments, including answers to your questions. https://codereview.chromium.org/1408393003/diff/1/content/public/browser/web_contents.h File content/public/browser/web_contents.h (right): https://codereview.chromium.org/1408393003/diff/1/content/public/browser/web_contents.h#newcode585 ...
5 years, 2 months ago (2015-10-19 15:43:29 UTC) #4
Kevin McNee - google account
https://codereview.chromium.org/1408393003/diff/1/content/public/browser/web_contents.h File content/public/browser/web_contents.h (right): https://codereview.chromium.org/1408393003/diff/1/content/public/browser/web_contents.h#newcode585 content/public/browser/web_contents.h:585: virtual void ResetPageScale() = 0; On 2015/10/19 15:43:28, wjmaclean ...
5 years, 2 months ago (2015-10-20 15:13:44 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1408393003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1408393003/20001
5 years, 2 months ago (2015-10-20 15:37:40 UTC) #9
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 2 months ago (2015-10-20 15:37:41 UTC) #11
Kevin McNee - google account
Adding Paul as reviewer.
5 years, 2 months ago (2015-10-21 14:51:00 UTC) #13
Kevin McNee - google account
Added tests: -WebContentsImplBrowserTest.ChangePageScale for verifying that WebContentsObservers are now notified of page scale changes -HostZoomMapBrowserTest.PageScaleIsOneChanged ...
5 years, 2 months ago (2015-10-21 19:26:14 UTC) #14
wjmaclean
lgtm Can you please edit the issue description to limit the linewidth to 72 chars ...
5 years, 2 months ago (2015-10-21 19:47:56 UTC) #15
Kevin McNee - google account
Adding creis@ as a reviewer. Hello there. Could you take a look at this change?
5 years, 2 months ago (2015-10-21 19:55:01 UTC) #18
Charlie Reis
[+lfg, site-isolation-reviews] Can you add a bug number to the CL description? I'm noticing some ...
5 years, 2 months ago (2015-10-21 21:37:09 UTC) #19
wjmaclean
https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc#newcode3130 content/browser/web_contents/web_contents_impl.cc:3130: static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); On 2015/10/21 21:37:09, Charlie Reis wrote: > I'm ...
5 years, 2 months ago (2015-10-22 15:03:15 UTC) #21
Fady Samuel
https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc#newcode3130 content/browser/web_contents/web_contents_impl.cc:3130: static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); On 2015/10/21 21:37:09, Charlie Reis wrote: > I'm ...
5 years, 2 months ago (2015-10-22 15:09:01 UTC) #23
wjmaclean
> > I'm not sure this needs changing for OOPIFs. > > Zoom is a ...
5 years, 2 months ago (2015-10-22 15:29:02 UTC) #24
Charlie Reis
https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc#newcode3130 content/browser/web_contents/web_contents_impl.cc:3130: static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); On 2015/10/22 15:03:14, wjmaclean wrote: > On 2015/10/21 ...
5 years, 2 months ago (2015-10-22 19:09:25 UTC) #25
wjmaclean
> > That's a different case, though. GuestViews will have a separate WebContents > from ...
5 years, 2 months ago (2015-10-22 19:27:45 UTC) #26
Kevin McNee - google account
https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1408393003/diff/40001/content/browser/web_contents/web_contents_impl.cc#newcode3130 content/browser/web_contents/web_contents_impl.cc:3130: static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); On 2015/10/22 19:09:25, Charlie Reis wrote: > On ...
5 years, 2 months ago (2015-10-22 20:28:48 UTC) #27
Charlie Reis
Thanks, LGTM with nit. You'll need an IPC owner for view_messages.h. https://codereview.chromium.org/1408393003/diff/60001/content/public/browser/host_zoom_map.h File content/public/browser/host_zoom_map.h (right): ...
5 years, 2 months ago (2015-10-22 20:53:47 UTC) #28
Kevin McNee - google account
kenrb@chromium.org: Please review changes in content/common/view_messages.h Thanks.
5 years, 2 months ago (2015-10-22 20:54:33 UTC) #30
Kevin McNee - google account
https://codereview.chromium.org/1408393003/diff/60001/content/public/browser/host_zoom_map.h File content/public/browser/host_zoom_map.h (right): https://codereview.chromium.org/1408393003/diff/60001/content/public/browser/host_zoom_map.h#newcode75 content/public/browser/host_zoom_map.h:75: // TODO(crbug.com/528407) Update this behaviour to work with OOPIF. ...
5 years, 2 months ago (2015-10-22 21:15:55 UTC) #31
kenrb
ipc lgtm
5 years, 2 months ago (2015-10-23 18:21:50 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1408393003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1408393003/80001
5 years, 2 months ago (2015-10-23 18:29:44 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg_recipe/builds/137381)
5 years, 2 months ago (2015-10-23 19:09:20 UTC) #37
Kevin McNee - google account
sgurun@chromium.org: Please review changes in android_webview/ Page scale factor changes are now available via WebContentsObserver::OnPageScaleFactorChanged, ...
5 years, 1 month ago (2015-10-26 17:36:24 UTC) #39
sgurun-gerrit only
On 2015/10/26 17:36:24, mcnee wrote: > mailto:sgurun@chromium.org: Please review changes in > > android_webview/ > ...
5 years, 1 month ago (2015-10-26 17:39:00 UTC) #41
mnaganov (inactive)
android_webview/ LGTM
5 years, 1 month ago (2015-10-26 17:52:33 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1408393003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1408393003/100001
5 years, 1 month ago (2015-10-26 18:00:06 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/86917)
5 years, 1 month ago (2015-10-26 20:07:26 UTC) #47
Kevin McNee - google account
I made a change to the behaviour of OnPageScaleFactorChanged so that notifications are sent upon ...
5 years, 1 month ago (2015-10-29 18:45:15 UTC) #49
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1408393003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1408393003/120001
5 years, 1 month ago (2015-10-30 13:28:12 UTC) #51
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-10-30 14:34:02 UTC) #53
kenrb
On 2015/10/29 18:45:15, mcnee wrote: > I made a change to the behaviour of OnPageScaleFactorChanged ...
5 years, 1 month ago (2015-10-30 17:29:10 UTC) #54
Charlie Reis
On 2015/10/30 17:29:10, kenrb wrote: > On 2015/10/29 18:45:15, mcnee wrote: > > I made ...
5 years, 1 month ago (2015-10-30 17:33:36 UTC) #55
Charlie Reis
https://codereview.chromium.org/1408393003/diff/120001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1408393003/diff/120001/content/browser/web_contents/web_contents_impl.cc#newcode2981 content/browser/web_contents/web_contents_impl.cc:2981: Send(new ViewMsg_GetPageScale(GetRoutingID())); This doesn't make sense to me. The ...
5 years, 1 month ago (2015-10-30 18:42:58 UTC) #56
Kevin McNee - google account
https://codereview.chromium.org/1408393003/diff/120001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1408393003/diff/120001/content/browser/web_contents/web_contents_impl.cc#newcode2981 content/browser/web_contents/web_contents_impl.cc:2981: Send(new ViewMsg_GetPageScale(GetRoutingID())); On 2015/10/30 18:42:58, Charlie Reis wrote: > ...
5 years, 1 month ago (2015-10-30 21:41:31 UTC) #57
Charlie Reis
Sorry, I'm still not happy with this, though it's heading in the right direction. I'm ...
5 years, 1 month ago (2015-10-30 22:29:08 UTC) #58
Kevin McNee - google account
On 2015/10/30 22:29:08, Charlie Reis (slow til 11-16) wrote: > Sorry, I'm still not happy ...
5 years, 1 month ago (2015-11-02 14:45:56 UTC) #59
Charlie Reis
On 2015/11/02 14:45:56, mcnee wrote: > On 2015/10/30 22:29:08, Charlie Reis (slow til 11-16) wrote: ...
5 years, 1 month ago (2015-11-03 00:44:31 UTC) #60
Kevin McNee - google account
> > Blink calls pageScaleFactorChanged when the page scale factor actually > changes. > > ...
5 years, 1 month ago (2015-11-05 17:00:49 UTC) #62
Charlie Reis
On 2015/11/05 17:00:49, mcnee wrote: > > > Blink calls pageScaleFactorChanged when the page scale ...
5 years, 1 month ago (2015-11-06 05:10:54 UTC) #63
Kevin McNee - google account
On 2015/10/26 17:52:33, mnaganov wrote: > android_webview/ LGTM mnaganov@, we're now only sending page scale ...
5 years, 1 month ago (2015-11-06 15:56:15 UTC) #64
mnaganov (inactive)
On 2015/11/06 15:56:15, mcnee wrote: > On 2015/10/26 17:52:33, mnaganov wrote: > > android_webview/ LGTM ...
5 years, 1 month ago (2015-11-06 20:54:35 UTC) #65
Kevin McNee - google account
> > Also, there are a bunch of calls to onPageScaleChanged in > AwLayoutSizerTest.java > ...
5 years, 1 month ago (2015-11-09 14:15:49 UTC) #66
mnaganov (inactive)
Yes, still LGTM.
5 years, 1 month ago (2015-11-09 18:15:52 UTC) #67
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1408393003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1408393003/200001
5 years, 1 month ago (2015-11-09 18:22:52 UTC) #70
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 1 month ago (2015-11-09 19:37:53 UTC) #71
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/432e47d6fc9b1a154900d91ad4841632160af238 Cr-Commit-Position: refs/heads/master@{#358631}
5 years, 1 month ago (2015-11-09 19:39:29 UTC) #72
wjmaclean
mcnee@ - I've looked this CL over to see if I can spot possible candidates ...
5 years, 1 month ago (2015-11-18 16:37:37 UTC) #73
Kevin McNee - google account
5 years, 1 month ago (2015-11-18 19:41:34 UTC) #74
Message was sent while issue was closed.
Here is the CL for the Android perf regression:
https://codereview.chromium.org/1457013002/

https://codereview.chromium.org/1408393003/diff/200001/content/browser/web_co...
File content/browser/web_contents/web_contents_impl.cc (right):

https://codereview.chromium.org/1408393003/diff/200001/content/browser/web_co...
content/browser/web_contents/web_contents_impl.cc:3157: void
WebContentsImpl::OnPageScaleFactorChanged(float page_scale_factor) {
On 2015/11/18 16:37:37, wjmaclean wrote:
> is page_scale_factor always guaranteed to be different each time this function
> is called?

We only get notifications when the page scale factor actually changes. See
blink::VisualViewport::setScaleAndLocation.

https://codereview.chromium.org/1408393003/diff/200001/content/renderer/rende...
File content/renderer/render_view_impl.cc (left):

https://codereview.chromium.org/1408393003/diff/200001/content/renderer/rende...
content/renderer/render_view_impl.cc:3388: return;
On 2015/11/18 16:37:37, wjmaclean wrote:
> Is this only meant to catch the case when the page scale factor changes from
one
> non-one value to another? Or is there the possibility that this function can
be
> called without pageScaleFactor having actually changed?

The former. Previously the browser only cared about whether the page scale
factor was one.

See previous comment about no extra calls.

https://codereview.chromium.org/1408393003/diff/200001/content/renderer/rende...
File content/renderer/render_view_impl.cc (right):

https://codereview.chromium.org/1408393003/diff/200001/content/renderer/rende...
content/renderer/render_view_impl.cc:3385: 
On 2015/11/18 16:37:37, wjmaclean wrote:
> I notice that AwRenderViewExt always checks to see if the new page scale is
> unique before sending the IPC ... should we do so here as well? Is there any
> chance this is causing unnecessary layout/drawing?

AwRenderViewExt was polling for changes to the page scale factor. Hence the need
to check that it changed.

Powered by Google App Engine
This is Rietveld 408576698