Bug 126813

Summary: [SOUP] Add SoupNetworkSession class to wrap a SoupSession
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bunhere, cdumez, commit-queue, danw, eflews.bot, gustavo, gyuyoung.kim, mrobinson, rakuco, svillar
Priority: P2 Keywords: Soup
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
eflews.bot: commit-queue-
Try to fix EFL build
eflews.bot: commit-queue-
Try to fix EFL build
eflews.bot: commit-queue-
Try to fix EFL build gustavo: review+

Description Carlos Garcia Campos 2014-01-11 06:14:52 PST
It would simplify the code that uses SoupSession directly and would avoid duplicated code.
Comment 1 Carlos Garcia Campos 2014-01-11 06:45:08 PST
Created attachment 220928 [details]
Patch
Comment 2 EFL EWS Bot 2014-01-11 06:48:32 PST
Comment on attachment 220928 [details]
Patch

Attachment 220928 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/5803630930165760
Comment 3 EFL EWS Bot 2014-01-11 06:51:28 PST
Comment on attachment 220928 [details]
Patch

Attachment 220928 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/5057096894644224
Comment 4 Carlos Garcia Campos 2014-01-11 06:52:36 PST
Created attachment 220930 [details]
Try to fix EFL build
Comment 5 EFL EWS Bot 2014-01-11 06:57:55 PST
Comment on attachment 220930 [details]
Try to fix EFL build

Attachment 220930 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/5924820411744256
Comment 6 Carlos Garcia Campos 2014-01-11 07:02:09 PST
Created attachment 220932 [details]
Try to fix EFL build
Comment 7 EFL EWS Bot 2014-01-11 07:06:52 PST
Comment on attachment 220932 [details]
Try to fix EFL build

Attachment 220932 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/5367878714916864
Comment 8 Carlos Garcia Campos 2014-01-11 07:12:08 PST
Created attachment 220933 [details]
Try to fix EFL build
Comment 9 Gustavo Noronha (kov) 2014-01-12 07:59:11 PST
Comment on attachment 220933 [details]
Try to fix EFL build

Why not use NetworkStorageSessionSoup as the wrapper class? It feels like adding a new class just adds churn in this case, although I may be missing some life-cycle related issues?
Comment 10 Gustavo Noronha (kov) 2014-01-12 08:07:28 PST
Comment on attachment 220933 [details]
Try to fix EFL build

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

LGTM! Just wondering about the new class being required or if using the NetworkStorage would do it.

> Source/WebKit/efl/ewk/ewk_cookies.cpp:47
> +    g_object_unref(cookieJar);

Any reason not use GRefPtr for this?
Comment 11 Carlos Garcia Campos 2014-01-12 08:46:24 PST
(In reply to comment #10)
> (From update of attachment 220933 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=220933&action=review
> 
> LGTM! Just wondering about the new class being required or if using the NetworkStorage would do it.

Well, NetworkStorage is a cross-platform class in the end, this is just to wrap a SoupSession, with very specific soup code.

> > Source/WebKit/efl/ewk/ewk_cookies.cpp:47
> > +    g_object_unref(cookieJar);
> 
> Any reason not use GRefPtr for this?

I noticed that GRefPtr was not used anywhere in Source/WebKit/efl/ewk, and I thought it could be for some reason, so I used the explicit unref.
Comment 12 Gustavo Noronha (kov) 2014-01-13 09:11:41 PST
(In reply to comment #11)
> > LGTM! Just wondering about the new class being required or if using the NetworkStorage would do it.
> 
> Well, NetworkStorage is a cross-platform class in the end, this is just to wrap a SoupSession, with very specific soup code.

But it already has a soup-specific implementation, and soup-specific assessors, so we could use it, do you think there would be a downside? 

> > > Source/WebKit/efl/ewk/ewk_cookies.cpp:47
> > > +    g_object_unref(cookieJar);
> > 
> > Any reason not use GRefPtr for this?
> 
> I noticed that GRefPtr was not used anywhere in Source/WebKit/efl/ewk, and I thought it could be for some reason, so I used the explicit unref.

Makes sense.
Comment 13 Gustavo Noronha (kov) 2014-01-13 09:47:31 PST
Comment on attachment 220933 [details]
Try to fix EFL build

OK, after our quick chat on IRC I think you're right about the NetworkStorageSession not being conceptually analog to the session, using NetworkingContext would make it more conceptually correct but it's per-frame, so I think your idea of a separate class makes sense. Thanks!
Comment 14 Carlos Garcia Campos 2014-01-13 10:21:46 PST
Committed r161890: <http://trac.webkit.org/changeset/161890>