Bug 112160

Summary: [GTK] Add webkit_uri_request_get_http_headers to WebKit2 GTK+ API
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, benjamin, commit-queue, danw, gustavo, gyuyoung.kim, kling, mrobinson, rakuco, svillar, xan.lopez, zan
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 83681, 111288    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Update patch addressing review comments
none
Another update
none
Rebased patch kling: review+

Carlos Garcia Campos
Reported 2013-03-12 09:36:22 PDT
It allows to load requests with custom headers, or to upsdate the headers of a request before being sent to the server in the WebKitWebPage::send-request callback.
Attachments
Patch (20.54 KB, patch)
2013-03-12 09:46 PDT, Carlos Garcia Campos
no flags
Update patch addressing review comments (20.54 KB, patch)
2013-03-12 10:23 PDT, Carlos Garcia Campos
no flags
Another update (21.48 KB, patch)
2013-03-12 10:32 PDT, Carlos Garcia Campos
no flags
Rebased patch (21.13 KB, patch)
2013-04-20 08:28 PDT, Carlos Garcia Campos
kling: review+
Carlos Garcia Campos
Comment 1 2013-03-12 09:46:02 PDT
Martin Robinson
Comment 2 2013-03-12 09:54:16 PDT
Comment on attachment 192756 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192756&action=review Great stuff! Now we just need the owner stamp. > Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp:157 > + * or %NULL if @request is not an HTTP request. Maybe it would be slightly more accurate to say "if @request is not a #WebKitURIRequest." ? > Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp:169 > + request->priv->httpHeaders.set(soup_message_headers_new (SOUP_MESSAGE_HEADERS_REQUEST)); A space snuck in after soup_message_headers_new. > Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp:351 > + // Load a request with no do not track header. Really tiny nitpick: Do Not Track is a proper noun, which isn't a big deal, but it makes this comment easier to read if you capitalize it.
Carlos Garcia Campos
Comment 3 2013-03-12 10:03:24 PDT
(In reply to comment #2) > (From update of attachment 192756 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=192756&action=review > > Great stuff! Now we just need the owner stamp. Thanks! Adding owners to CC. > > Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp:157 > > + * or %NULL if @request is not an HTTP request. > > Maybe it would be slightly more accurate to say "if @request is not a #WebKitURIRequest." ? Nope, we can create a WebKitURIRequest for a non HTTP URI, there's a test case in the unit tests that checks this returns NULL for a file:// URI request. > > Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp:169 > > + request->priv->httpHeaders.set(soup_message_headers_new (SOUP_MESSAGE_HEADERS_REQUEST)); > > A space snuck in after soup_message_headers_new. I wonder why the style checker didn't catch this one. > > Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp:351 > > + // Load a request with no do not track header. > > Really tiny nitpick: Do Not Track is a proper noun, which isn't a big deal, but it makes this comment easier to read if you capitalize it. Sure, I'll upload a new patch.
Carlos Garcia Campos
Comment 4 2013-03-12 10:23:52 PDT
Created attachment 192760 [details] Update patch addressing review comments
Carlos Garcia Campos
Comment 5 2013-03-12 10:32:57 PDT
Created attachment 192761 [details] Another update Sorry I forgot to add the changes of one of the unit tests files.
Carlos Garcia Campos
Comment 6 2013-04-20 08:28:19 PDT
Created attachment 198944 [details] Rebased patch Patch rebased to current git master and removed the soup hack for SoupMessageHeaders include since we already bumped libsoup requirements. Other patches blocking this one landed already, so this can land now. Could a WebKit2 owner review it, please?
WebKit Commit Bot
Comment 7 2013-04-20 08:30:51 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Andreas Kling
Comment 8 2013-04-23 04:09:03 PDT
Comment on attachment 198944 [details] Rebased patch View in context: https://bugs.webkit.org/attachment.cgi?id=198944&action=review > Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp:60 > + g_object_set(soupMessage, SOUP_MESSAGE_METHOD, httpMethod().utf8().data(), NULL); Does g_object_set() make a copy of the string passed here? (httpMethod().utf8().data()) Otherwise this looks wrong.
Carlos Garcia Campos
Comment 9 2013-04-23 05:03:12 PDT
(In reply to comment #8) > (From update of attachment 198944 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=198944&action=review > > > Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp:60 > > + g_object_set(soupMessage, SOUP_MESSAGE_METHOD, httpMethod().utf8().data(), NULL); > > Does g_object_set() make a copy of the string passed here? (httpMethod().utf8().data()) > Otherwise this looks wrong. Yes, it copies the string.
Carlos Garcia Campos
Comment 10 2013-04-23 08:07:27 PDT
Note You need to log in before you can comment on or make changes to this bug.