Changeset 74026 in webkit
- Timestamp:
- Dec 14, 2010 7:55:24 AM (13 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r74018 r74026 1 2010-12-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] Fix several issues in r73858 6 https://bugs.webkit.org/show_bug.cgi?id=51032 7 8 - It uses both glib private data and it allocates its own private 9 structure. 10 - It calls parent's dispose method from finalize. 11 - webkit_web_plugin_get_mimetypes() uses a wrong annotation for the 12 returned value, it should be transfer none rather than transfer 13 container. 14 - Since the mime type list is internal and we return the list and not a 15 copy, it should never be freed by the caller, so 16 webkit_web_plugin_mime_type_list_free() should be removed from the 17 public API. 18 - Mime types list is used uninitialized. 19 - Mention in the docs that list returned by 20 webkit_web_plugin_database_get_plugins() must be freed with 21 webkit_web_plugin_database_plugins_list_free(). 22 23 * webkit/webkitwebplugin.cpp: 24 (webkit_web_plugin_finalize): 25 (webkit_web_plugin_class_init): 26 (webkit_web_plugin_init): 27 * webkit/webkitwebplugin.h: 28 * webkit/webkitwebplugindatabase.cpp: 29 1 30 2010-12-14 Diego Escalante Urrelo <descalante@igalia.com> 2 31 -
trunk/WebKit/gtk/webkit/webkitwebplugin.cpp
r73936 r74026 46 46 } 47 47 48 void webkit_web_plugin_mime_type_list_free(GSList* list)49 {50 for (GSList* p = list; p; p = p->next)51 freeMIMEType((WebKitWebPluginMIMEType*)p->data);52 g_slist_free(list);53 }54 55 48 static void webkit_web_plugin_finalize(GObject* object) 56 49 { 57 WebKitWebPluginPrivate* priv = WEBKIT_WEB_PLUGIN(object)->priv; 58 59 if (priv->mimeTypes) 60 webkit_web_plugin_mime_type_list_free(priv->mimeTypes); 61 62 delete WEBKIT_WEB_PLUGIN(object)->priv; 63 64 G_OBJECT_CLASS(webkit_web_plugin_parent_class)->dispose(object); 50 WebKitWebPlugin* plugin = WEBKIT_WEB_PLUGIN(object); 51 WebKitWebPluginPrivate* priv = plugin->priv; 52 53 g_slist_foreach(priv->mimeTypes, (GFunc)freeMIMEType, 0); 54 g_slist_free(priv->mimeTypes); 55 56 delete plugin->priv; 57 58 G_OBJECT_CLASS(webkit_web_plugin_parent_class)->finalize(object); 65 59 } 66 60 … … 108 102 FALSE, 109 103 WEBKIT_PARAM_READWRITE)); 110 111 g_type_class_add_private(klass, sizeof(WebKitWebPluginPrivate));112 104 } 113 105 114 106 static void webkit_web_plugin_init(WebKitWebPlugin *plugin) 115 107 { 116 WebKitWebPluginPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(plugin, WEBKIT_TYPE_WEB_PLUGIN, WebKitWebPluginPrivate);117 plugin->priv = priv = new WebKitWebPluginPrivate();108 plugin->priv = new WebKitWebPluginPrivate(); 109 plugin->priv->mimeTypes = 0; 118 110 } 119 111 … … 176 168 * at the moment. 177 169 * 178 * Returns: (transfer container) (element-type WebKitWebPluginMIMEType): a #GSList of #WebKitWebPluginMIMEType170 * Returns: (transfer none) (element-type WebKitWebPluginMIMEType): a #GSList of #WebKitWebPluginMIMEType 179 171 * 180 172 * Since: 1.3.8 -
trunk/WebKit/gtk/webkit/webkitwebplugin.h
r73936 r74026 55 55 } WebKitWebPluginMIMEType; 56 56 57 WEBKIT_API void58 webkit_web_plugin_mime_type_list_free (GSList*);59 60 57 struct _WebKitWebPluginClass { 61 58 GObjectClass parentClass; -
trunk/WebKit/gtk/webkit/webkitwebplugindatabase.cpp
r73906 r74026 77 77 * 78 78 * Returns all #WebKitWebPlugin available in @database. 79 * The returned list must be freed with webkit_web_plugin_database_plugins_list_free() 79 80 * 80 81 * Returns: (transfer full) (element-type WebKitWebPlugin): a #GSList of #WebKitWebPlugin
Note: See TracChangeset
for help on using the changeset viewer.