| 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/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 DCHECK(CalledOnValidThread()); | 158 DCHECK(CalledOnValidThread()); |
| 159 return control_channel_socket_.get(); | 159 return control_channel_socket_.get(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 net::Socket* JingleSession::event_channel() { | 162 net::Socket* JingleSession::event_channel() { |
| 163 DCHECK(CalledOnValidThread()); | 163 DCHECK(CalledOnValidThread()); |
| 164 return event_channel_socket_.get(); | 164 return event_channel_socket_.get(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 const std::string& JingleSession::jid() { | 167 const std::string& JingleSession::jid() { |
| 168 // TODO(sergeyu): Fix ChromotingHost so that it doesn't call this | 168 DCHECK(CalledOnValidThread()); |
| 169 // method on invalid thread and uncomment this DCHECK. | |
| 170 // See crbug.com/88600 . | |
| 171 // DCHECK(CalledOnValidThread()); | |
| 172 return jid_; | 169 return jid_; |
| 173 } | 170 } |
| 174 | 171 |
| 175 const CandidateSessionConfig* JingleSession::candidate_config() { | 172 const CandidateSessionConfig* JingleSession::candidate_config() { |
| 176 DCHECK(CalledOnValidThread()); | 173 DCHECK(CalledOnValidThread()); |
| 177 DCHECK(candidate_config_.get()); | 174 DCHECK(candidate_config_.get()); |
| 178 return candidate_config_.get(); | 175 return candidate_config_.get(); |
| 179 } | 176 } |
| 180 | 177 |
| 181 void JingleSession::set_candidate_config( | 178 void JingleSession::set_candidate_config( |
| 182 const CandidateSessionConfig* candidate_config) { | 179 const CandidateSessionConfig* candidate_config) { |
| 183 DCHECK(CalledOnValidThread()); | 180 DCHECK(CalledOnValidThread()); |
| 184 DCHECK(!candidate_config_.get()); | 181 DCHECK(!candidate_config_.get()); |
| 185 DCHECK(candidate_config); | 182 DCHECK(candidate_config); |
| 186 candidate_config_.reset(candidate_config); | 183 candidate_config_.reset(candidate_config); |
| 187 } | 184 } |
| 188 | 185 |
| 189 const std::string& JingleSession::local_certificate() const { | 186 const std::string& JingleSession::local_certificate() const { |
| 190 DCHECK(CalledOnValidThread()); | 187 DCHECK(CalledOnValidThread()); |
| 191 return local_cert_; | 188 return local_cert_; |
| 192 } | 189 } |
| 193 | 190 |
| 194 const SessionConfig& JingleSession::config() { | 191 const SessionConfig& JingleSession::config() { |
| 195 // TODO(sergeyu): Fix ChromotingHost so that it doesn't call this | 192 DCHECK(CalledOnValidThread()); |
| 196 // method on invalid thread and uncomment this DCHECK. | |
| 197 // See crbug.com/88600 . | |
| 198 // DCHECK(CalledOnValidThread()); | |
| 199 DCHECK(config_set_); | 193 DCHECK(config_set_); |
| 200 return config_; | 194 return config_; |
| 201 } | 195 } |
| 202 | 196 |
| 203 void JingleSession::set_config(const SessionConfig& config) { | 197 void JingleSession::set_config(const SessionConfig& config) { |
| 204 DCHECK(CalledOnValidThread()); | 198 DCHECK(CalledOnValidThread()); |
| 205 DCHECK(!config_set_); | 199 DCHECK(!config_set_); |
| 206 config_ = config; | 200 config_ = config; |
| 207 config_set_ = true; | 201 config_set_ = true; |
| 208 } | 202 } |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 DCHECK_NE(state_, FAILED); | 466 DCHECK_NE(state_, FAILED); |
| 473 | 467 |
| 474 state_ = new_state; | 468 state_ = new_state; |
| 475 if (state_change_callback_.get()) | 469 if (state_change_callback_.get()) |
| 476 state_change_callback_->Run(new_state); | 470 state_change_callback_->Run(new_state); |
| 477 } | 471 } |
| 478 } | 472 } |
| 479 | 473 |
| 480 } // namespace protocol | 474 } // namespace protocol |
| 481 } // namespace remoting | 475 } // namespace remoting |
| OLD | NEW |