Bug 163545 - NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
Summary: NetworkSession: PendingDownload is leaked if canceled before willDecidePendin...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-17 08:55 PDT by Carlos Garcia Campos
Modified: 2016-10-17 23:06 PDT (History)
1 user (show)

See Also:


Attachments
Patch (4.37 KB, patch)
2016-10-17 09:00 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Fix debug build with network session disabled. (4.41 KB, patch)
2016-10-17 09:29 PDT, Carlos Garcia Campos
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-10-17 08:55:16 PDT
If a download started by DownloadManager::startDownload() is cancelled before DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.
Comment 1 Carlos Garcia Campos 2016-10-17 09:00:14 PDT
Created attachment 291821 [details]
Patch
Comment 2 Carlos Garcia Campos 2016-10-17 09:29:20 PDT
Created attachment 291823 [details]
Fix debug build with network session disabled.

So, Mac EWS debug doesn't have network session enabled?
Comment 3 Alex Christensen 2016-10-17 10:25:17 PDT
(In reply to comment #2)
> Created attachment 291823 [details]
> Fix debug build with network session disabled.
> 
> So, Mac EWS debug doesn't have network session enabled?
This is true, unfortunately.  Network session is only enabled starting with Sierra/iOS10 and I think EWS uses El Capitan.
Comment 4 Alex Christensen 2016-10-17 10:30:01 PDT
Comment on attachment 291823 [details]
Fix debug build with network session disabled.

r=me
Comment 5 Carlos Garcia Campos 2016-10-17 23:06:47 PDT
Committed r207454: <http://trac.webkit.org/changeset/207454>