diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-23 15:08:59 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-23 15:09:20 +0100 |
commit | 061d58bc0fa016cfeed744fd3e4663460635d69b (patch) | |
tree | ad9b8b032c803e1c9054c23fa1b7a0f1976bf98f /Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp | |
parent | 470286ecfe79d59df14944e5b5d34630fc739391 (diff) | |
download | qtwebkit-061d58bc0fa016cfeed744fd3e4663460635d69b.tar.gz |
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 <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
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<void**>(&webView)); + } + RefPtr<DownloadProxy> download; GRefPtr<WebKitURIRequest> 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<void**>(&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) |