Bug 97895 - [GTK] Add API to get the web view that initiated a custom URI request to WebKit2 GTK+
Summary: [GTK] Add API to get the web view that initiated a custom URI request to WebK...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Soup
Depends on:
Blocks:
 
Reported: 2012-09-28 05:04 PDT by Carlos Garcia Campos
Modified: 2012-10-03 00:56 PDT (History)
6 users (show)

See Also:


Attachments
Patch (32.66 KB, patch)
2012-09-28 05:21 PDT, Carlos Garcia Campos
mrobinson: review+
mrobinson: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2012-09-28 05:04:21 PDT
When handling a custom URI scheme request it's very useful to know the web view that initiated the request.
Comment 1 Carlos Garcia Campos 2012-09-28 05:21:55 PDT
Created attachment 166223 [details]
Patch
Comment 2 WebKit Review Bot 2012-09-28 05:26:19 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
Comment 3 WebKit Review Bot 2012-09-28 05:26:40 PDT
Attachment 166223 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:703:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.h"
Total errors found: 1 in 30 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Martin Robinson 2012-10-02 13:34:22 PDT
Comment on attachment 166223 [details]
Patch

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

Okay. This looks good to me. I wish there was a cleaner way to get the frame from the networking request, but

> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:700
> +    uint64_t* initiatingPageIDPtr = g_slice_new(uint64_t);

You should use FastAlloc instead of the GLib allocator here.

>> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:703
>> +                           reinterpret_cast<GDestroyNotify>(initiatingPageIDPtrFree));
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

Please fix this before landing.
Comment 5 Martin Robinson 2012-10-02 13:34:54 PDT
(In reply to comment #4)
> (From update of attachment 166223 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=166223&action=review
> 
> Okay. This looks good to me. I wish there was a cleaner way to get the frame from the networking request, but

...a little bit of ugliness is probably okay for now. :)
Comment 6 Carlos Garcia Campos 2012-10-03 00:56:53 PDT
Committed r130259: <http://trac.webkit.org/changeset/130259>