If a client creates a download using WKContextDownloadURLRequest(), WKDownloadCopyRequest() won't return the request until the download starts.
<rdar://problem/18521011>
The actual Radar bug is <rdar://problem/10046884>
Created attachment 239119 [details] Patch
Comment on attachment 239119 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239119&action=review > Source/WebKit2/UIProcess/WebPageProxy.cpp:1791 > + ASSERT(m_decidePolicyForResponseRequest); I don't think this is guaranteed to not be null.
Comment on attachment 239119 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239119&action=review >> Source/WebKit2/UIProcess/WebPageProxy.cpp:1791 >> + ASSERT(m_decidePolicyForResponseRequest); > > I don't think this is guaranteed to not be null. I wasn't 100% sure about this, either. I'll update the patch to pass a reference to ResourceRequest() if it is null.
Created attachment 239123 [details] Patch
Comment on attachment 239123 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239123&action=review > Source/WebKit2/UIProcess/WebPageProxy.cpp:1792 > + const ResourceRequest& downloadRequest = m_decidePolicyForResponseRequest ? *m_decidePolicyForResponseRequest : ResourceRequest(); > + DownloadProxy* download = m_process->context().createDownloadProxy(downloadRequest); I'd add a FIXME about ensuring that this ResourceRequest is never empty.
Committed r174230: <http://trac.webkit.org/changeset/174230>