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

Unified Diff: remoting/protocol/fake_authenticator.cc

Issue 12389010: Refactor of Authenticator to allow it to ProcessMessage asynchronously and then call a callback (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Created 7 years, 10 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 681f2a9ca88391a7868e15ebe6a3a4551402c647..aebc803c0d66f57c69ea3772be7d6044f7f8c874 100644
--- a/remoting/protocol/fake_authenticator.cc
+++ b/remoting/protocol/fake_authenticator.cc
@@ -86,7 +86,7 @@ FakeAuthenticator::FakeAuthenticator(
FakeAuthenticator::~FakeAuthenticator() {
}
-Authenticator::State FakeAuthenticator::state() const{
+Authenticator::State FakeAuthenticator::state() const {
EXPECT_LE(messages_, round_trips_ * 2);
if (messages_ >= round_trips_ * 2) {
if (action_ == REJECT) {
@@ -117,12 +117,14 @@ Authenticator::RejectionReason FakeAuthenticator::rejection_reason() const {
return INVALID_CREDENTIALS;
}
-void FakeAuthenticator::ProcessMessage(const buzz::XmlElement* message) {
+void FakeAuthenticator::ProcessMessage(const base::Closure& resume_callback,
+ const buzz::XmlElement* message) {
EXPECT_EQ(WAITING_MESSAGE, state());
std::string id =
message->TextNamed(buzz::QName(kChromotingXmlNamespace, "id"));
EXPECT_EQ(id, base::IntToString(messages_));
++messages_;
+ resume_callback.Run();
}
scoped_ptr<buzz::XmlElement> FakeAuthenticator::GetNextMessage() {

Powered by Google App Engine
This is Rietveld 408576698