GNOME Bugzilla – Bug 695446
[WK2] Missing call to webkit_uri_request_set_uri in ephy_web_view_load_request
Last modified: 2013-03-11 18:28:36 UTC
This request is used later in ephy_shell_new_tab_full to check if the new tab is empty or not and put the focus on the location entry or not.
Created attachment 238375 [details] [review] Patch
Review of attachment 238375 [details] [review]: Great.
Pushed to master.
Review of attachment 238375 [details] [review]: ::: embed/ephy-web-view.c @@ +2865,3 @@ effective_url = ephy_web_view_normalize_or_autosearch_url (view, url); + webkit_uri_request_set_uri (request, effective_url); Changing the uri request and then loading it with webkit_web_view_load_uri() is useless, we used it because of the lack of set_uri, but not that you are changing it, you should use webkit_web_view_load_request() instead.
(In reply to comment #4) > Review of attachment 238375 [details] [review]: > > ::: embed/ephy-web-view.c > @@ +2865,3 @@ > effective_url = ephy_web_view_normalize_or_autosearch_url (view, url); > > + webkit_uri_request_set_uri (request, effective_url); > > Changing the uri request and then loading it with webkit_web_view_load_uri() is > useless, we used it because of the lack of set_uri, but not that you are > changing it, you should use webkit_web_view_load_request() instead. The idea was that other listeners of the load process would get the right URI if they poke the request, so it does really matter that muchr how we do the load in this particular place.
If we eventually have support for changing the headers of a uri request, and you call ephy_web_view_load_request() with a modified request, it won't work, so I guess it's safer to use webkit_web_view_load_request().
Created attachment 238465 [details] [review] Patch using webkit_web_view_load_request As explained by Carlos it seems better to use webkit_web_view_load_request() in order to allow ephy_web_view_load_request() to be called with a modified request.
Review of attachment 238465 [details] [review]: Yep.