After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678612 - Port downloads to WebKit2
Port downloads to WebKit2
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks: 678610
 
 
Reported: 2012-06-22 09:05 UTC by Carlos Garcia Campos
Modified: 2012-06-27 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pass suggested filename to define_destination_uri() (1.80 KB, patch)
2012-06-22 09:05 UTC, Carlos Garcia Campos
committed Details | Review
remove _ephy_download_new() internal function (3.48 KB, patch)
2012-06-22 09:05 UTC, Carlos Garcia Campos
committed Details | Review
add ephy_download_widget_download_finished() (6.76 KB, patch)
2012-06-22 09:06 UTC, Carlos Garcia Campos
committed Details | Review
add get_destination_basename_from_download() helper function (2.62 KB, patch)
2012-06-22 09:06 UTC, Carlos Garcia Campos
reviewed Details | Review
Patch (23.08 KB, patch)
2012-06-22 09:06 UTC, Carlos Garcia Campos
none Details | Review
Updated: add get_destination_basename_from_download() helper function (2.62 KB, patch)
2012-06-25 16:19 UTC, Carlos Garcia Campos
committed Details | Review
Updated patch (23.53 KB, patch)
2012-06-25 16:27 UTC, Carlos Garcia Campos
reviewed Details | Review
Updated patch (23.75 KB, patch)
2012-06-27 09:47 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-06-22 09:05:30 UTC
Created attachment 217005 [details] [review]
Pass suggested filename to define_destination_uri()

Downloads API is a bit different in WebKit2, so in this case we also need some refactorings.
Comment 1 Carlos Garcia Campos 2012-06-22 09:05:50 UTC
Created attachment 217006 [details] [review]
remove _ephy_download_new() internal function
Comment 2 Carlos Garcia Campos 2012-06-22 09:06:09 UTC
Created attachment 217007 [details] [review]
add ephy_download_widget_download_finished()
Comment 3 Carlos Garcia Campos 2012-06-22 09:06:30 UTC
Created attachment 217008 [details] [review]
add get_destination_basename_from_download() helper function
Comment 4 Carlos Garcia Campos 2012-06-22 09:06:46 UTC
Created attachment 217009 [details] [review]
Patch
Comment 5 Xan Lopez 2012-06-25 10:14:23 UTC
Review of attachment 217005 [details] [review]:

OK.
Comment 6 Xan Lopez 2012-06-25 13:09:03 UTC
Review of attachment 217006 [details] [review]:

Makes sense.
Comment 7 Xan Lopez 2012-06-25 13:14:19 UTC
Review of attachment 217007 [details] [review]:

I think ephy_download_widget_download_is_finished would be better no? You can push with the rename, no need to re-upload the patch. Good cleanup!
Comment 8 Xan Lopez 2012-06-25 13:26:03 UTC
Review of attachment 217008 [details] [review]:

::: lib/widgets/ephy-download-widget.c
@@ +94,3 @@
+#endif
+  if (!dest)
+    return NULL;

I'm a bit confused. Isn't this basically breaking the WK1 case?
Comment 9 Carlos Garcia Campos 2012-06-25 13:30:43 UTC
(In reply to comment #8)
> Review of attachment 217008 [details] [review]:
> 
> ::: lib/widgets/ephy-download-widget.c
> @@ +94,3 @@
> +#endif
> +  if (!dest)
> +    return NULL;
> 
> I'm a bit confused. Isn't this basically breaking the WK1 case?

It's a mistake I made when split the patch, the idea is indeed the opposite, dest = NUL for webkit2, and use wk1 api to get the destination. Then, the wk2 patch adds wk2 api to get the destination.
Comment 10 Carlos Garcia Campos 2012-06-25 16:19:03 UTC
Created attachment 217224 [details] [review]
Updated: add get_destination_basename_from_download() helper function

Updated the patch to fix the issue pointed out by xan.
Comment 11 Carlos Garcia Campos 2012-06-25 16:27:10 UTC
Created attachment 217226 [details] [review]
Updated patch

Just rebased
Comment 12 Xan Lopez 2012-06-25 17:38:50 UTC
Review of attachment 217224 [details] [review]:

OK.
Comment 13 Xan Lopez 2012-06-26 10:31:32 UTC
Review of attachment 217226 [details] [review]:

::: embed/ephy-download.c
@@ +950,3 @@
+  } else {
+    ephy_download_do_download_action (download, EPHY_DOWNLOAD_ACTION_NONE);
+  }

The style guide says don't do braces for one-liners (I think the code was already broken here though).

This code was recently improved, so you need to update it:

- if AUTO_DOWNLOADS is set also check if priv->action is NONE

- otherwise do priv->action, not NONE.

(Basically copy the WK1 stuff).
Comment 14 Carlos Garcia Campos 2012-06-27 09:47:51 UTC
Created attachment 217374 [details] [review]
Updated patch
Comment 15 Xan Lopez 2012-06-27 09:56:12 UTC
Review of attachment 217374 [details] [review]:

::: embed/ephy-web-view.c
@@ +1756,3 @@
+  single = ephy_embed_shell_get_embed_single (embed_shell);
+  request = webkit_response_policy_decision_get_request (response_decision);
+  g_signal_emit_by_name (single, "handle-content", mime_type, uri, &handled);

Hrm, where is uri being initialized here? I guess the line just got lost in copy&paste? If so just fix it and commit.
Comment 16 Carlos Garcia Campos 2012-06-27 12:17:08 UTC
(In reply to comment #15)
> Review of attachment 217374 [details] [review]:
> 
> ::: embed/ephy-web-view.c
> @@ +1756,3 @@
> +  single = ephy_embed_shell_get_embed_single (embed_shell);
> +  request = webkit_response_policy_decision_get_request (response_decision);
> +  g_signal_emit_by_name (single, "handle-content", mime_type, uri, &handled);
> 
> Hrm, where is uri being initialized here? I guess the line just got lost in
> copy&paste? If so just fix it and commit.

Good catch, it seems I removed that line by mistake resolving merge conflicts.