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

Unified Diff: remoting/protocol/authenticator.h

Issue 12326090: Third Party authentication protocol. (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Split authenticator into base, client, host 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/authenticator.h
diff --git a/remoting/protocol/authenticator.h b/remoting/protocol/authenticator.h
index b8aa37d4544220d010195f63a2e89be64f09f126..53e0d265f611364f73f8bfa988b187ca658301d5 100644
--- a/remoting/protocol/authenticator.h
+++ b/remoting/protocol/authenticator.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
namespace buzz {
@@ -38,6 +39,9 @@ class Authenticator {
// WAITING_MESSAGE -> MESSAGE_READY
// WAITING_MESSAGE -> ACCEPTED
// WAITING_MESSAGE -> REJECTED
+ // WAITING_MESSAGE -> PROCESSING_MESSAGE
+ // After asynchronous message processing finishes:
+ /// PROCESSING_MESSAGE -> MESSAGE_READY
// When GetNextMessage() is called:
// MESSAGE_READY -> WAITING_MESSAGE
// MESSAGE_READY -> ACCEPTED
@@ -53,6 +57,9 @@ class Authenticator {
// Session is rejected.
REJECTED,
+
+ // Asynchronously processing the last message from the peer.
+ PROCESSING_MESSAGE,
};
enum RejectionReason {
@@ -81,9 +88,12 @@ class Authenticator {
virtual RejectionReason rejection_reason() const = 0;
// Called in response to incoming message received from the peer.
- // Should only be called when in WAITING_MESSAGE state. Caller
- // retains ownership of |message|.
- virtual void ProcessMessage(const buzz::XmlElement* message) = 0;
+ // Should only be called when in WAITING_MESSAGE state. Caller retains
+ // ownership of |message|. |resume_callback| will be called when processing is
+ // finished. The implementation must guarantee that |resume_callback| is not
+ // called after the Authenticator is destroyed.
+ virtual void ProcessMessage(const buzz::XmlElement* message,
+ const base::Closure& resume_callback) = 0;
// Must be called when in MESSAGE_READY state. Returns next
// authentication message that needs to be sent to the peer.

Powered by Google App Engine
This is Rietveld 408576698