Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: remoting/protocol/jingle_session.cc

Issue 7312013: Minor cleanups in JingleSession and JingleSessionManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/jingle_session.h" 5 #include "remoting/protocol/jingle_session.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "crypto/hmac.h" 9 #include "crypto/hmac.h"
10 #include "crypto/rsa_private_key.h" 10 #include "crypto/rsa_private_key.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (local_private_key) { 152 if (local_private_key) {
153 std::vector<uint8> key_bytes; 153 std::vector<uint8> key_bytes;
154 CHECK(local_private_key->ExportPrivateKey(&key_bytes)); 154 CHECK(local_private_key->ExportPrivateKey(&key_bytes));
155 local_private_key_.reset( 155 local_private_key_.reset(
156 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes)); 156 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes));
157 CHECK(local_private_key_.get()); 157 CHECK(local_private_key_.get());
158 } 158 }
159 } 159 }
160 160
161 JingleSession::~JingleSession() { 161 JingleSession::~JingleSession() {
162 DCHECK(closed_); 162 Close();
Wez 2011/07/06 21:24:25 Is this safe? Isn't it possible for |cricket_sess
Sergey Ulanov 2011/07/06 23:15:01 It may. Added line that resets |state_change_callb
Wez 2011/07/06 23:39:41 Actually, I think the only way to be sure that you
Sergey Ulanov 2011/07/07 00:50:30 We cannot destroy it because cricket::SessionManag
163 jingle_session_manager_->SessionDestroyed(this); 163 jingle_session_manager_->SessionDestroyed(this);
164 } 164 }
165 165
166 void JingleSession::Init(cricket::Session* cricket_session) { 166 void JingleSession::Init(cricket::Session* cricket_session) {
167 DCHECK(CalledOnValidThread()); 167 DCHECK(CalledOnValidThread());
168 168
169 cricket_session_ = cricket_session; 169 cricket_session_ = cricket_session;
170 jid_ = cricket_session_->remote_name(); 170 jid_ = cricket_session_->remote_name();
171 cert_verifier_.reset(new net::CertVerifier()); 171 cert_verifier_.reset(new net::CertVerifier());
172 cricket_session_->SignalState.connect( 172 cricket_session_->SignalState.connect(
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 671
672 state_ = new_state; 672 state_ = new_state;
673 if (!closed_ && state_change_callback_.get()) 673 if (!closed_ && state_change_callback_.get())
674 state_change_callback_->Run(new_state); 674 state_change_callback_->Run(new_state);
675 } 675 }
676 } 676 }
677 677
678 } // namespace protocol 678 } // namespace protocol
679 679
680 } // namespace remoting 680 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698