Bug 234975

Summary: WebKit::DownloadProxy::publishProgress() falls through ASSERT_NOT_REACHED()
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, darin, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 228875, 234932    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description David Kilzer (:ddkilzer) 2022-01-07 11:55:59 PST
WebKit::DownloadProxy::publishProgress() falls through ASSERT_NOT_REACHED().

There should be an early return in the `else` block after ASSERT_NOT_REACHED().

#if PLATFORM(COCOA)
void DownloadProxy::publishProgress(const URL& URL)
{
    if (!m_dataStore)
        return;

    SandboxExtension::Handle handle;
    if (auto createdHandle = SandboxExtension::createHandle(URL.fileSystemPath(), SandboxExtension::Type::ReadWrite))
        handle = WTFMove(*createdHandle);
    else
        ASSERT_NOT_REACHED();

    m_dataStore->networkProcess().send(Messages::NetworkProcess::PublishDownloadProgress(m_downloadID, URL, handle), 0);
}
#endif // PLATFORM(COCOA)

See Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp.
Comment 1 Radar WebKit Bug Importer 2022-01-07 11:56:18 PST
<rdar://problem/87265153>
Comment 2 Chris Dumez 2022-01-19 10:00:44 PST
Created attachment 449491 [details]
Patch
Comment 3 EWS 2022-01-19 12:39:51 PST
Committed r288232 (246189@main): <https://commits.webkit.org/246189@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449491 [details].