Bug 72258

Summary: [GTK] Implement download support in WebKit2
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: pnormand
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch mrobinson: review+

Description Carlos Garcia Campos 2011-11-14 05:03:35 PST
It's currently unimplemented in WebProcess.
Comment 1 Carlos Garcia Campos 2011-11-14 05:09:02 PST
Created attachment 114921 [details]
Patch
Comment 2 Martin Robinson 2011-11-14 10:17:29 PST
Comment on attachment 114921 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=114921&action=review

Looks good, but I'm not sure the changes in Source/WebKit/gtk/webkit/webkitdownload.cpp are necessary...

> Source/WebKit/gtk/webkit/webkitdownload.cpp:476
> +        webkitDownloadEmitError(download, downloadDestinationError(core(priv->networkResponse), error->message));

It It seems like this code is just using the ResourceError to carry the message and the error code to webkitDownloadEmitError. Why not just pass the error code and the message directly?
Comment 3 Carlos Garcia Campos 2011-11-14 23:50:12 PST
(In reply to comment #2)
> (From update of attachment 114921 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=114921&action=review
> 
> Looks good, but I'm not sure the changes in Source/WebKit/gtk/webkit/webkitdownload.cpp are necessary...

No, they are not necessary, but since I moved the download errors to WebCore, I think wk1 should use them, so that we avoid having the same translatable strings in two different places.

> > Source/WebKit/gtk/webkit/webkitdownload.cpp:476
> > +        webkitDownloadEmitError(download, downloadDestinationError(core(priv->networkResponse), error->message));
> 
> It It seems like this code is just using the ResourceError to carry the message and the error code to webkitDownloadEmitError. Why not just pass the error code and the message directly?

In this case it would be possible, because DestinationError is built with the message, but for other errors we need the ResourceError to get the message from it, for example:

webkitDownloadEmitError(download, downloadCancelledByUserError(core(priv->networkResponse)));
Comment 4 Carlos Garcia Campos 2011-11-15 08:25:14 PST
Committed r100284: <http://trac.webkit.org/changeset/100284>