|
Lines 236-246
HRESULT WebDownload::cancelForResume()
a/Source/WebKitLegacy/win/WebDownloadCFNet.cpp_sec1
|
| 236 |
if (!m_download) |
236 |
if (!m_download) |
| 237 |
return E_FAIL; |
237 |
return E_FAIL; |
| 238 |
|
238 |
|
| 239 |
HRESULT hr = S_OK; |
|
|
| 240 |
RetainPtr<CFDataRef> resumeData; |
239 |
RetainPtr<CFDataRef> resumeData; |
| 241 |
if (m_destination.isEmpty()) { |
240 |
if (m_destination.isEmpty()) { |
| 242 |
CFURLDownloadCancel(m_download.get()); |
241 |
CFURLDownloadCancel(m_download.get()); |
| 243 |
goto exit; |
242 |
m_download = nullptr; |
|
|
243 |
return S_OK; |
| 244 |
} |
244 |
} |
| 245 |
|
245 |
|
| 246 |
CFURLDownloadSetDeletesUponFailure(m_download.get(), false); |
246 |
CFURLDownloadSetDeletesUponFailure(m_download.get(), false); |
|
Lines 249-264
HRESULT WebDownload::cancelForResume()
a/Source/WebKitLegacy/win/WebDownloadCFNet.cpp_sec2
|
| 249 |
resumeData = adoptCF(CFURLDownloadCopyResumeData(m_download.get())); |
249 |
resumeData = adoptCF(CFURLDownloadCopyResumeData(m_download.get())); |
| 250 |
if (!resumeData) { |
250 |
if (!resumeData) { |
| 251 |
LOG(Download, "WebDownload - Unable to create resume data for download (%p)", this); |
251 |
LOG(Download, "WebDownload - Unable to create resume data for download (%p)", this); |
| 252 |
goto exit; |
252 |
m_download = nullptr; |
|
|
253 |
return S_OK; |
| 253 |
} |
254 |
} |
| 254 |
|
255 |
|
| 255 |
auto* resumeBytes = reinterpret_cast<const uint8_t*>(CFDataGetBytePtr(resumeData.get())); |
256 |
auto* resumeBytes = reinterpret_cast<const uint8_t*>(CFDataGetBytePtr(resumeData.get())); |
| 256 |
uint32_t resumeLength = CFDataGetLength(resumeData.get()); |
257 |
uint32_t resumeLength = CFDataGetLength(resumeData.get()); |
| 257 |
DownloadBundle::appendResumeData(resumeBytes, resumeLength, m_bundlePath); |
258 |
DownloadBundle::appendResumeData(resumeBytes, resumeLength, m_bundlePath); |
| 258 |
|
259 |
|
| 259 |
exit: |
|
|
| 260 |
m_download = nullptr; |
260 |
m_download = nullptr; |
| 261 |
return hr; |
261 |
return S_OK; |
| 262 |
} |
262 |
} |
| 263 |
|
263 |
|
| 264 |
HRESULT WebDownload::deletesFileUponFailure(_Out_ BOOL* result) |
264 |
HRESULT WebDownload::deletesFileUponFailure(_Out_ BOOL* result) |