Bug 123428 - [SOUP][GTK][WK2] Need API to get SoupSession from WebKit2.
Summary: [SOUP][GTK][WK2] Need API to get SoupSession from WebKit2.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-28 17:25 PDT by Andre Moreira Magalhaes
Modified: 2013-12-01 22:53 PST (History)
11 users (show)

See Also:


Attachments
Patch (7.68 KB, patch)
2013-10-28 17:37 PDT, Andre Moreira Magalhaes
no flags Details | Formatted Diff | Diff
Patch (8.40 KB, patch)
2013-10-29 06:39 PDT, Andre Moreira Magalhaes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Moreira Magalhaes 2013-10-28 17:25:04 PDT
webkit1 gtk has an API to get the default SoupSession which would be useful for extensions on webkit2. The API can be used for example to set proxy settings directly on the SoupSession from extensions (which run in the WebProcess).

Patch to come next.
Comment 1 Andre Moreira Magalhaes 2013-10-28 17:37:05 PDT
Created attachment 215352 [details]
Patch

Add webkit_get_default_session API to wk2.
Comment 2 Andre Moreira Magalhaes 2013-10-29 06:39:33 PDT
Created attachment 215384 [details]
Patch

Fix build issues with documentation.
Comment 3 WebKit Commit Bot 2013-10-29 06:41:04 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 4 Carlos Garcia Campos 2013-10-29 06:45:55 PDT
We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings?
Comment 5 Carlos Garcia Campos 2013-10-29 06:46:22 PDT
Note that this might now work anymore if we switch to use the network process.
Comment 6 Dan Winship 2013-10-29 06:52:37 PDT
It depends how complicated the app wants to get with its proxy settings...
Comment 7 Andre Moreira Magalhaes 2013-10-29 07:31:56 PDT
(In reply to comment #4)
> We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings?

You mean an API for web-extension (Web Process) or a webview/context API (UI Process)?

If for the extension we could easily add a webkit_set_proxy_resolver(GProxyResolver*) instead of exposing the SoupSession. If you mean an API for webview/context we would have to pass the info all the way to the Web Process, and I am not sure how flexible this would be.

I believe exposing the SoupSession has other advantages where the user can tweak the session to their needs more easily.

I wasn't aware of this switch to network process though.
Comment 8 Carlos Garcia Campos 2013-10-29 07:40:28 PDT
(In reply to comment #7)
> (In reply to comment #4)
> > We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings?
> 
> You mean an API for web-extension (Web Process) or a webview/context API (UI Process)?

For the UI process would be better, that way it will work even if we switch to network process or implement multi-web-process support.

> If for the extension we could easily add a webkit_set_proxy_resolver(GProxyResolver*) instead of exposing the SoupSession. If you mean an API for webview/context we would have to pass the info all the way to the Web Process, and I am not sure how flexible this would be.

It's what we do for custom uri schemes, cookies, disk cache, http auth, etc.

> I believe exposing the SoupSession has other advantages where the user can tweak the session to their needs more easily.

what other things do you need to tweak?

> I wasn't aware of this switch to network process though.

Well, it's not even supported yet, but we might eventually switch.
Comment 9 Andre Moreira Magalhaes 2013-10-30 05:37:13 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #4)
> > > We have tried to provide API in webkit for different network features (custom uri schemes, authentication, etc.) instead of exposing the SoupSession. Would it be possible to add API (if actually required) to set proxy settings?
> > 
> > You mean an API for web-extension (Web Process) or a webview/context API (UI Process)?
> 
> For the UI process would be better, that way it will work even if we switch to network process or implement multi-web-process support.
> 
Indeed, I agree, just not sure how to support for example custom GProxyResolver in this case.

> > If for the extension we could easily add a webkit_set_proxy_resolver(GProxyResolver*) instead of exposing the SoupSession. If you mean an API for webview/context we would have to pass the info all the way to the Web Process, and I am not sure how flexible this would be.
> 
> It's what we do for custom uri schemes, cookies, disk cache, http auth, etc.
> 
> > I believe exposing the SoupSession has other advantages where the user can tweak the session to their needs more easily.
> 
> what other things do you need to tweak?
> 
I mean that you would have more flexibility here, anything available in the SoupSession could be easily tweaked to the user liking. But yeah, with the possibility of switching to network process this patch makes no sense.

> > I wasn't aware of this switch to network process though.
> 
> Well, it's not even supported yet, but we might eventually switch.
Got it.

Thanks for the comments, I will close here as WONTFIX as I won't have time to work on a proper patch for the UIProcess API.
Comment 10 Csaba Osztrogonác 2013-11-05 09:12:54 PST
Comment on attachment 215384 [details]
Patch

Cleared review? from attachment 215384 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).