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

Issue 2940183002: cc: Move ownership of surfaces to SurfaceManager (Closed)

Created:
3 years, 6 months ago by Saman Sami
Modified:
3 years, 5 months ago
Reviewers:
danakj, Fady Samuel, fsamuel
CC:
chromium-reviews, cc-bugs_chromium.org, kylechar
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Move ownership of surfaces to SurfaceManager SurfaceManager::CreateSurface gives up the ownership of the surface it creates to CompositorFrameSinkSupport by returning a unique_ptr. CompositorFrameSinkSupport later passes back the unique_ptr to SurfaceManager::DestroySurface when it wants to destroy it. Eventually we want SurfaceManager::DestroySurface to go away and give full authority to SurfaceManager to destroy surfaces when no one is referencing them without involving CompsositorFrameSinkSupport. To this end, this CL amends CreateSurface so it returns a raw pointer and keeps the unique_ptr in SurfaceManager. BUG=733434 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2940183002 Cr-Commit-Position: refs/heads/master@{#483165} Committed: https://chromium.googlesource.com/chromium/src/+/c4d8e3bfc8190090ae22ce114d73d7313135c29c

Patch Set 1 #

Patch Set 2 : Rename UnregisterSurface #

Total comments: 4

Patch Set 3 : c #

Patch Set 4 : c #

Patch Set 5 : return weakptr #

Patch Set 6 : c #

Total comments: 8

Patch Set 7 : Remove destroyed #

Patch Set 8 : flat set #

Patch Set 9 : cleanup #

Patch Set 10 : flat map #

Patch Set 11 : fix segfault #

Patch Set 12 : Remove weakptr #

Patch Set 13 : Fix test #

Total comments: 16

Patch Set 14 : Rebase #

Patch Set 15 : c #

Total comments: 12

Patch Set 16 : Address comments #

Total comments: 27

Patch Set 17 : Addressed comments #

Patch Set 18 : Address comments #

Total comments: 1

Patch Set 19 : Add comment #

Patch Set 20 : Fix exo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -118 lines) Patch
M cc/surfaces/compositor_frame_sink_support.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +4 lines, -4 lines 0 comments Download
M cc/surfaces/compositor_frame_sink_support.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 chunks +36 lines, -34 lines 0 comments Download
M cc/surfaces/surface.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -4 lines 0 comments Download
M cc/surfaces/surface.cc View 1 2 3 4 5 6 7 8 9 10 11 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 4 chunks +13 lines, -12 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 17 18 11 chunks +41 lines, -55 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 4 chunks +11 lines, -7 lines 0 comments Download

Messages

Total messages: 120 (95 generated)
Saman Sami
3 years, 6 months ago (2017-06-15 20:52:06 UTC) #6
Saman Sami
jbauman please review cc
3 years, 6 months ago (2017-06-16 18:22:52 UTC) #22
Fady Samuel
https://codereview.chromium.org/2940183002/diff/20001/cc/surfaces/surface_manager.h File cc/surfaces/surface_manager.h (right): https://codereview.chromium.org/2940183002/diff/20001/cc/surfaces/surface_manager.h#newcode276 cc/surfaces/surface_manager.h:276: std::unordered_map<SurfaceId, std::unique_ptr<Surface>, SurfaceIdHash>; base::flat_map https://codereview.chromium.org/2940183002/diff/20001/cc/surfaces/surface_manager.h#newcode281 cc/surfaces/surface_manager.h:281: std::set<Surface*> surfaces_to_destroy_; flat_set ...
3 years, 6 months ago (2017-06-16 18:56:38 UTC) #25
kylechar
Some drive by comments. https://codereview.chromium.org/2940183002/diff/90001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/90001/cc/surfaces/compositor_frame_sink_support.cc#newcode131 cc/surfaces/compositor_frame_sink_support.cc:131: Surface* prev_surface = current_surface_.get(); This ...
3 years, 6 months ago (2017-06-16 19:13:31 UTC) #26
Saman Sami
https://codereview.chromium.org/2940183002/diff/20001/cc/surfaces/surface_manager.h File cc/surfaces/surface_manager.h (right): https://codereview.chromium.org/2940183002/diff/20001/cc/surfaces/surface_manager.h#newcode276 cc/surfaces/surface_manager.h:276: std::unordered_map<SurfaceId, std::unique_ptr<Surface>, SurfaceIdHash>; On 2017/06/16 18:56:38, Fady Samuel wrote: ...
3 years, 6 months ago (2017-06-19 22:16:46 UTC) #44
Fady Samuel
https://codereview.chromium.org/2940183002/diff/230001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/230001/cc/surfaces/compositor_frame_sink_support.cc#newcode80 cc/surfaces/compositor_frame_sink_support.cc:80: if (!GetCurrentSurface()) This is less efficient than it needs ...
3 years, 6 months ago (2017-06-20 17:29:07 UTC) #54
Saman Sami
https://codereview.chromium.org/2940183002/diff/230001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/230001/cc/surfaces/compositor_frame_sink_support.cc#newcode80 cc/surfaces/compositor_frame_sink_support.cc:80: if (!GetCurrentSurface()) On 2017/06/20 17:29:06, Fady Samuel wrote: > ...
3 years, 6 months ago (2017-06-20 22:47:10 UTC) #63
fsamuel
Yaay! LGTM, Please pass this along to jbauman@ :-)
3 years, 6 months ago (2017-06-20 22:50:05 UTC) #65
Saman Sami
jbauman please review cc
3 years, 6 months ago (2017-06-20 23:46:37 UTC) #71
Saman Sami
Seems like jbauman is OOO. danakj could you please review cc?
3 years, 6 months ago (2017-06-21 20:19:51 UTC) #75
danakj
https://codereview.chromium.org/2940183002/diff/270001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/270001/cc/surfaces/compositor_frame_sink_support.cc#newcode80 cc/surfaces/compositor_frame_sink_support.cc:80: Surface* current_surface = GetCurrentSurface(); It feels like in general ...
3 years, 6 months ago (2017-06-21 21:24:09 UTC) #76
Fady Samuel
https://codereview.chromium.org/2940183002/diff/290001/cc/surfaces/compositor_frame_sink_support.h File cc/surfaces/compositor_frame_sink_support.h (right): https://codereview.chromium.org/2940183002/diff/290001/cc/surfaces/compositor_frame_sink_support.h#newcode124 cc/surfaces/compositor_frame_sink_support.h:124: Surface* current_surface_ = nullptr; Make this a SurfaceId?
3 years, 5 months ago (2017-06-26 14:45:54 UTC) #79
Saman Sami
danakj please take another look https://codereview.chromium.org/2940183002/diff/270001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/270001/cc/surfaces/compositor_frame_sink_support.cc#newcode80 cc/surfaces/compositor_frame_sink_support.cc:80: Surface* current_surface = GetCurrentSurface(); ...
3 years, 5 months ago (2017-06-26 20:44:05 UTC) #88
Fady Samuel
https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (left): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc#oldcode348 cc/surfaces/compositor_frame_sink_support.cc:348: return surface_manager_->CreateSurface(weak_factory_.GetWeakPtr(), Would it be simpler if this was ...
3 years, 5 months ago (2017-06-26 20:46:43 UTC) #89
Saman Sami
https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc#newcode345 cc/surfaces/compositor_frame_sink_support.cc:345: Surface* CompositorFrameSinkSupport::CreateSurface( On 2017/06/26 20:46:43, Fady Samuel wrote: > ...
3 years, 5 months ago (2017-06-26 20:56:24 UTC) #90
Fady Samuel
still lgtm...please ping Dana for review?
3 years, 5 months ago (2017-06-27 16:56:31 UTC) #93
danakj
https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc#newcode82 cc/surfaces/compositor_frame_sink_support.cc:82: SurfaceId current_surface_id = current_surface_id_; give this a name that ...
3 years, 5 months ago (2017-06-27 18:21:32 UTC) #94
Saman Sami
https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc#newcode82 cc/surfaces/compositor_frame_sink_support.cc:82: SurfaceId current_surface_id = current_surface_id_; On 2017/06/27 18:21:31, danakj wrote: ...
3 years, 5 months ago (2017-06-28 14:19:44 UTC) #97
danakj
https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc#newcode133 cc/surfaces/compositor_frame_sink_support.cc:133: Surface* current_surface = On 2017/06/28 14:19:43, Saman Sami wrote: ...
3 years, 5 months ago (2017-06-28 15:59:45 UTC) #100
Saman Sami
https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/compositor_frame_sink_support.cc#newcode134 cc/surfaces/compositor_frame_sink_support.cc:134: surface_manager_->GetSurfaceForId(current_surface_id_); On 2017/06/28 15:59:45, danakj wrote: > On 2017/06/28 ...
3 years, 5 months ago (2017-06-28 18:01:00 UTC) #103
danakj
LGTM https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/surface_manager.cc File cc/surfaces/surface_manager.cc (right): https://codereview.chromium.org/2940183002/diff/330001/cc/surfaces/surface_manager.cc#newcode41 cc/surfaces/surface_manager.cc:41: SurfaceManager::~SurfaceManager() = default; On 2017/06/28 18:01:00, Saman Sami ...
3 years, 5 months ago (2017-06-28 18:16:25 UTC) #104
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/2940183002/390001
3 years, 5 months ago (2017-06-28 18:34:48 UTC) #107
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/488384)
3 years, 5 months ago (2017-06-28 19:09:36 UTC) #109
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/2940183002/410001
3 years, 5 months ago (2017-06-28 20:41:10 UTC) #117
commit-bot: I haz the power
3 years, 5 months ago (2017-06-28 22:09:51 UTC) #120
Message was sent while issue was closed.
Committed patchset #20 (id:410001) as
https://chromium.googlesource.com/chromium/src/+/c4d8e3bfc8190090ae22ce114d73...

Powered by Google App Engine
This is Rietveld 408576698