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

Unified Diff: remoting/protocol/fake_authenticator.cc

Issue 2453933008: Bugfixes in JingleSession (Closed)
Patch Set: Created 4 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
Index: remoting/protocol/fake_authenticator.cc
diff --git a/remoting/protocol/fake_authenticator.cc b/remoting/protocol/fake_authenticator.cc
index 4a796409421d46fd13641363bea40e8fc4470a53..14bb06ae0bf774a3a492b7928190b733ae986196 100644
--- a/remoting/protocol/fake_authenticator.cc
+++ b/remoting/protocol/fake_authenticator.cc
@@ -101,8 +101,16 @@ void FakeAuthenticator::set_messages_till_started(int messages) {
messages_till_started_ = messages;
}
+void FakeAuthenticator::Resume() {
+ base::ResetAndReturn(&resume_closure_).Run();
+}
+
Authenticator::State FakeAuthenticator::state() const {
EXPECT_LE(messages_, round_trips_ * 2);
+
+ if (messages_ == pause_message_index_ && !resume_closure_.is_null())
+ return PROCESSING_MESSAGE;
+
if (messages_ >= round_trips_ * 2) {
if (action_ == REJECT) {
return REJECTED;
@@ -152,6 +160,10 @@ void FakeAuthenticator::ProcessMessage(const buzz::XmlElement* message,
}
++messages_;
+ if (messages_ == pause_message_index_) {
+ resume_closure_ = resume_callback;
+ return;
+ }
resume_callback.Run();
}

Powered by Google App Engine
This is Rietveld 408576698