OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/pepper_stream_channel.h" | 5 #include "remoting/protocol/pepper_stream_channel.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "crypto/hmac.h" | 8 #include "crypto/hmac.h" |
9 #include "jingle/glue/utils.h" | 9 #include "jingle/glue/utils.h" |
10 #include "net/base/cert_status_flags.h" | 10 #include "net/base/cert_status_flags.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const Session::StreamChannelCallback& callback) | 43 const Session::StreamChannelCallback& callback) |
44 : session_(session), | 44 : session_(session), |
45 name_(name), | 45 name_(name), |
46 callback_(callback), | 46 callback_(callback), |
47 channel_(NULL), | 47 channel_(NULL), |
48 connected_(false) { | 48 connected_(false) { |
49 } | 49 } |
50 | 50 |
51 PepperStreamChannel::~PepperStreamChannel() { | 51 PepperStreamChannel::~PepperStreamChannel() { |
52 session_->OnDeleteChannel(this); | 52 session_->OnDeleteChannel(this); |
53 // Verify that the |channel_| is ether destroyed or we own it. | |
54 DCHECK_EQ(channel_, owned_channel_.get()); | |
55 // Channel should be already destroyed if we were connected. | 53 // Channel should be already destroyed if we were connected. |
56 DCHECK(!connected_ || channel_ == NULL); | 54 DCHECK(!connected_ || channel_ == NULL); |
57 } | 55 } |
58 | 56 |
59 void PepperStreamChannel::Connect(pp::Instance* pp_instance, | 57 void PepperStreamChannel::Connect(pp::Instance* pp_instance, |
60 const TransportConfig& transport_config, | 58 const TransportConfig& transport_config, |
61 ChannelAuthenticator* authenticator) { | 59 ChannelAuthenticator* authenticator) { |
62 DCHECK(CalledOnValidThread()); | 60 DCHECK(CalledOnValidThread()); |
63 | 61 |
64 authenticator_.reset(authenticator); | 62 authenticator_.reset(authenticator); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void PepperStreamChannel::NotifyConnectFailed() { | 192 void PepperStreamChannel::NotifyConnectFailed() { |
195 channel_ = NULL; | 193 channel_ = NULL; |
196 owned_channel_.reset(); | 194 owned_channel_.reset(); |
197 authenticator_.reset(); | 195 authenticator_.reset(); |
198 | 196 |
199 NotifyConnected(NULL); | 197 NotifyConnected(NULL); |
200 } | 198 } |
201 | 199 |
202 } // namespace protocol | 200 } // namespace protocol |
203 } // namespace remoting | 201 } // namespace remoting |
OLD | NEW |