From 1c571f196af0013e1b0ad1c9e075ed9c711e915b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 11 May 2013 11:04:47 +0900 Subject: Refactor Notifier interface to accept DownloadEventListener interface WebSocketSessionMan now implements DownloadEventListener and is added to Notifier. It becomes member variable of DownloadEngine. The event constant for download event is defined in aria2.h so that we can add event callback API later. --- src/WebSocketInteractionCommand.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/WebSocketInteractionCommand.cc') diff --git a/src/WebSocketInteractionCommand.cc b/src/WebSocketInteractionCommand.cc index 9dccc3c3..a21db84d 100644 --- a/src/WebSocketInteractionCommand.cc +++ b/src/WebSocketInteractionCommand.cc @@ -42,6 +42,7 @@ #include "fmt.h" #include "SingletonHolder.h" #include "Notifier.h" +#include "WebSocketSessionMan.h" namespace aria2 { @@ -58,7 +59,7 @@ WebSocketInteractionCommand::WebSocketInteractionCommand writeCheck_(false), wsSession_(wsSession) { - SingletonHolder::instance()->addWebSocketSession(wsSession_); + e_->getWebSocketSessionMan()->addSession(wsSession_); e_->addSocketForReadCheck(socket_, this); } @@ -68,7 +69,7 @@ WebSocketInteractionCommand::~WebSocketInteractionCommand() if(writeCheck_) { e_->deleteSocketForWriteCheck(socket_, this); } - SingletonHolder::instance()->removeWebSocketSession(wsSession_); + e_->getWebSocketSessionMan()->removeSession(wsSession_); } void WebSocketInteractionCommand::updateWriteCheck() -- cgit