From 061d58bc0fa016cfeed744fd3e4663460635d69b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 23 Nov 2012 15:08:59 +0100 Subject: Imported WebKit commit 8eb048315f36fa33731f28694630fe4a3c2cbc99 (http://svn.webkit.org/repository/webkit/trunk@135602) New snapshot that fixes various bugs Change-Id: Icb6ce541a26a9f500d087821ce4b83a8d8a5474a Reviewed-by: Simon Hausmann --- .../WebKit2/UIProcess/API/gtk/WebKitDownload.cpp | 27 ++++++---------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp') diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp index a6754de06..245f1a61b 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp @@ -53,6 +53,12 @@ enum { }; struct _WebKitDownloadPrivate { + ~_WebKitDownloadPrivate() + { + if (webView) + g_object_remove_weak_pointer(G_OBJECT(webView), reinterpret_cast(&webView)); + } + RefPtr download; GRefPtr request; @@ -68,16 +74,7 @@ struct _WebKitDownloadPrivate { static guint signals[LAST_SIGNAL] = { 0, }; -G_DEFINE_TYPE(WebKitDownload, webkit_download, G_TYPE_OBJECT) - -static void webkitDownloadFinalize(GObject* object) -{ - WebKitDownloadPrivate* priv = WEBKIT_DOWNLOAD(object)->priv; - if (priv->webView) - g_object_remove_weak_pointer(G_OBJECT(priv->webView), reinterpret_cast(&priv->webView)); - priv->~WebKitDownloadPrivate(); - G_OBJECT_CLASS(webkit_download_parent_class)->finalize(object); -} +WEBKIT_DEFINE_TYPE(WebKitDownload, webkit_download, G_TYPE_OBJECT) static void webkitDownloadGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec) { @@ -111,18 +108,10 @@ static gboolean webkitDownloadDecideDestination(WebKitDownload* download, const return TRUE; } -static void webkit_download_init(WebKitDownload* download) -{ - WebKitDownloadPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(download, WEBKIT_TYPE_DOWNLOAD, WebKitDownloadPrivate); - download->priv = priv; - new (priv) WebKitDownloadPrivate(); -} - static void webkit_download_class_init(WebKitDownloadClass* downloadClass) { GObjectClass* objectClass = G_OBJECT_CLASS(downloadClass); objectClass->get_property = webkitDownloadGetProperty; - objectClass->finalize = webkitDownloadFinalize; downloadClass->decide_destination = webkitDownloadDecideDestination; @@ -264,8 +253,6 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass) g_cclosure_marshal_VOID__STRING, G_TYPE_BOOLEAN, 1, G_TYPE_STRING); - - g_type_class_add_private(downloadClass, sizeof(WebKitDownloadPrivate)); } WebKitDownload* webkitDownloadCreate(DownloadProxy* downloadProxy) -- cgit v1.2.1