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

Issue 2880023002: cc::SurfaceDependencyTracker should not crash when a Display goes away (Closed)

Created:
3 years, 7 months ago by Fady Samuel
Modified:
3 years, 6 months ago
Reviewers:
vmpstr, enne (OOO)
CC:
Aaron Boodman, abarth-chromium, cc-bugs_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

cc::SurfaceDependencyTracker should not crash when a Display goes away Previously, SurfaceDependencyTracker was a BeginFrameObserver that directly observed BeginFrames from the first display. This is a problem if the first display goes away. This CL solves this problem by making SurfaceDependencyTracker observe an independent "PrimaryBeginFrameSource" instead. MojoFrameSinkManager owns SurfaceDependencyTracker and the PrimaryBeginFrameSource. When SurfaceDependencyTracker needs BeginFrames, that request goes to PrimaryBeginFrameSource which then adds itself as a BeginFrameObserver to the primary BeginFrameSource. When the primary BeginFrameSource goes away, PrimaryBeginFrameSource removes itself as an observer and, if necessary, adds itself as an observer arbitrarily to another BeginFrameSource. Future BeginFrames get forwarded from the PrimaryBeginFrameSource to SurfaceDependencyTracker. BUG=672962 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2880023002 Cr-Original-Commit-Position: refs/heads/master@{#474539} Committed: https://chromium.googlesource.com/chromium/src/+/b520968f4ac40fb89ce25329134b388ca42cca12 Review-Url: https://codereview.chromium.org/2880023002 Cr-Commit-Position: refs/heads/master@{#474783} Committed: https://chromium.googlesource.com/chromium/src/+/d71466ad118aca05aa347c9766f80a5f77528588

Patch Set 1 #

Patch Set 2 : Updated #

Patch Set 3 : Remove unnecessary change #

Patch Set 4 : Added an extra comment #

Patch Set 5 : Fix antoher issue #

Patch Set 6 : Cleanup #

Patch Set 7 : Remove stuff #

Patch Set 8 : Updated #

Patch Set 9 : Use PrimaryBeginFrameSource #

Patch Set 10 : Added unit test #

Patch Set 11 : Fixed unit tests #

Patch Set 12 : Fix erase in SurfaceDependencyTracker #

Patch Set 13 : The right fix #

Patch Set 14 : Remove unnecessary change #

Patch Set 15 : StrictMock => NiceMock #

Total comments: 6

Patch Set 16 : Addressed Enne's comments #

Patch Set 17 : Fixed flake #

Patch Set 18 : Fixed typo #

Patch Set 19 : Fix LayerTreeHostImpl unit tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -55 lines) Patch
M cc/layers/surface_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/surface_layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +6 lines, -1 line 0 comments Download
M cc/scheduler/begin_frame_source_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +8 lines, -8 lines 0 comments Download
M cc/surfaces/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M cc/surfaces/frame_sink_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +9 lines, -2 lines 0 comments Download
M cc/surfaces/frame_sink_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +12 lines, -4 lines 0 comments Download
A cc/surfaces/primary_begin_frame_source.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +56 lines, -0 lines 0 comments Download
A cc/surfaces/primary_begin_frame_source.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +87 lines, -0 lines 0 comments Download
M cc/surfaces/surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +5 lines, -2 lines 0 comments Download
M cc/surfaces/surface_dependency_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -2 lines 0 comments Download
M cc/surfaces/surface_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +7 lines, -6 lines 0 comments Download
M cc/surfaces/surface_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -2 lines 0 comments Download
M cc/surfaces/surface_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +61 lines, -0 lines 0 comments Download
M cc/surfaces/surface_synchronization_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +6 lines, -3 lines 0 comments Download
M cc/test/begin_frame_source_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +23 lines, -11 lines 0 comments Download
M components/viz/frame_sinks/mojo_frame_sink_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M components/viz/frame_sinks/mojo_frame_sink_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +5 lines, -10 lines 0 comments Download

Messages

Total messages: 82 (62 generated)
Fady Samuel
+jbauman@ for review. PTAL
3 years, 7 months ago (2017-05-12 21:19:51 UTC) #3
Fady Samuel
PTAL Vlad!
3 years, 7 months ago (2017-05-15 18:54:02 UTC) #11
Fady Samuel
+enne@ for viz changes.
3 years, 7 months ago (2017-05-15 22:13:00 UTC) #19
enne (OOO)
Is there a test that covers this behavior of removing primary root frame sink ids ...
3 years, 7 months ago (2017-05-15 22:23:41 UTC) #21
Fady Samuel
PTAL Enne! I've moved the functionality from MojoFrameSinkManager to a "PrimaryBeginFrameSource" that is easily unit ...
3 years, 7 months ago (2017-05-23 23:40:28 UTC) #27
Fady Samuel
PTAL Enne! I've moved the functionality from MojoFrameSinkManager to a "PrimaryBeginFrameSource" that is easily unit ...
3 years, 7 months ago (2017-05-23 23:40:29 UTC) #28
enne (OOO)
https://codereview.chromium.org/2880023002/diff/280001/cc/surfaces/primary_begin_frame_source.h File cc/surfaces/primary_begin_frame_source.h (right): https://codereview.chromium.org/2880023002/diff/280001/cc/surfaces/primary_begin_frame_source.h#newcode44 cc/surfaces/primary_begin_frame_source.h:44: void OnBeginFrameSourceAdded(BeginFrameSource* begin_frame_source) override; This is a tiny design ...
3 years, 7 months ago (2017-05-24 17:55:17 UTC) #52
Fady Samuel
PTAL Enne! Thanks! https://codereview.chromium.org/2880023002/diff/280001/cc/surfaces/primary_begin_frame_source.h File cc/surfaces/primary_begin_frame_source.h (right): https://codereview.chromium.org/2880023002/diff/280001/cc/surfaces/primary_begin_frame_source.h#newcode44 cc/surfaces/primary_begin_frame_source.h:44: void OnBeginFrameSourceAdded(BeginFrameSource* begin_frame_source) override; On 2017/05/24 ...
3 years, 7 months ago (2017-05-24 18:36:52 UTC) #53
enne (OOO)
Thanks, that's a lot simpler to my eyes. :) lgtm
3 years, 7 months ago (2017-05-24 18:46:08 UTC) #56
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/2880023002/300001
3 years, 7 months ago (2017-05-24 23:08:40 UTC) #60
commit-bot: I haz the power
Committed patchset #16 (id:300001) as https://chromium.googlesource.com/chromium/src/+/b520968f4ac40fb89ce25329134b388ca42cca12
3 years, 7 months ago (2017-05-25 03:11:08 UTC) #63
Ken Rockot(use gerrit already)
A revert of this CL (patchset #16 id:300001) has been created in https://codereview.chromium.org/2908473002/ by rockot@chromium.org. ...
3 years, 7 months ago (2017-05-25 15:01:32 UTC) #64
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/2880023002/320001
3 years, 7 months ago (2017-05-25 15:33:04 UTC) #68
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/2880023002/340001
3 years, 7 months ago (2017-05-25 15:42:19 UTC) #71
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/186572)
3 years, 7 months ago (2017-05-25 16:25:38 UTC) #73
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/2880023002/360001
3 years, 7 months ago (2017-05-25 18:54:07 UTC) #76
Fady Samuel
On 2017/05/25 16:25:38, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 7 months ago (2017-05-25 18:55:26 UTC) #77
Fady Samuel
On 2017/05/25 16:25:38, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 7 months ago (2017-05-25 18:55:27 UTC) #78
Fady Samuel
On 2017/05/25 16:25:38, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 7 months ago (2017-05-25 18:55:28 UTC) #79
commit-bot: I haz the power
3 years, 7 months ago (2017-05-25 20:36:01 UTC) #82
Message was sent while issue was closed.
Committed patchset #19 (id:360001) as
https://chromium.googlesource.com/chromium/src/+/d71466ad118aca05aa347c9766f8...

Powered by Google App Engine
This is Rietveld 408576698