Bug 163545

Summary: NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Fix debug build with network session disabled. achristensen: review+

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>