| 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_HOST_IT2ME_IT2ME_HOST_H_ | 5 #ifndef REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
| 6 #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 6 #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/single_thread_task_runner.h" | |
| 15 #include "remoting/host/host_status_observer.h" | 14 #include "remoting/host/host_status_observer.h" |
| 16 #include "remoting/host/it2me/it2me_confirmation_dialog.h" | 15 #include "remoting/host/it2me/it2me_confirmation_dialog.h" |
| 17 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" | 16 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" |
| 18 #include "remoting/protocol/validating_authenticator.h" | 17 #include "remoting/protocol/validating_authenticator.h" |
| 19 #include "remoting/signaling/xmpp_signal_strategy.h" | 18 #include "remoting/signaling/xmpp_signal_strategy.h" |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class DictionaryValue; | 21 class DictionaryValue; |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // returned callback after this object has been destroyed. | 101 // returned callback after this object has been destroyed. |
| 103 protocol::ValidatingAuthenticator::ValidationCallback | 102 protocol::ValidatingAuthenticator::ValidationCallback |
| 104 GetValidationCallbackForTesting(); | 103 GetValidationCallbackForTesting(); |
| 105 | 104 |
| 106 protected: | 105 protected: |
| 107 friend class base::RefCountedThreadSafe<It2MeHost>; | 106 friend class base::RefCountedThreadSafe<It2MeHost>; |
| 108 | 107 |
| 109 ~It2MeHost() override; | 108 ~It2MeHost() override; |
| 110 | 109 |
| 111 ChromotingHostContext* host_context() { return host_context_.get(); } | 110 ChromotingHostContext* host_context() { return host_context_.get(); } |
| 112 scoped_refptr<base::SingleThreadTaskRunner> task_runner() { | |
| 113 return task_runner_; | |
| 114 } | |
| 115 base::WeakPtr<It2MeHost::Observer> observer() { return observer_; } | 111 base::WeakPtr<It2MeHost::Observer> observer() { return observer_; } |
| 116 | 112 |
| 117 private: | 113 private: |
| 118 // Updates state of the host. Can be called only on the network thread. | 114 // Updates state of the host. Can be called only on the network thread. |
| 119 void SetState(It2MeHostState state, const std::string& error_message); | 115 void SetState(It2MeHostState state, const std::string& error_message); |
| 120 | 116 |
| 121 // Returns true if the host is connected. | 117 // Returns true if the host is connected. |
| 122 bool IsConnected() const; | 118 bool IsConnected() const; |
| 123 | 119 |
| 124 // Processes the result of the confirmation dialog. | 120 // Processes the result of the confirmation dialog. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 151 void DisconnectOnNetworkThread(); | 147 void DisconnectOnNetworkThread(); |
| 152 | 148 |
| 153 // Uses details of the connection and current policies to determine if the | 149 // Uses details of the connection and current policies to determine if the |
| 154 // connection should be accepted or rejected. | 150 // connection should be accepted or rejected. |
| 155 void ValidateConnectionDetails( | 151 void ValidateConnectionDetails( |
| 156 const std::string& remote_jid, | 152 const std::string& remote_jid, |
| 157 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); | 153 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); |
| 158 | 154 |
| 159 // Caller supplied fields. | 155 // Caller supplied fields. |
| 160 std::unique_ptr<ChromotingHostContext> host_context_; | 156 std::unique_ptr<ChromotingHostContext> host_context_; |
| 161 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 162 base::WeakPtr<It2MeHost::Observer> observer_; | 157 base::WeakPtr<It2MeHost::Observer> observer_; |
| 163 XmppSignalStrategy::XmppServerConfig xmpp_server_config_; | 158 XmppSignalStrategy::XmppServerConfig xmpp_server_config_; |
| 164 std::string directory_bot_jid_; | 159 std::string directory_bot_jid_; |
| 165 | 160 |
| 166 It2MeHostState state_ = kDisconnected; | 161 It2MeHostState state_ = kDisconnected; |
| 167 | 162 |
| 168 scoped_refptr<RsaKeyPair> host_key_pair_; | 163 scoped_refptr<RsaKeyPair> host_key_pair_; |
| 169 std::unique_ptr<SignalStrategy> signal_strategy_; | 164 std::unique_ptr<SignalStrategy> signal_strategy_; |
| 170 std::unique_ptr<RegisterSupportHostRequest> register_request_; | 165 std::unique_ptr<RegisterSupportHostRequest> register_request_; |
| 171 std::unique_ptr<HostStatusLogger> host_status_logger_; | 166 std::unique_ptr<HostStatusLogger> host_status_logger_; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, | 218 const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, |
| 224 const std::string& directory_bot_jid); | 219 const std::string& directory_bot_jid); |
| 225 | 220 |
| 226 private: | 221 private: |
| 227 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); | 222 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); |
| 228 }; | 223 }; |
| 229 | 224 |
| 230 } // namespace remoting | 225 } // namespace remoting |
| 231 | 226 |
| 232 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 227 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
| OLD | NEW |