summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/protobuf_video_reader.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 00:48:12 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 00:48:12 +0000
commitf2d6a00399cc2171b4180ca29be5e0dd3154454a (patch)
tree5636a050a999827a7ce99622405768c156853757 /remoting/protocol/protobuf_video_reader.cc
parent59886edef95ad60b74f70df276f1d21744ad48e2 (diff)
downloadchromium_src-f2d6a00399cc2171b4180ca29be5e0dd3154454a.zip
chromium_src-f2d6a00399cc2171b4180ca29be5e0dd3154454a.tar.gz
chromium_src-f2d6a00399cc2171b4180ca29be5e0dd3154454a.tar.bz2
Add CancelChannelCreation() in protocol::Session interface.
The new method cancels channel creation for pending channel. This prevents some potential crashes. Review URL: http://codereview.chromium.org/8573013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/protobuf_video_reader.cc')
-rw-r--r--remoting/protocol/protobuf_video_reader.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/remoting/protocol/protobuf_video_reader.cc b/remoting/protocol/protobuf_video_reader.cc
index cf5d1a9..0bcc9fe 100644
--- a/remoting/protocol/protobuf_video_reader.cc
+++ b/remoting/protocol/protobuf_video_reader.cc
@@ -15,19 +15,24 @@ namespace remoting {
namespace protocol {
ProtobufVideoReader::ProtobufVideoReader(VideoPacketFormat::Encoding encoding)
- : encoding_(encoding),
+ : session_(NULL),
+ encoding_(encoding),
video_stub_(NULL) {
}
-ProtobufVideoReader::~ProtobufVideoReader() { }
+ProtobufVideoReader::~ProtobufVideoReader() {
+ if (session_)
+ session_->CancelChannelCreation(kVideoChannelName);
+}
void ProtobufVideoReader::Init(protocol::Session* session,
VideoStub* video_stub,
const InitializedCallback& callback) {
+ session_ = session;
initialized_callback_ = callback;
video_stub_ = video_stub;
- session->CreateStreamChannel(
+ session_->CreateStreamChannel(
kVideoChannelName,
base::Bind(&ProtobufVideoReader::OnChannelReady, base::Unretained(this)));
}