WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
130636
Add *final* keyword to NavigatorContentUtils class
https://bugs.webkit.org/show_bug.cgi?id=130636
Summary
Add *final* keyword to NavigatorContentUtils class
Gyuyoung Kim
Reported
2014-03-22 00:43:24 PDT
Though NavigatorContentUtils isn't declared final class as well as it doesn't have any virtual function, the destructor has been declared as virtual. We don't need to declare the destructor as virtual.
Attachments
Patch
(1.78 KB, patch)
2014-03-22 00:45 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(1.50 KB, patch)
2014-03-22 08:38 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Gyuyoung Kim
Comment 1
2014-03-22 00:45:47 PDT
Created
attachment 227538
[details]
Patch
Chris Dumez
Comment 2
2014-03-22 05:52:32 PDT
Comment on
attachment 227538
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227538&action=review
> Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h:46 > + ~NavigatorContentUtils();
The destructor *is* virtual as RefCountedSupplement has a virtual destructor. I don't think it is a good idea to remove virtual here as it makes it less obvious the destructor really is virtual.
Gyuyoung Kim
Comment 3
2014-03-22 06:23:03 PDT
(In reply to
comment #2
)
> (From update of
attachment 227538
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=227538&action=review
> > > Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h:46 > > + ~NavigatorContentUtils(); > > The destructor *is* virtual as RefCountedSupplement has a virtual destructor. I don't think it is a good idea to remove virtual here as it makes it less obvious the destructor really is virtual.
I see. Do you think *final* keyword is not good as well ? I think NavigatorContentUtils won't become a parent class.
Chris Dumez
Comment 4
2014-03-22 06:44:35 PDT
Comment on
attachment 227538
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227538&action=review
>>> Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h:46 >>> + ~NavigatorContentUtils(); >> >> The destructor *is* virtual as RefCountedSupplement has a virtual destructor. I don't think it is a good idea to remove virtual here as it makes it less obvious the destructor really is virtual. > > I see. Do you think *final* keyword is not good as well ? I think NavigatorContentUtils won't become a parent class.
No, the final seems fine to me but I am not aware of the WebKit policy when it comes to final keyword.
Darin Adler
Comment 5
2014-03-22 07:52:24 PDT
Comment on
attachment 227538
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227538&action=review
>>>> Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h:46 >>>> + ~NavigatorContentUtils(); >>> >>> The destructor *is* virtual as RefCountedSupplement has a virtual destructor. I don't think it is a good idea to remove virtual here as it makes it less obvious the destructor really is virtual. >> >> I see. Do you think *final* keyword is not good as well ? I think NavigatorContentUtils won't become a parent class. > > No, the final seems fine to me but I am not aware of the WebKit policy when it comes to final keyword.
Yes, it’s fine to add final here and it’s wrong to remove virtual. In fact, I would approve patches adding virtual to destructors in cases like this. I don’t think there’s any benefit to adding final here, but it’s correct and not harmful.
Gyuyoung Kim
Comment 6
2014-03-22 08:38:40 PDT
Created
attachment 227551
[details]
Patch
Gyuyoung Kim
Comment 7
2014-03-22 08:41:25 PDT
I missed to virtual dtor in RefCountedSupplement. Sorry about it. Though it it not big benefit to add *final*, I also think it is correct. So, I update the patch again.
WebKit Commit Bot
Comment 8
2014-03-22 18:02:17 PDT
Comment on
attachment 227551
[details]
Patch Clearing flags on attachment: 227551 Committed
r166130
: <
http://trac.webkit.org/changeset/166130
>
WebKit Commit Bot
Comment 9
2014-03-22 18:02:23 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug