[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
Sun Nov 21 20:38:05 PST 2010


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





--- Comment #7 from Luiz Agostini <luiz at webkit.org>  2010-11-21 20:38:05 PST ---
(From update of attachment 73540)
View in context: https://bugs.webkit.org/attachment.cgi?id=73540&action=review

I think that it may make sense. Platform plugin provides many features and the number of features will probably increase in near future. Then it would probably be nice if, after changing one of the interfaces, QtWebKit could still use the unchanged features of the older plugins. For it we need to have version information of each interface.

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

This cast may fail if the plugin implements an older version of the interface. In this case the object returned by createExtension(), if any, should be destroyed.

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

The same here.

> WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp:113
> +    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