Chromium Code Reviews| Index: remoting/protocol/authenticator.h |
| diff --git a/remoting/protocol/authenticator.h b/remoting/protocol/authenticator.h |
| index b8aa37d4544220d010195f63a2e89be64f09f126..5fa0664649627abff92adfa3c115d3588bdec305 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,9 +39,14 @@ class Authenticator { |
| // WAITING_MESSAGE -> MESSAGE_READY |
| // WAITING_MESSAGE -> ACCEPTED |
| // WAITING_MESSAGE -> REJECTED |
| + // WAITING_MESSAGE -> WAITING_EXTERNAL |
|
Wez
2013/02/27 07:05:30
I don't like "external" - can we call this WAITING
rmsousa
2013/03/05 03:30:24
Done in another CL.
|
| // When GetNextMessage() is called: |
| // MESSAGE_READY -> WAITING_MESSAGE |
| // MESSAGE_READY -> ACCEPTED |
| + // When PerformExternalAction() is called: |
| + // WAITING_EXTERNAL -> MESSAGE_READY |
| + // WAITING_EXTERNAL -> ACCEPTED |
| + // WAITING_EXTERNAL -> REJECTED |
| enum State { |
| // Waiting for the next message from the peer. |
| WAITING_MESSAGE, |
| @@ -53,6 +59,9 @@ class Authenticator { |
| // Session is rejected. |
| REJECTED, |
| + |
| + // Waiting for PerformExternalAction to be called, or its action to finish. |
| + WAITING_EXTERNAL, |
| }; |
| enum RejectionReason { |
| @@ -89,6 +98,10 @@ class Authenticator { |
| // authentication message that needs to be sent to the peer. |
| virtual scoped_ptr<buzz::XmlElement> GetNextMessage() = 0; |
| + // Must be called when in WAITING_EXTERNAL state. Performs the external action |
| + // (e.g. user prompt, network request), and calls |resume_callback| when done. |
| + virtual void PerformExternalAction(const base::Closure& resume_callback); |
|
Wez
2013/02/27 07:05:30
nit: We don't provide a no-message default impl fo
rmsousa
2013/03/05 03:30:24
Done in another CL.
|
| + |
| // Creates new authenticator for a channel. Can be called only in |
| // the ACCEPTED state. |
| virtual scoped_ptr<ChannelAuthenticator> |