RESOLVED FIXED 137911
Const-ify static s_resourceType members in RenderSVGResource* classes
https://bugs.webkit.org/show_bug.cgi?id=137911
Summary Const-ify static s_resourceType members in RenderSVGResource* classes
Zan Dobersek
Reported 2014-10-21 00:24:51 PDT
Const-ify static s_resourceType members in RenderSVGResource* classes
Attachments
Patch (14.54 KB, patch)
2014-10-21 00:29 PDT, Zan Dobersek
no flags
Patch for landing (12.94 KB, patch)
2014-10-23 04:04 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2014-10-21 00:29:40 PDT
Andreas Kling
Comment 2 2014-10-21 13:58:30 PDT
Comment on attachment 240191 [details] Patch r=me
Zan Dobersek
Comment 3 2014-10-23 04:04:38 PDT
Created attachment 240341 [details] Patch for landing Running through the EWS once more.
Zan Dobersek
Comment 4 2014-10-23 04:06:00 PDT
Comment on attachment 240341 [details] Patch for landing Removing the r? flag since this was already reviewed.
Zan Dobersek
Comment 5 2014-10-23 05:20:41 PDT
Comment on attachment 240341 [details] Patch for landing Clearing flags on attachment: 240341 Committed r175117: <http://trac.webkit.org/changeset/175117>
Zan Dobersek
Comment 6 2014-10-23 05:20:54 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 7 2014-10-28 09:21:18 PDT
Comment on attachment 240341 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=240341&action=review > Source/WebCore/rendering/svg/RenderSVGResourceClipper.h:57 > + static const RenderSVGResourceType s_resourceType = ClipperResourceType; Is s_resourceType needed? One way to get rid of it would be to make the virtual function final, or the entire class final. Then, despite the fact that it’s virtual, calling the inline final function would be just as efficient as getting at a data member with a similar name and we could omit the data member entirely. If we didn't make the resourceType function final, then we’d want to make it private to help prevent clients from accidentally calling a virtual function to get something that’s known at compile time. I don’t think the s_ prefix is not something we should be using in WebKit. Annoys me that we were using it here.
Zan Dobersek
Comment 8 2014-11-02 05:42:16 PST
(In reply to comment #7) > Comment on attachment 240341 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=240341&action=review > > > Source/WebCore/rendering/svg/RenderSVGResourceClipper.h:57 > > + static const RenderSVGResourceType s_resourceType = ClipperResourceType; > > Is s_resourceType needed? One way to get rid of it would be to make the > virtual function final, or the entire class final. Then, despite the fact > that it’s virtual, calling the inline final function would be just as > efficient as getting at a data member with a similar name and we could omit > the data member entirely. > The s_resourceType constant is only ever referenced in this template: https://trac.webkit.org/browser/trunk/Source/WebCore/rendering/svg/RenderSVGResource.h#L70 I think it should be possible to remove these constants and this cast<>() template in favor of downcast<>(). I created bug #138290 for that.
Note You need to log in before you can comment on or make changes to this bug.