[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
Mon Nov 22 09:24:34 PST 2010


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





--- Comment #12 from Luiz Agostini <luiz at webkit.org>  2010-11-22 09:24:34 PST ---
(From update of attachment 74555)
View in context: https://bugs.webkit.org/attachment.cgi?id=74555&action=review

I still not 100% sure that we should do this nor that we are allowed to create such incompatibility with previous implemented plugins. It would be nice to have some other opinions.
Anyway, please look at these issues.

> WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp:108
> +    return p ? qobject_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0;

If the cast fail then the object returned by createExtension() must be destroyed. As it is now the return of createExtension() is leaking when the cast fail.
It would be nice to give to user or programmer a hint of why a certain feature is not working. Maybe we should use qWarning for that.

> WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp:115
> +    return p ? qobject_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0;

The same here.

> WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp:121
> +    return p ? qobject_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0;

The same here.

> WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp:127
> +    return p ? qobject_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0;

The same here.

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