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

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)

Created:
3 years, 10 months ago by kenrb
Modified:
3 years, 9 months ago
CC:
Aaron Boodman, abarth-chromium, cc-bugs_chromium.org, chromium-reviews, creis+watch_chromium.org, darin (slow to review), darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, piman+watch_chromium.org, qsr+mojo_chromium.org, site-isolation-reviews_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Discard compositor frames from unloaded web content After a navigation commits, it is still possible for the compositor to resend a frame that draws the previous (now unloaded) page. In some situations this works against the browser process' new content rendering timer that attempts to clear a page after 4 seconds if a navigation has committed but not yet painted in that time. This CL adds a counter called content_source_id to that increments on every non-same-page navigation commit under a given top-level RenderWidget. It tags the CompositorFrameMetadata with this identifier, and also sends it to the browser process with the DidCommitProvisionaLoad IPC message. This enables the browser to recognize compositor frames with stale IDs, corresponding to unloaded pages. BUG=672847 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2707243005 Cr-Commit-Position: refs/heads/master@{#454578} Committed: https://chromium.googlesource.com/chromium/src/+/efd1189a0b3febada2bceb4c037fff1718306a3a

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Fixed test compile failure #

Patch Set 4 : Improved comments #

Total comments: 5

Patch Set 5 : Small changes for review comments #

Total comments: 2

Patch Set 6 : Review comment addressed #

Total comments: 6

Patch Set 7 : Added tests #

Patch Set 8 : Comments updated #

Total comments: 4

Patch Set 9 : Added another check to unit test #

Patch Set 10 : Another comment tweak #

Patch Set 11 : Rebase #

Patch Set 12 : Add default value for source ID in frame metadata #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -8 lines) Patch
M cc/ipc/cc_param_traits_macros.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/compositor_frame_metadata.mojom View 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/compositor_frame_metadata_struct_traits.h View 1 chunk +5 lines, -0 lines 0 comments Download
M cc/ipc/compositor_frame_metadata_struct_traits.cc View 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/struct_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -0 lines 0 comments Download
M cc/output/compositor_frame_metadata.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +27 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +36 lines, -3 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 5 6 7 2 chunks +16 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -0 lines 0 comments Download
M content/test/test_render_view_host.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 67 (42 generated)
kenrb
danakj: Can you please give this a first review, as a cc/ OWNER? This is ...
3 years, 10 months ago (2017-02-23 20:19:41 UTC) #19
kenrb
enne can you do this review instead? Let me know if you need any more ...
3 years, 9 months ago (2017-02-28 16:29:57 UTC) #23
enne (OOO)
On 2017/02/28 at 16:29:57, kenrb wrote: > enne can you do this review instead? Let ...
3 years, 9 months ago (2017-02-28 18:27:09 UTC) #24
enne (OOO)
This all makes a lot of sense. I have a few small questions, but seems ...
3 years, 9 months ago (2017-02-28 19:02:23 UTC) #25
kenrb
Thanks for the review! https://codereview.chromium.org/2707243005/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2707243005/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc#newcode1016 content/browser/renderer_host/render_widget_host_impl.cc:1016: // current_content_source_id_ should be non-decreasing, ...
3 years, 9 months ago (2017-02-28 22:18:44 UTC) #26
enne (OOO)
https://codereview.chromium.org/2707243005/diff/80001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2707243005/diff/80001/content/browser/renderer_host/render_widget_host_impl.cc#newcode1855 content/browser/renderer_host/render_widget_host_impl.cc:1855: // Ignore this frame if its content has already ...
3 years, 9 months ago (2017-02-28 22:23:21 UTC) #27
kenrb
https://codereview.chromium.org/2707243005/diff/80001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2707243005/diff/80001/content/browser/renderer_host/render_widget_host_impl.cc#newcode1855 content/browser/renderer_host/render_widget_host_impl.cc:1855: // Ignore this frame if its content has already ...
3 years, 9 months ago (2017-03-01 15:32:48 UTC) #29
enne (OOO)
lgtm, thanks
3 years, 9 months ago (2017-03-01 17:49:00 UTC) #33
kenrb
creis@: PTAL content/?
3 years, 9 months ago (2017-03-01 18:02:03 UTC) #35
danakj
LG to me also, but noticing a conspicuous lack of unit tests. https://codereview.chromium.org/2707243005/diff/100001/content/browser/renderer_host/render_widget_host_impl.h File content/browser/renderer_host/render_widget_host_impl.h ...
3 years, 9 months ago (2017-03-01 18:14:28 UTC) #37
Charlie Reis
+1 to the test request, but otherwise this looks generally good. Can you confirm my ...
3 years, 9 months ago (2017-03-01 20:13:29 UTC) #38
kenrb
Thanks for the reviews. I have updated comments as requested and added two unit tests: ...
3 years, 9 months ago (2017-03-02 17:08:18 UTC) #41
danakj
https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc File content/browser/renderer_host/render_widget_host_unittest.cc (right): https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc#newcode1300 content/browser/renderer_host/render_widget_host_unittest.cc:1300: frame.metadata.content_source_id = 100; The code also accepts source id ...
3 years, 9 months ago (2017-03-02 18:12:50 UTC) #42
Charlie Reis
Thanks! LGTM with danakj's suggestion in the test.
3 years, 9 months ago (2017-03-02 18:32:13 UTC) #43
kenrb
https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc File content/browser/renderer_host/render_widget_host_unittest.cc (right): https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc#newcode1300 content/browser/renderer_host/render_widget_host_unittest.cc:1300: frame.metadata.content_source_id = 100; On 2017/03/02 18:12:50, danakj wrote: > ...
3 years, 9 months ago (2017-03-02 19:35:57 UTC) #46
danakj
LGTM https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc File content/browser/renderer_host/render_widget_host_unittest.cc (right): https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc#newcode1300 content/browser/renderer_host/render_widget_host_unittest.cc:1300: frame.metadata.content_source_id = 100; On 2017/03/02 19:35:57, kenrb wrote: ...
3 years, 9 months ago (2017-03-02 19:56:34 UTC) #47
danakj
On 2017/03/02 19:56:34, danakj wrote: > LGTM > > https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc > File content/browser/renderer_host/render_widget_host_unittest.cc (right): > ...
3 years, 9 months ago (2017-03-02 19:57:20 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2707243005/180001
3 years, 9 months ago (2017-03-02 21:19:24 UTC) #52
kenrb
Thanks for the reviews! https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc File content/browser/renderer_host/render_widget_host_unittest.cc (right): https://codereview.chromium.org/2707243005/diff/140001/content/browser/renderer_host/render_widget_host_unittest.cc#newcode1300 content/browser/renderer_host/render_widget_host_unittest.cc:1300: frame.metadata.content_source_id = 100; On 2017/03/02 ...
3 years, 9 months ago (2017-03-02 21:19:51 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: linux_site_isolation on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_site_isolation/builds/6441)
3 years, 9 months ago (2017-03-02 23:33:15 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2707243005/180001
3 years, 9 months ago (2017-03-02 23:37:40 UTC) #57
commit-bot: I haz the power
Failed to apply patch for cc/ipc/cc_param_traits_macros.h: While running git apply --index -p1; error: patch failed: ...
3 years, 9 months ago (2017-03-03 02:11:14 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2707243005/200001
3 years, 9 months ago (2017-03-03 13:53:47 UTC) #62
commit-bot: I haz the power
Committed patchset #11 (id:200001) as https://chromium.googlesource.com/chromium/src/+/efd1189a0b3febada2bceb4c037fff1718306a3a
3 years, 9 months ago (2017-03-03 14:44:58 UTC) #65
sclittle
3 years, 9 months ago (2017-03-04 00:54:48 UTC) #66
Message was sent while issue was closed.
A revert of this CL (patchset #11 id:200001) has been created in
https://codereview.chromium.org/2730203002/ by sclittle@chromium.org.

The reason for reverting is: It looks like this broke the MSAN bot:

https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linu...

https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linu....

Powered by Google App Engine
This is Rietveld 408576698