Beispiel #1
0
void DownloadManagerEfl::didCancel(WKContextRef, WKDownloadRef wkDownload, const void* clientInfo)
{
    DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo);
    uint64_t downloadId = toImpl(wkDownload)->downloadID();
    Ewk_Download_Job* download = downloadManager->downloadJob(downloadId);
    ASSERT(download);

    download->setState(EWK_DOWNLOAD_JOB_STATE_CANCELLED);
    download->viewImpl()->informDownloadJobCancelled(download);
    downloadManager->unregisterDownloadJob(downloadId);
}
Beispiel #2
0
void DownloadManagerEfl::didFail(WKContextRef, WKDownloadRef wkDownload, WKErrorRef error, const void* clientInfo)
{
    DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo);
    uint64_t downloadId = toImpl(wkDownload)->downloadID();
    Ewk_Download_Job* download = downloadManager->downloadJob(downloadId);
    ASSERT(download);

    OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
    download->setState(EWK_DOWNLOAD_JOB_STATE_FAILED);
    download->viewImpl()->informDownloadJobFailed(download, ewkError.get());
    downloadManager->unregisterDownloadJob(downloadId);
}