[Webkit-unassigned] [Bug 49343] Use qobject_cast instead of static_cast when using the platform plugin extensions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 11 14:10:20 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=49343





--- Comment #4 from Luiz Agostini <luiz at webkit.org>  2010-11-11 14:10:19 PST ---
(In reply to comment #3)
> It looks ok to me.
> 
> Luiz told me it was the right thing to do, but I would like him to confirm before reviewing.
> 
> NOTE that qobject_cast is slower than static_cast, and if we now the casting wont fail, the later is recommended.

The interface implemented by the root object of the plugin is declared in qwebkitplatformplugin.h and qobject_cast is used to be sure that the plugin is producing an object of the expected type. This way the version is checked for the plugin as a whole but not for each object returned by the factory QWebKitPlatformPlugin::createExtension().

I think taht we could consider that those static_casts will not fail. And I think that we should change the plugin version anyway if any of the interfaces changes.

At the end I do not see any advantage and the casts will be slower. Is this change really needed? What is the motivation for this?

-- 
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