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

Unified Diff: remoting/protocol/jingle_session.cc

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/jingle_session.h ('k') | remoting/protocol/jingle_session_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session.cc
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 611f97c7431bf127b376fbdf28c200445a31b378..b510ae8ae434e8974a8212c4bd4f56fb224aa863 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -66,7 +66,7 @@ JingleSession::JingleSession(
JingleSession::~JingleSession() {
// Reset the callback so that it's not called from Close().
- state_change_callback_.reset();
+ state_change_callback_.Reset();
Close();
jingle_session_manager_->SessionDestroyed(this);
}
@@ -127,10 +127,11 @@ cricket::Session* JingleSession::ReleaseSession() {
return session;
}
-void JingleSession::SetStateChangeCallback(StateChangeCallback* callback) {
+void JingleSession::SetStateChangeCallback(
+ const StateChangeCallback& callback) {
DCHECK(CalledOnValidThread());
- DCHECK(callback);
- state_change_callback_.reset(callback);
+ DCHECK(!callback.is_null());
+ state_change_callback_ = callback;
}
Session::Error JingleSession::error() {
@@ -466,8 +467,8 @@ void JingleSession::SetState(State new_state) {
DCHECK_NE(state_, FAILED);
state_ = new_state;
- if (state_change_callback_.get())
- state_change_callback_->Run(new_state);
+ if (!state_change_callback_.is_null())
+ state_change_callback_.Run(new_state);
}
}
« no previous file with comments | « remoting/protocol/jingle_session.h ('k') | remoting/protocol/jingle_session_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698