Bug 91193

Summary: [EFL][WK2] Add request manager client
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: gyuyoung.kim, kenneth, rakuco, ryuan.choi, sw0524.lee, tonikitoo, webkit.review.bot, zeno
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 61838    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
kenneth: review+, webkit.review.bot: commit-queue-
Patch for landing none

Description Chris Dumez 2012-07-12 23:41:53 PDT
We need to define a request manager client and attach it to the Ewk_Context. This will allow the client to define custom handlers for particular URL schemes (e.g. "about:").
Comment 1 Chris Dumez 2012-07-13 05:42:05 PDT
Created attachment 152229 [details]
Patch
Comment 2 Chris Dumez 2012-07-13 05:47:50 PDT
Created attachment 152231 [details]
Patch

Remove useless header include.
Comment 3 Chris Dumez 2012-07-13 05:56:26 PDT
Created attachment 152232 [details]
Patch
Comment 4 Chris Dumez 2012-07-13 06:34:49 PDT
Created attachment 152244 [details]
Patch

Make new ewk header installable.
Comment 5 Chris Dumez 2012-07-13 10:58:38 PDT
Created attachment 152303 [details]
Patch

Rebase on master.
Comment 6 Chris Dumez 2012-07-15 00:41:07 PDT
Created attachment 152454 [details]
Patch

Add destructor for Ewk_Url_Scheme_Request.
Comment 7 Kenneth Rohde Christiansen 2012-07-16 20:50:03 PDT
Comment on attachment 152454 [details]
Patch

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

> Source/WebKit2/ChangeLog:15
> +        The client application can now register a URL scheme
> +        via the Ewk_Context API and provide a callback handler
> +        that will get called whenever a URL request with this
> +        scheme is made.
> +

Did you check how Qt is doing this? I think Zeno made a quite nice API for us, so maybe you should have a look (it is QML based though). I think it was slightly more powerful, but I might be wrong
Comment 8 Chris Dumez 2012-07-16 23:35:19 PDT
(In reply to comment #7)
> (From update of attachment 152454 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=152454&action=review
> 
> > Source/WebKit2/ChangeLog:15
> > +        The client application can now register a URL scheme
> > +        via the Ewk_Context API and provide a callback handler
> > +        that will get called whenever a URL request with this
> > +        scheme is made.
> > +
> 
> Did you check how Qt is doing this? I think Zeno made a quite nice API for us, so maybe you should have a look (it is QML based though). I think it was slightly more powerful, but I might be wrong

Yes, I checked the Qt implementation but I chose to follow the one from GTK port instead. The issue is that the Qt implementation is for QML and it does not closely match what we can/should do in EFL.

If you look for example at:
Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml

Basically, you can define in QML delegates for URL schemes that will return data (and possible a contentType) when a URL request matches one of the schemes. I might be missing something but it does not look more powerful. You can achieve exactly the same thing with the EFL alternative. The major difference is that one is nicely integrated in QML while the other uses the "old" callback way.

If I missed something, please tell me.
Comment 9 Kenneth Rohde Christiansen 2012-07-16 23:41:23 PDT
Let's cc Zeno
Comment 10 Chris Dumez 2012-07-18 05:49:15 PDT
Any update on this?
Comment 11 Chris Dumez 2012-07-23 03:45:24 PDT
Zeno might be on vacation? Is there any big problem preventing this patch from landing? I mean, we can always improve later if we find missing functionality.
Comment 12 Zeno Albisser 2012-07-23 04:02:16 PDT
(In reply to comment #11)
> Zeno might be on vacation? Is there any big problem preventing this patch from landing? I mean, we can always improve later if we find missing functionality.

No, I'm here. Sorry I didn't realize i was cc'ed on this bug. :-)
Will read up on it now.
Comment 13 Zeno Albisser 2012-07-23 04:15:35 PDT
(In reply to comment #9)
> Let's cc Zeno

Implementation wise it looks similar to what we've done for the Qt port.
Of course the API is different, and of course as mentioned before our "callbacks" are meant to be used with QML. Also in this patch i only really see API/port specific code. So I don't think there is much code duplication etc.
Comment 14 Kenneth Rohde Christiansen 2012-07-23 06:02:14 PDT
r=me
Comment 15 Chris Dumez 2012-07-23 06:09:05 PDT
(In reply to comment #14)
> r=me

Thanks, could you please set r+ flag then? :)
Comment 16 Kenneth Rohde Christiansen 2012-07-23 07:45:22 PDT
Comment on attachment 152454 [details]
Patch

sure but I had problems loading the site at work
Comment 17 WebKit Review Bot 2012-07-23 07:46:59 PDT
Comment on attachment 152454 [details]
Patch

Rejecting attachment 152454 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
ager_client.cpp
patching file Source/WebKit2/UIProcess/API/efl/ewk_context_request_manager_client_private.h
patching file Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp
patching file Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h
patching file Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Kenneth Ro..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/13330042
Comment 18 Chris Dumez 2012-07-23 08:01:50 PDT
Created attachment 153798 [details]
Patch for landing

Rebase on master.
Comment 19 WebKit Review Bot 2012-07-23 08:49:22 PDT
Comment on attachment 153798 [details]
Patch for landing

Clearing flags on attachment: 153798

Committed r123341: <http://trac.webkit.org/changeset/123341>
Comment 20 WebKit Review Bot 2012-07-23 08:49:29 PDT
All reviewed patches have been landed.  Closing bug.