Index: remoting/protocol/protobuf_video_writer.cc |
diff --git a/remoting/protocol/protobuf_video_writer.cc b/remoting/protocol/protobuf_video_writer.cc |
index 12dd6611ad50a3d359163967aba8be8947dedb87..e1318c0695f7b0e4e7d46d29a3ae689d9c5b9af1 100644 |
--- a/remoting/protocol/protobuf_video_writer.cc |
+++ b/remoting/protocol/protobuf_video_writer.cc |
@@ -8,6 +8,7 @@ |
#include "net/socket/stream_socket.h" |
#include "remoting/base/constants.h" |
#include "remoting/proto/video.pb.h" |
+#include "remoting/protocol/channel_factory.h" |
#include "remoting/protocol/session.h" |
#include "remoting/protocol/util.h" |
@@ -15,7 +16,7 @@ namespace remoting { |
namespace protocol { |
ProtobufVideoWriter::ProtobufVideoWriter() |
- : session_(NULL) { |
+ : channel_factory_(NULL) { |
} |
ProtobufVideoWriter::~ProtobufVideoWriter() { |
@@ -24,10 +25,10 @@ ProtobufVideoWriter::~ProtobufVideoWriter() { |
void ProtobufVideoWriter::Init(protocol::Session* session, |
const InitializedCallback& callback) { |
- session_ = session; |
+ channel_factory_ = session->GetTransportChannelFactory(); |
initialized_callback_ = callback; |
- session_->CreateStreamChannel( |
+ channel_factory_->CreateStreamChannel( |
kVideoChannelName, |
base::Bind(&ProtobufVideoWriter::OnChannelReady, base::Unretained(this))); |
} |
@@ -50,9 +51,9 @@ void ProtobufVideoWriter::OnChannelReady(scoped_ptr<net::StreamSocket> socket) { |
void ProtobufVideoWriter::Close() { |
buffered_writer_.Close(); |
channel_.reset(); |
- if (session_) { |
- session_->CancelChannelCreation(kVideoChannelName); |
- session_ = NULL; |
+ if (channel_factory_) { |
+ channel_factory_->CancelChannelCreation(kVideoChannelName); |
+ channel_factory_ = NULL; |
} |
} |