[Webkit-unassigned] [Bug 95188] Save original uri for downloaded files
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 1 02:39:54 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=95188
Carlos Garcia Campos <cgarcia at igalia.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #166431|commit-queue? |commit-queue-
Flag| |
--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> 2012-10-01 02:40:19 PST ---
(From update of attachment 166431)
View in context: https://bugs.webkit.org/attachment.cgi?id=166431&action=review
> Source/WebKit/gtk/webkit/webkitdownload.cpp:473
> - g_object_unref(file);
> -
> if (error) {
> webkitDownloadEmitError(download, downloadDestinationError(core(priv->networkResponse), error->message));
> g_error_free(error);
> + g_object_unref(file);
Use GRefPtr and you don't need this.
> Source/WebKit/gtk/webkit/webkitdownload.cpp:478
> + g_file_set_attribute(file, "metadata::download-uri", G_FILE_ATTRIBUTE_TYPE_STRING,
> + (gpointer)webkit_network_request_get_uri(priv->networkRequest), G_FILE_QUERY_INFO_NONE, NULL, &error);
Why not using g_file_set_attribute_string()? so that you don't need the gpointer cast nor the attribute type parameter. Use 0 instead of NULL. We typically don't use that indentation, new line should be under the ( even if the style checker complains, I think it's a bug in the style checker script.
> Source/WebKit/gtk/webkit/webkitdownload.cpp:482
> + if (error) {
> + g_warning("Couldn't set downloaded file attribute: %s\n", error->message);
> + g_error_free(error);
We could use a GOwnPtr for the error too. I'm not sure showing a warning here is useful, maybe we can just silently ignore the error, since it doesn't affect the download at all.
--
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