Bug 47030 - Clean up resources when LayerRenderer changes
Summary: Clean up resources when LayerRenderer changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 17:10 PDT by Victoria Kirst
Modified: 2010-10-06 08:18 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.82 KB, patch)
2010-10-01 17:14 PDT, Victoria Kirst
no flags Details | Formatted Diff | Diff
Patch (6.38 KB, patch)
2010-10-05 18:17 PDT, Victoria Kirst
jamesr: review+
jamesr: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victoria Kirst 2010-10-01 17:10:27 PDT
Clean up resources when LayerRenderer changes
Comment 1 Victoria Kirst 2010-10-01 17:14:01 PDT
Created attachment 69545 [details]
Patch
Comment 2 Vangelis Kokkevis 2010-10-05 10:18:20 PDT
Comment on attachment 69545 [details]
Patch

Looks fine although it will collide with : https://bugs.webkit.org/show_bug.cgi?id=46765   Should we merge the two into a single checkin?
Comment 3 Hin-Chung Lam 2010-10-05 10:20:30 PDT
I'd let her checkin first and I'll merge later.
Comment 4 James Robinson 2010-10-05 14:50:23 PDT
Comment on attachment 69545 [details]
Patch

This is copy-paste from ContentLayerChromium so we should move this logic up to the base class.  Specifically, add a virtual cleanupResources() function to LayerChromium and have LayerChromium::setLayerRenderer() invoke it.
Comment 5 Victoria Kirst 2010-10-05 18:17:13 PDT
Created attachment 69875 [details]
Patch
Comment 6 Victoria Kirst 2010-10-05 18:22:08 PDT
(In reply to comment #3)
> I'd let her checkin first and I'll merge later.
Alpha actually already committed his linked patch (http://trac.webkit.org/changeset/69163), so my patch here has been modified (slightly) to fit with the current code.


(In reply to comment #4)
> (From update of attachment 69545 [details])
> This is copy-paste from ContentLayerChromium so we should move this logic up to the base class.  Specifically, add a virtual cleanupResources() function to LayerChromium and have LayerChromium::setLayerRenderer() invoke it.

Thanks for the tip! I added this and updated the related files. Take another look?
Comment 7 James Robinson 2010-10-05 18:24:10 PDT
Comment on attachment 69875 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=69875&action=review

R=me.  Please kill the extra ; in the header - you can either do that while landing, or upload another patch and I'll r+/cq+

> WebCore/platform/graphics/chromium/LayerChromium.h:208
> +    virtual void cleanupResources() { };

no semicolon needed here
Comment 8 Victoria Kirst 2010-10-05 18:43:36 PDT
(In reply to comment #7)
> > WebCore/platform/graphics/chromium/LayerChromium.h:208
> > +    virtual void cleanupResources() { };
> 
> no semicolon needed here

Removed. Thanks so much for reviewing, James! Committed by Alpha here:
http://trac.webkit.org/changeset/69166
Comment 9 Vangelis Kokkevis 2010-10-06 08:18:08 PDT
Comment on attachment 69875 [details]
Patch

Sorry I'm late to this.  I like the idea of making cleanupResources a virtual.  How about calling it from the LayerChromium destructor as well instead of having to call it from each derived class destructor?