| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // need to exchange more than one message. | 33 // need to exchange more than one message. |
| 34 class Authenticator { | 34 class Authenticator { |
| 35 public: | 35 public: |
| 36 // Allowed state transitions: | 36 // Allowed state transitions: |
| 37 // When ProcessMessage() is called: | 37 // When ProcessMessage() is called: |
| 38 // WAITING_MESSAGE -> MESSAGE_READY | 38 // WAITING_MESSAGE -> MESSAGE_READY |
| 39 // WAITING_MESSAGE -> ACCEPTED | 39 // WAITING_MESSAGE -> ACCEPTED |
| 40 // WAITING_MESSAGE -> REJECTED | 40 // WAITING_MESSAGE -> REJECTED |
| 41 // WAITING_MESSAGE -> PROCESSING_MESSAGE | 41 // WAITING_MESSAGE -> PROCESSING_MESSAGE |
| 42 // After asynchronous message processing finishes: | 42 // After asynchronous message processing finishes: |
| 43 /// PROCESSING_MESSAGE -> MESSAGE_READY | 43 // PROCESSING_MESSAGE -> MESSAGE_READY |
| 44 // PROCESSING_MESSAGE -> ACCEPTED |
| 45 // PROCESSING_MESSAGE -> REJECTED |
| 44 // When GetNextMessage() is called: | 46 // When GetNextMessage() is called: |
| 45 // MESSAGE_READY -> WAITING_MESSAGE | 47 // MESSAGE_READY -> WAITING_MESSAGE |
| 46 // MESSAGE_READY -> ACCEPTED | 48 // MESSAGE_READY -> ACCEPTED |
| 47 enum State { | 49 enum State { |
| 48 // Waiting for the next message from the peer. | 50 // Waiting for the next message from the peer. |
| 49 WAITING_MESSAGE, | 51 WAITING_MESSAGE, |
| 50 | 52 |
| 51 // Next message is ready to be sent to the peer. | 53 // Next message is ready to be sent to the peer. |
| 52 MESSAGE_READY, | 54 MESSAGE_READY, |
| 53 | 55 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // for the result of this method. | 138 // for the result of this method. |
| 137 virtual scoped_ptr<Authenticator> CreateAuthenticator( | 139 virtual scoped_ptr<Authenticator> CreateAuthenticator( |
| 138 const std::string& local_jid, | 140 const std::string& local_jid, |
| 139 const std::string& remote_jid) = 0; | 141 const std::string& remote_jid) = 0; |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 } // namespace protocol | 144 } // namespace protocol |
| 143 } // namespace remoting | 145 } // namespace remoting |
| 144 | 146 |
| 145 #endif // REMOTING_PROTOCOL_AUTHENTICATOR_H_ | 147 #endif // REMOTING_PROTOCOL_AUTHENTICATOR_H_ |
| OLD | NEW |