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

Unified Diff: remoting/protocol/jingle_session.cc

Issue 8743023: Separate Authenticator and Session unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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
Index: remoting/protocol/jingle_session.cc
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 40f06579db13724e9c3b0da708ee6c4b63c4c98b..2c02eb6021ce4a68b4b373e30be5e0429d69dd15 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -45,6 +45,8 @@ JingleSession::JingleSession(
jid_ = cricket_session_->remote_name();
cricket_session_->SignalState.connect(this, &JingleSession::OnSessionState);
cricket_session_->SignalError.connect(this, &JingleSession::OnSessionError);
+ cricket_session_->SignalReceivedTerminateReason.connect(
+ this, &JingleSession::OnTerminateReason);
}
JingleSession::~JingleSession() {
@@ -244,6 +246,12 @@ void JingleSession::OnSessionError(
}
}
+void JingleSession::OnTerminateReason(cricket::Session* session,
+ const std::string& reason) {
+ terminate_reason_ = reason;
+}
+
+
void JingleSession::OnInitiate() {
DCHECK(CalledOnValidThread());
jid_ = cricket_session_->remote_name();
@@ -332,7 +340,14 @@ void JingleSession::OnAccept() {
void JingleSession::OnTerminate() {
DCHECK(CalledOnValidThread());
- CloseInternal(net::ERR_CONNECTION_ABORTED, OK);
+
+ if (terminate_reason_ == "decline") {
+ CloseInternal(net::ERR_CONNECTION_ABORTED, AUTHENTICATION_FAILED);
+ } else if (terminate_reason_ == "incompatible-protocol") {
+ CloseInternal(net::ERR_CONNECTION_ABORTED, INCOMPATIBLE_PROTOCOL);
+ } else {
+ CloseInternal(net::ERR_CONNECTION_ABORTED, OK);
Wez 2011/12/13 00:12:38 This looks like a fix to JingleSession, presumably
Sergey Ulanov 2011/12/13 02:31:55 Done.
+ }
}
void JingleSession::AcceptConnection() {

Powered by Google App Engine
This is Rietveld 408576698