Chromium Code Reviews| Index: remoting/protocol/pepper_stream_channel.cc |
| diff --git a/remoting/protocol/pepper_stream_channel.cc b/remoting/protocol/pepper_stream_channel.cc |
| index 5f8afab9f7cd125acb73acd1d56cc30dfe2ff0bf..618e5e2fd40e131c01540a9bdde46103fdc58ef1 100644 |
| --- a/remoting/protocol/pepper_stream_channel.cc |
| +++ b/remoting/protocol/pepper_stream_channel.cc |
| @@ -81,6 +81,7 @@ PepperStreamChannel::PepperStreamChannel( |
| } |
| PepperStreamChannel::~PepperStreamChannel() { |
| + session_->OnDeleteChannel(this); |
|
Wez
2011/11/15 22:29:13
This looks like a bug-fix, necessary but unrelated
Sergey Ulanov
2011/11/16 00:01:33
Actually it wasn't a bug, and it is required for t
|
| // Verify that the |channel_| is ether destroyed or we own it. |
| DCHECK_EQ(channel_, owned_channel_.get()); |
| // Channel should be already destroyed if we were connected. |
| @@ -163,17 +164,21 @@ void PepperStreamChannel::AddRemoveCandidate( |
| channel_->AddRemoteCandidate(jingle_glue::SerializeP2PCandidate(candidate)); |
| } |
| -const std::string& PepperStreamChannel::name() { |
| +const std::string& PepperStreamChannel::name() const { |
| DCHECK(CalledOnValidThread()); |
| return name_; |
| } |
| +bool PepperStreamChannel::connected() const { |
| + DCHECK(CalledOnValidThread()); |
| + return connected_; |
| +} |
| + |
| void PepperStreamChannel::OnChannelDeleted() { |
| if (connected_) { |
| channel_ = NULL; |
| - // The PepperTransportSocketAdapter is being deleted, so delete the |
| - // channel too. |
| - session_->OnDeleteChannel(this); |
| + // The PepperTransportSocketAdapter is being deleted, so delete |
| + // the channel too. |
| delete this; |
| } |
| } |