summaryrefslogtreecommitdiff
path: root/src/WebSocketInteractionCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-05-11 11:04:47 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-05-11 18:50:03 +0900
commit1c571f196af0013e1b0ad1c9e075ed9c711e915b (patch)
tree1dc1fc3687210e1bf3e79c0427883bbc52e921fb /src/WebSocketInteractionCommand.cc
parent9f4f888e399a7ac60f6adfbaed6544f02b87b018 (diff)
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.
Diffstat (limited to 'src/WebSocketInteractionCommand.cc')
-rw-r--r--src/WebSocketInteractionCommand.cc5
1 files changed, 3 insertions, 2 deletions
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<Notifier>::instance()->addWebSocketSession(wsSession_);
+ e_->getWebSocketSessionMan()->addSession(wsSession_);
e_->addSocketForReadCheck(socket_, this);
}
@@ -68,7 +69,7 @@ WebSocketInteractionCommand::~WebSocketInteractionCommand()
if(writeCheck_) {
e_->deleteSocketForWriteCheck(socket_, this);
}
- SingletonHolder<Notifier>::instance()->removeWebSocketSession(wsSession_);
+ e_->getWebSocketSessionMan()->removeSession(wsSession_);
}
void WebSocketInteractionCommand::updateWriteCheck()