| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_NEGOTIATING_CLIENT_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_NEGOTIATING_CLIENT_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_NEGOTIATING_CLIENT_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_NEGOTIATING_CLIENT_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "remoting/protocol/authenticator.h" | 14 #include "remoting/protocol/authenticator.h" |
| 15 #include "remoting/protocol/client_authentication_config.h" | 15 #include "remoting/protocol/client_authentication_config.h" |
| 16 #include "remoting/protocol/negotiating_authenticator_base.h" | 16 #include "remoting/protocol/negotiating_authenticator_base.h" |
| 17 #include "remoting/protocol/third_party_client_authenticator.h" | 17 #include "remoting/protocol/third_party_client_authenticator.h" |
| 18 | 18 |
| 19 namespace remoting { | 19 namespace remoting { |
| 20 namespace protocol { | 20 namespace protocol { |
| 21 | 21 |
| 22 // Client-side implementation of NegotiatingAuthenticatorBase. | 22 // Client-side implementation of NegotiatingAuthenticatorBase. |
| 23 // See comments in negotiating_authenticator_base.h for a general explanation. | 23 // See comments in negotiating_authenticator_base.h for a general explanation. |
| 24 class NegotiatingClientAuthenticator : public NegotiatingAuthenticatorBase { | 24 class NegotiatingClientAuthenticator : public NegotiatingAuthenticatorBase { |
| 25 public: | 25 public: |
| 26 explicit NegotiatingClientAuthenticator( | 26 explicit NegotiatingClientAuthenticator( |
| 27 const std::string& local_id, | 27 const std::string& local_id, |
| 28 const std::string& remote_id, | 28 const std::string& remote_id, |
| 29 const ClientAuthenticationConfig& config); | 29 const ClientAuthenticationConfig& config); |
| 30 ~NegotiatingClientAuthenticator() override; | 30 ~NegotiatingClientAuthenticator() override; |
| 31 | 31 |
| 32 // Overriden from Authenticator. | 32 // Overriden from Authenticator. |
| 33 void ProcessMessage(const buzz::XmlElement* message, | 33 void ProcessMessage(const buzz::XmlElement* message, |
| 34 const base::Closure& resume_callback) override; | 34 const base::Closure& resume_callback) override; |
| 35 scoped_ptr<buzz::XmlElement> GetNextMessage() override; | 35 std::unique_ptr<buzz::XmlElement> GetNextMessage() override; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // (Asynchronously) creates an authenticator, and stores it in | 38 // (Asynchronously) creates an authenticator, and stores it in |
| 39 // |current_authenticator_|. Authenticators that can be started in either | 39 // |current_authenticator_|. Authenticators that can be started in either |
| 40 // state will be created in |preferred_initial_state|. | 40 // state will be created in |preferred_initial_state|. |
| 41 // |resume_callback| is called after |current_authenticator_| is set. | 41 // |resume_callback| is called after |current_authenticator_| is set. |
| 42 void CreateAuthenticatorForCurrentMethod( | 42 void CreateAuthenticatorForCurrentMethod( |
| 43 Authenticator::State preferred_initial_state, | 43 Authenticator::State preferred_initial_state, |
| 44 const base::Closure& resume_callback); | 44 const base::Closure& resume_callback); |
| 45 | 45 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 71 bool method_set_by_host_ = false; | 71 bool method_set_by_host_ = false; |
| 72 base::WeakPtrFactory<NegotiatingClientAuthenticator> weak_factory_; | 72 base::WeakPtrFactory<NegotiatingClientAuthenticator> weak_factory_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(NegotiatingClientAuthenticator); | 74 DISALLOW_COPY_AND_ASSIGN(NegotiatingClientAuthenticator); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace protocol | 77 } // namespace protocol |
| 78 } // namespace remoting | 78 } // namespace remoting |
| 79 | 79 |
| 80 #endif // REMOTING_PROTOCOL_NEGOTIATING_CLIENT_AUTHENTICATOR_H_ | 80 #endif // REMOTING_PROTOCOL_NEGOTIATING_CLIENT_AUTHENTICATOR_H_ |
| OLD | NEW |