Bug 183326 - CoordinatedGraphicsScene: properly limit data specific to state commit operation
Summary: CoordinatedGraphicsScene: properly limit data specific to state commit operation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-05 02:41 PST by Zan Dobersek
Modified: 2018-03-06 04:13 PST (History)
3 users (show)

See Also:


Attachments
Patch (16.97 KB, patch)
2018-03-05 02:47 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2018-03-05 02:41:13 PST
CoordinatedGraphicsScene: properly limit data specific to state commit operation
Comment 1 Zan Dobersek 2018-03-05 02:47:28 PST
Created attachment 334993 [details]
Patch
Comment 2 Sergio Villar Senin 2018-03-06 01:05:44 PST
Comment on attachment 334993 [details]
Patch

Why not using a RAII approach? CommitScope could be a class and the cleanups could be done in the destructor which would be called once the variable gets out of scope.
Comment 3 Zan Dobersek 2018-03-06 03:32:24 PST
(In reply to Sergio Villar Senin from comment #2)
> Comment on attachment 334993 [details]
> Patch
> 
> Why not using a RAII approach? CommitScope could be a class and the cleanups
> could be done in the destructor which would be called once the variable gets
> out of scope.

Structs are same as classes, just the default member accessibility is public.

As such, the default destructor ivokes destructors of both containers, effectively cleaning up every object that's been stored there during the state commit op.
Comment 4 Zan Dobersek 2018-03-06 03:34:22 PST
Comment on attachment 334993 [details]
Patch

Clearing flags on attachment: 334993

Committed r229315: <https://trac.webkit.org/changeset/229315>
Comment 5 Zan Dobersek 2018-03-06 03:34:26 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-03-06 03:35:31 PST
<rdar://problem/38174962>
Comment 7 Sergio Villar Senin 2018-03-06 03:42:38 PST
(In reply to Zan Dobersek from comment #3)
> (In reply to Sergio Villar Senin from comment #2)
> > Comment on attachment 334993 [details]
> > Patch
> > 
> > Why not using a RAII approach? CommitScope could be a class and the cleanups
> > could be done in the destructor which would be called once the variable gets
> > out of scope.
> 
> Structs are same as classes, just the default member accessibility is public.
> 
> As such, the default destructor ivokes destructors of both containers,
> effectively cleaning up every object that's been stored there during the
> state commit op.

Not sure if you're getting my point, what I wanted is to get rid of the explicit .clear()
Comment 8 Zan Dobersek 2018-03-06 04:13:07 PST
(In reply to Sergio Villar Senin from comment #7)
> (In reply to Zan Dobersek from comment #3)
> > (In reply to Sergio Villar Senin from comment #2)
> > > Comment on attachment 334993 [details]
> > > Patch
> > > 
> > > Why not using a RAII approach? CommitScope could be a class and the cleanups
> > > could be done in the destructor which would be called once the variable gets
> > > out of scope.
> > 
> > Structs are same as classes, just the default member accessibility is public.
> > 
> > As such, the default destructor ivokes destructors of both containers,
> > effectively cleaning up every object that's been stored there during the
> > state commit op.
> 
> Not sure if you're getting my point, what I wanted is to get rid of the
> explicit .clear()

Right, it's not necessary for those to be explicitly called, I'll remove them.