[Webkit-unassigned] [Bug 22624] [SOUP][GTK] Need API to get SoupSession from WebKit.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 15 06:00:16 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=22624
xan.lopez at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xan.lopez at gmail.com
------- Comment #11 from xan.lopez at gmail.com 2009-01-15 06:00 PDT -------
(In reply to comment #10)
> Created an attachment (id=26741)
--> (https://bugs.webkit.org/attachment.cgi?id=26741&action=view) [review]
> API to retrieve and set soup sessions #5
>
> Small correction, "session" is writable and webkit_web_view_set_session is
> actually defined in the header.
>
Looks pretty good to me.
+#if PLATFORM(GTK)
+ virtual SoupSession* session() = 0;
+ virtual void setSession(SoupSession*) = 0;
+#endif
Indentation.
+ if (!jar) {
+ jar = soup_cookie_jar_new();
+ soup_session_add_feature(session, SOUP_SESSION_FEATURE(jar));
+ g_object_unref(G_OBJECT(jar));
+ }
g_object_unref takes a gpointer.
+SoupSession* ResourceHandle::getSession(const Frame *frame)
+{
+ static SoupSession* default_session = soup_session_async_new();
+
+ if (!frame)
+ return default_session;
+ FrameLoader *loader = frame->loader();
+ if (!loader)
+ return 0;
Why not return the default session here? If this is some kind of catastrophic
error situation maybe we should assert or something...
+ SoupSession* session =
static_cast<FrameLoaderClient*>(loader->client())->session();
+ return session ? session : default_session;
+}
Also, just wondering in general, if the sessions are async maybe some checks
wold be in order when swapping them (making sure they have no pending work?).
Maybe that's related to your error...
And as a soptimization, I think a flag saying the session is initialized
instead of checking for the features every time we go through startHttp would
be good (I think I had this in previous patches).
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list