[Webkit-unassigned] [Bug 117289] Make CachedResource virtual methods overridden in derived classes private

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 6 10:29:33 PDT 2013


--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2013-06-06 10:28:07 PST ---
(In reply to comment #2)
> (From update of attachment 203926 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=203926&action=review
> Good to make functions as private as possible. But if someone does have a reason to call a function directly, then I think it’s OK to have some of these be public. But then it’s helpful to have them be FINAL so we don’t do a virtual function dispatch for no good reason.
> But why no FINAL?

You mean making all of them FINAL or just the public ones? because the private ones will always do a a virtual function dispatch.

> > Source/WebCore/html/ImageDocument.cpp:137
> > -    CachedImage* cachedImage = document()->cachedImage();
> > +    CachedResource* cachedImage = document()->cachedImage();
> This change isn’t good even though it allows us to make overrides private. I suggest leaving the overrides public instead if they are called like this, but marking either the function or the class or both FINAL if they are never overridden further. That way we get a non-virtual function call, slightly more efficient.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list