WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
74618
[Qt][WK2] QWebDownloadItems are leaking
https://bugs.webkit.org/show_bug.cgi?id=74618
Summary
[Qt][WK2] QWebDownloadItems are leaking
Jesus Sanchez-Palencia
Reported
2011-12-15 09:57:09 PST
QWebDownloadItems are leaking when WebProcess raises a download failure before sending didReceiveResponse back to UIProcess. This can happen when QtFileDownloader fails in determineFilename(), for instance.
Attachments
Patch
(2.43 KB, patch)
2011-12-15 10:38 PST
,
Jesus Sanchez-Palencia
no flags
Details
Formatted Diff
Diff
Patch
(2.29 KB, patch)
2011-12-19 14:43 PST
,
Jesus Sanchez-Palencia
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jesus Sanchez-Palencia
Comment 1
2011-12-15 10:38:42 PST
Created
attachment 119457
[details]
Patch
Kenneth Rohde Christiansen
Comment 2
2011-12-15 12:57:21 PST
Comment on
attachment 119457
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=119457&action=review
Wouldn't it be easier to ref the download item instead and then transfer ownership when parenting it?
> Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp:98 > + // If this function is ever reached with an "empty" downloadItem > + // then it means WebProcess raised a download failure even before > + // we reached downloadReceivedResponse(). At this point > + // QQuickWebView::downloadRequested() signal hasn't been emitted and > + // the downloadItem will have null parent. Therefore, it will leak > + // unless we delete it.
This could be more compact // If the url is empty at this point, the download failed before it received a response and downloadRequested // was emitted. Due to this the item will not be parented and we have to delete it manually at this point.
Jesus Sanchez-Palencia
Comment 3
2011-12-16 07:19:48 PST
(In reply to
comment #2
)
> Wouldn't it be easier to ref the download item instead and then transfer ownership when parenting it?
But then we might end up with a bunch of (failed) download items during the entire life cycle of whoever is keeping the RefPtr, right? Those objects are useless since they never got to the "client" (the browser, let's say) and will just be kept in memory for no reason. I would rather delete them straight away. Plus, if we ever decide do to expose setDownloadEnabled API (
https://bugs.webkit.org/show_bug.cgi?id=73318
) we will have a similar situation in which we will need to delete downloadItems as well.
> This could be more compact > > // If the url is empty at this point, the download failed before it received a response and downloadRequested > // was emitted. Due to this the item will not be parented and we have to delete it manually at this point.
Yes, sure, thanks! I will update the patch later as soon as we reach a conclusion about deleting the the download items or to ref them.
Simon Hausmann
Comment 4
2011-12-19 06:02:58 PST
Comment on
attachment 119457
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=119457&action=review
> Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp:103 > +
According to your comment the item will have a null parent, so wouldn't it be easier and more readable to simply write: if (!downloadItem->parent()) { delete downloadItem; return; }
Jesus Sanchez-Palencia
Comment 5
2011-12-19 14:43:29 PST
Created
attachment 119920
[details]
Patch
WebKit Review Bot
Comment 6
2011-12-19 16:12:56 PST
Comment on
attachment 119920
[details]
Patch Clearing flags on attachment: 119920 Committed
r103278
: <
http://trac.webkit.org/changeset/103278
>
WebKit Review Bot
Comment 7
2011-12-19 16:13:00 PST
All reviewed patches have been landed. Closing bug.
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