diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-11-10 17:14:54 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-11-10 18:19:02 +0900 |
| commit | 9e52483c04045ced0aa11b408f905a2baa97ea49 (patch) | |
| tree | c4ff5a083b2bff01a3d335d378fba771fabf2d85 /src/RequestGroup.cc | |
| parent | ba3b823a667fbb794d811b3c565aa103391a0e1c (diff) | |
Refactor DownloadHandlerFactory
Diffstat (limited to 'src/RequestGroup.cc')
| -rw-r--r-- | src/RequestGroup.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index b7332e03..f8db9c91 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -61,7 +61,7 @@ #include "RequestGroupMan.h" #include "DefaultBtProgressInfoFile.h" #include "DefaultPieceStorage.h" -#include "DownloadHandlerFactory.h" +#include "download_handlers.h" #include "MemoryBufferPreDownloadHandler.h" #include "DownloadHandlerConstants.h" #include "Option.h" @@ -78,6 +78,7 @@ #include "SimpleRandomizer.h" #include "Segment.h" #include "SocketRecvBuffer.h" +#include "RequestGroupCriteria.h" #ifdef ENABLE_MESSAGE_DIGEST # include "CheckIntegrityCommand.h" # include "ChecksumCheckIntegrityEntry.h" @@ -1052,12 +1053,14 @@ void RequestGroup::initializePreDownloadHandler() { #ifdef ENABLE_BITTORRENT if(option_->get(PREF_FOLLOW_TORRENT) == V_MEM) { - preDownloadHandlers_.push_back(DownloadHandlerFactory::getBtPreDownloadHandler()); + preDownloadHandlers_.push_back + (download_handlers::getBtPreDownloadHandler()); } #endif // ENABLE_BITTORRENT #ifdef ENABLE_METALINK if(option_->get(PREF_FOLLOW_METALINK) == V_MEM) { - preDownloadHandlers_.push_back(DownloadHandlerFactory::getMetalinkPreDownloadHandler()); + preDownloadHandlers_.push_back + (download_handlers::getMetalinkPreDownloadHandler()); } #endif // ENABLE_METALINK } @@ -1067,13 +1070,15 @@ void RequestGroup::initializePostDownloadHandler() #ifdef ENABLE_BITTORRENT if(option_->getAsBool(PREF_FOLLOW_TORRENT) || option_->get(PREF_FOLLOW_TORRENT) == V_MEM) { - postDownloadHandlers_.push_back(DownloadHandlerFactory::getBtPostDownloadHandler()); + postDownloadHandlers_.push_back + (download_handlers::getBtPostDownloadHandler()); } #endif // ENABLE_BITTORRENT #ifdef ENABLE_METALINK if(option_->getAsBool(PREF_FOLLOW_METALINK) || option_->get(PREF_FOLLOW_METALINK) == V_MEM) { - postDownloadHandlers_.push_back(DownloadHandlerFactory::getMetalinkPostDownloadHandler()); + postDownloadHandlers_.push_back + (download_handlers::getMetalinkPostDownloadHandler()); } #endif // ENABLE_METALINK } @@ -1097,14 +1102,12 @@ void RequestGroup::setDiskWriterFactory( diskWriterFactory_ = diskWriterFactory; } -void RequestGroup::addPostDownloadHandler -(const std::shared_ptr<PostDownloadHandler>& handler) +void RequestGroup::addPostDownloadHandler(const PostDownloadHandler* handler) { postDownloadHandlers_.push_back(handler); } -void RequestGroup::addPreDownloadHandler( - const std::shared_ptr<PreDownloadHandler>& handler) +void RequestGroup::addPreDownloadHandler(const PreDownloadHandler* handler) { preDownloadHandlers_.push_back(handler); } |
