WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
98532
[Soup] Simplify the way that requests are started
https://bugs.webkit.org/show_bug.cgi?id=98532
Summary
[Soup] Simplify the way that requests are started
Martin Robinson
Reported
2012-10-05 10:26:44 PDT
Right now there's a bit of duplicated code in the Soup backend that could be eliminated through abstraction. This is part of a larger effort to make the soup backend more hackable.
Attachments
Patch
(18.52 KB, patch)
2012-10-06 23:59 PDT
,
Martin Robinson
no flags
Details
Formatted Diff
Diff
Patch
(18.52 KB, patch)
2012-10-08 00:01 PDT
,
Martin Robinson
gustavo
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Martin Robinson
Comment 1
2012-10-06 23:59:24 PDT
Created
attachment 167472
[details]
Patch
Martin Robinson
Comment 2
2012-10-08 00:01:56 PDT
Created
attachment 167512
[details]
Patch
Gustavo Noronha (kov)
Comment 3
2012-10-08 12:09:51 PDT
Comment on
attachment 167512
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=167512&action=review
Looks good, just concerned about the change in behaviour for the ref/deref, and wondering about isDestroying, which seems to always be false.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:823 > + d->m_timeoutSource = soup_add_timeout(g_main_context_get_thread_default(), > + d->m_firstRequest.timeoutInterval() * 1000, requestTimeoutCallback, this);
This indentation looks correct, but we have some broken-up parameters in this file that align with the first argument (so just after the open paren). The coding style doesn't seem to say anything explicitly, but the one example it has goes with your way here, something to keep in mind for the future I guess.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:827 > + // balanced by a deref() in cleanupSoupRequestOperation, which should always run > + ref();
This has changed - it will now only ref for requests which are effectively sent, but cleanupSoupRequestOperation calls deref if isDestroying is false, which it seems to always be, from the looks of it?
Martin Robinson
Comment 4
2012-10-08 16:03:15 PDT
(In reply to
comment #3
)
> (From update of
attachment 167512
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=167512&action=review
> > Looks good, just concerned about the change in behaviour for the ref/deref, and wondering about isDestroying, which seems to always be false. > > > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:823 > > + d->m_timeoutSource = soup_add_timeout(g_main_context_get_thread_default(), > > + d->m_firstRequest.timeoutInterval() * 1000, requestTimeoutCallback, this); > > This indentation looks correct, but we have some broken-up parameters in this file that align with the first argument (so just after the open paren). The coding style doesn't seem to say anything explicitly, but the one example it has goes with your way here, something to keep in mind for the future I guess.
The style bot recently started complaining about indentation that aligns with the parenthesis. This is because Darin Adler said this style isn't acceptable. I find the change to be pretty odd, considering there is so much code where we align the argument, but I'm trying to roll with it. :)
> > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:827 > > + // balanced by a deref() in cleanupSoupRequestOperation, which should always run > > + ref(); > > This has changed - it will now only ref for requests which are effectively sent, but cleanupSoupRequestOperation calls deref if isDestroying is false, which it seems to always be, from the looks of it?
So cleanupSoupRequestOperation is called with isDestroying == true in ~ResourceHandle. It makes sense that it shouldn't unref the handle when called from the destructor, since the destructor should only be called when the reference count is already zero. From what I can tell, my change shouldn't cause a problem because cleanupSoupRequestOperation should only called if the request is actually sent.
Martin Robinson
Comment 5
2012-10-08 16:12:22 PDT
Committed
r130699
: <
http://trac.webkit.org/changeset/130699
>
Laszlo Gombos
Comment 6
2012-10-08 16:52:07 PDT
Debug build fails with the following error: Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp: In function ‘bool WebCore::createSoupMessageForHandleAndRequest(WebCore::ResourceHandle*, const WebCore::ResourceRequest&)’: Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:690:8: error: ‘d’ was not declared in this scope
Martin Robinson
Comment 7
2012-10-08 17:03:34 PDT
Landed a fix here:
http://trac.webkit.org/changeset/130704
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug