Bug 127091 - [GTK] Implement custom URI schemes with CustomProtocols
Summary: [GTK] Implement custom URI schemes with CustomProtocols
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 125583 127614
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-16 02:30 PST by Carlos Garcia Campos
Modified: 2014-01-27 05:10 PST (History)
8 users (show)

See Also:


Attachments
Patch (25.70 KB, patch)
2014-01-16 03:09 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Rebased patch (25.65 KB, patch)
2014-01-21 10:29 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Rebased patch (25.71 KB, patch)
2014-01-23 08:47 PST, Carlos Garcia Campos
gns: review+
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 2014-01-16 02:30:55 PST
Since CustomProtocols implementation is common for the web and network processes, this will add support for custom uri schemes when using the network process.
Comment 1 Carlos Garcia Campos 2014-01-16 03:09:41 PST
Created attachment 221354 [details]
Patch

webkit_uri_scheme_request_get_web_view() is broken and always returns NULL. We need to find a way to bring it back.
Comment 2 Carlos Garcia Campos 2014-01-21 10:29:32 PST
Created attachment 221760 [details]
Rebased patch
Comment 3 WebKit Commit Bot 2014-01-21 10:30:24 PST
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 4 WebKit Commit Bot 2014-01-21 10:30:31 PST
Attachment 221760 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp:154:  Use 0 or null instead of NULL (even in *comments*).  [readability/null] [4]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Carlos Garcia Campos 2014-01-23 08:47:31 PST
Created attachment 221985 [details]
Rebased patch
Comment 6 Gustavo Noronha (kov) 2014-01-24 06:34:29 PST
Comment on attachment 221985 [details]
Rebased patch

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

Is this holding something back? I guess we should figure out how to reimplement obtaining the originating webview or land this after we branch? LGTM otherwise.

> Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:943
> -void webkitWebContextReceivedURIRequest(WebKitWebContext* context, WebKitURISchemeRequest* request)
> +void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID, API::URLRequest* urlRequest)
>  {
> -    String scheme(String::fromUTF8(webkit_uri_scheme_request_get_scheme(request)));
> +    // FIXME: We need to figure out how to get the initiating page.

Is customProtocolID unique per requested load, or is that an id for the scheme? We could maintain a mapping of those IDs to pages, I guess.
Comment 7 Carlos Garcia Campos 2014-01-24 23:36:12 PST
(In reply to comment #6)
> (From update of attachment 221985 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221985&action=review
> 
> Is this holding something back? I guess we should figure out how to reimplement obtaining the originating webview or land this after we branch? LGTM otherwise.

Yes, we need to find a solution for the initiating web view :-(

> > Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:943
> > -void webkitWebContextReceivedURIRequest(WebKitWebContext* context, WebKitURISchemeRequest* request)
> > +void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID, API::URLRequest* urlRequest)
> >  {
> > -    String scheme(String::fromUTF8(webkit_uri_scheme_request_get_scheme(request)));
> > +    // FIXME: We need to figure out how to get the initiating page.
> 
> Is customProtocolID unique per requested load, or is that an id for the scheme? We could maintain a mapping of those IDs to pages, I guess.

It's per request, yes, but it's generated by the networking process, and at this point in the web context we don't know the web view associated to this request ID to make a map.
Comment 8 Carlos Garcia Campos 2014-01-27 05:10:26 PST
Committed r162835: <http://trac.webkit.org/changeset/162835>