Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 namespace buzz { | 10 namespace buzz { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 // Next message is ready to be sent to the peer. | 46 // Next message is ready to be sent to the peer. |
| 47 MESSAGE_READY, | 47 MESSAGE_READY, |
| 48 | 48 |
| 49 // Session is authenticated successufully. | 49 // Session is authenticated successufully. |
| 50 ACCEPTED, | 50 ACCEPTED, |
| 51 | 51 |
| 52 // Session is rejected. | 52 // Session is rejected. |
| 53 REJECTED, | 53 REJECTED, |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // Returns true if |message| is an authenticator message. | |
|
Wez
2011/12/03 00:21:05
nit: Authenticator?
Sergey Ulanov
2011/12/06 19:37:07
Done.
| |
| 57 static bool IsAuthenticatorMessage(const buzz::XmlElement* message); | |
| 58 | |
| 59 // Creates an empty authenticator message. Passes ownership of the | |
|
Wez
2011/12/03 00:21:05
nit: Creates an empty authenticator message, owned
Sergey Ulanov
2011/12/06 19:37:07
Done.
| |
| 60 // result to the caller. | |
| 61 static buzz::XmlElement* CreateEmptyAuthenticatorMessage(); | |
| 62 | |
| 63 // Finds authenticator message among child elements of |message|. | |
|
Wez
2011/12/03 00:21:05
And if there isn't one?
Sergey Ulanov
2011/12/06 19:37:07
Done.
| |
| 64 static const buzz::XmlElement* FindAuthenticatorMessage( | |
| 65 const buzz::XmlElement* message); | |
| 66 | |
| 56 Authenticator() {} | 67 Authenticator() {} |
| 57 virtual ~Authenticator() {} | 68 virtual ~Authenticator() {} |
| 58 | 69 |
| 59 // Returns current state of the authenticator. | 70 // Returns current state of the authenticator. |
| 60 virtual State state() const = 0; | 71 virtual State state() const = 0; |
| 61 | 72 |
| 62 // Called in response to incoming message received from the peer. | 73 // Called in response to incoming message received from the peer. |
| 63 // Should only be called when in WAITING_MESSAGE state. Caller | 74 // Should only be called when in WAITING_MESSAGE state. Caller |
| 64 // retains ownership of |message|. | 75 // retains ownership of |message|. |
| 65 virtual void ProcessMessage(const buzz::XmlElement* message) = 0; | 76 virtual void ProcessMessage(const buzz::XmlElement* message) = 0; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 90 // for the result of this method. | 101 // for the result of this method. |
| 91 virtual Authenticator* CreateAuthenticator( | 102 virtual Authenticator* CreateAuthenticator( |
| 92 const std::string& remote_jid, | 103 const std::string& remote_jid, |
| 93 const buzz::XmlElement* first_message) = 0; | 104 const buzz::XmlElement* first_message) = 0; |
| 94 }; | 105 }; |
| 95 | 106 |
| 96 } // namespace protocol | 107 } // namespace protocol |
| 97 } // namespace remoting | 108 } // namespace remoting |
| 98 | 109 |
| 99 #endif // REMOTING_PROTOCOL_AUTHENTICATOR_H_ | 110 #endif // REMOTING_PROTOCOL_AUTHENTICATOR_H_ |
| OLD | NEW |