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

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

Issue 8495024: Access ChromotingHost::clients_ only on network thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/pepper_session.h" 5 #include "remoting/protocol/pepper_session.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 184 }
185 185
186 const std::string& PepperSession::shared_secret() { 186 const std::string& PepperSession::shared_secret() {
187 DCHECK(CalledOnValidThread()); 187 DCHECK(CalledOnValidThread());
188 return shared_secret_; 188 return shared_secret_;
189 } 189 }
190 190
191 void PepperSession::Close() { 191 void PepperSession::Close() {
192 DCHECK(CalledOnValidThread()); 192 DCHECK(CalledOnValidThread());
193 193
194 state_change_callback_.Reset();
Wez 2011/11/09 02:32:22 nit: Clarify that we do this to meet the no-more-c
Sergey Ulanov 2011/11/09 21:24:00 Done.
195
194 if (state_ == CONNECTING || state_ == CONNECTED || 196 if (state_ == CONNECTING || state_ == CONNECTED ||
195 state_ == CONNECTED_CHANNELS) { 197 state_ == CONNECTED_CHANNELS) {
196 // Send session-terminate message. 198 // Send session-terminate message.
197 JingleMessage message(peer_jid_, JingleMessage::SESSION_TERMINATE, 199 JingleMessage message(peer_jid_, JingleMessage::SESSION_TERMINATE,
198 session_id_); 200 session_id_);
199 scoped_ptr<IqRequest> terminate_request( 201 scoped_ptr<IqRequest> terminate_request(
200 session_manager_->iq_sender()->SendIq( 202 session_manager_->iq_sender()->SendIq(
201 message.ToXml(), IqSender::ReplyCallback())); 203 message.ToXml(), IqSender::ReplyCallback()));
202 } 204 }
203 205
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 DCHECK_NE(state_, FAILED); 403 DCHECK_NE(state_, FAILED);
402 404
403 state_ = new_state; 405 state_ = new_state;
404 if (!state_change_callback_.is_null()) 406 if (!state_change_callback_.is_null())
405 state_change_callback_.Run(new_state); 407 state_change_callback_.Run(new_state);
406 } 408 }
407 } 409 }
408 410
409 } // namespace protocol 411 } // namespace protocol
410 } // namespace remoting 412 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698