void DownloadManagerEfl::didCancel(WKContextRef, WKDownloadRef wkDownload, const void* clientInfo) { DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo); EwkDownloadJob* download = downloadManager->ewkDownloadJob(wkDownload); ASSERT(download); download->setState(EWK_DOWNLOAD_JOB_STATE_CANCELLED); download->view()->smartCallback<DownloadJobCancelled>().call(download); downloadManager->unregisterDownloadJob(wkDownload); }
void DownloadManagerEfl::didFail(WKContextRef, WKDownloadRef wkDownload, WKErrorRef error, const void* clientInfo) { DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo); EwkDownloadJob* download = downloadManager->ewkDownloadJob(wkDownload); ASSERT(download); OwnPtr<EwkError> ewkError = EwkError::create(error); download->setState(EWK_DOWNLOAD_JOB_STATE_FAILED); Ewk_Download_Job_Error downloadError = { download, ewkError.get() }; download->view()->smartCallback<DownloadJobFailed>().call(&downloadError); downloadManager->unregisterDownloadJob(wkDownload); }