Last active
January 12, 2017 02:48
-
-
Save kkabdol/98826009ba7abb970dec456df68b6dec to your computer and use it in GitHub Desktop.
Code Reading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::shared_ptr<const DownloadTask> Downloader::createDownloadDataTask(const std::string& srcUrl, const std::string& identifier/* = ""*/) | |
| { | |
| DownloadTask *task_ = new DownloadTask(); | |
| std::shared_ptr<const DownloadTask> task(task_); | |
| do | |
| { | |
| task_->requestURL = srcUrl; | |
| task_->identifier = identifier; | |
| if (0 == srcUrl.length()) | |
| { | |
| if (onTaskError) | |
| { | |
| onTaskError(*task, DownloadTask::ERROR_INVALID_PARAMS, 0, "URL or is empty."); | |
| } | |
| task.reset(); | |
| break; | |
| } | |
| task_->_coTask.reset(_impl->createCoTask(task)); | |
| } while (0); | |
| return task; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment