Index: remoting/host/it2me/it2me_host.h |
diff --git a/remoting/host/it2me/it2me_host.h b/remoting/host/it2me/it2me_host.h |
index 953beff6d24c45246e38389dfd91f2970da905e8..a658eecb1f2c59ecd4d888c169c842e014584e06 100644 |
--- a/remoting/host/it2me/it2me_host.h |
+++ b/remoting/host/it2me/it2me_host.h |
@@ -6,6 +6,7 @@ |
#define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
#include <memory> |
+#include <string> |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
@@ -165,7 +166,7 @@ class It2MeHost : public base::RefCountedThreadSafe<It2MeHost>, |
XmppSignalStrategy::XmppServerConfig xmpp_server_config_; |
std::string directory_bot_jid_; |
- It2MeHostState state_; |
+ It2MeHostState state_ = kDisconnected; |
scoped_refptr<RsaKeyPair> host_key_pair_; |
std::unique_ptr<SignalStrategy> signal_strategy_; |
@@ -175,14 +176,14 @@ class It2MeHost : public base::RefCountedThreadSafe<It2MeHost>, |
std::unique_ptr<HostEventLogger> host_event_logger_; |
std::unique_ptr<ChromotingHost> host_; |
- int failed_login_attempts_; |
+ int failed_login_attempts_ = 0; |
std::unique_ptr<PolicyWatcher> policy_watcher_; |
std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_; |
std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; |
// Host the current nat traversal policy setting. |
- bool nat_traversal_enabled_; |
+ bool nat_traversal_enabled_ = false; |
// The client and host domain policy setting. |
std::string required_client_domain_; |
@@ -191,7 +192,7 @@ class It2MeHost : public base::RefCountedThreadSafe<It2MeHost>, |
// Indicates whether or not a policy has ever been read. This is to ensure |
// that on startup, we do not accidentally start a connection before we have |
// queried our policy restrictions. |
- bool policy_received_; |
+ bool policy_received_ = false; |
// On startup, it is possible to have Connect() called before the policy read |
// is completed. Rather than just failing, we thunk the connection call so |
@@ -213,21 +214,23 @@ class It2MeHostFactory { |
It2MeHostFactory(); |
virtual ~It2MeHostFactory(); |
+ virtual scoped_refptr<It2MeHost> CreateIt2MeHost( |
+ std::unique_ptr<ChromotingHostContext> context, |
+ base::WeakPtr<It2MeHost::Observer> observer, |
+ const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, |
+ const std::string& directory_bot_jid); |
+ |
// |policy_service| is used for creating the policy watcher for new |
// instances of It2MeHost on ChromeOS. The caller must ensure that |
// |policy_service| is valid throughout the lifetime of the It2MeHostFactory |
// and each created It2MeHost object. This is currently possible because |
// |policy_service| is a global singleton available from the browser process. |
- virtual void set_policy_service(policy::PolicyService* policy_service); |
+ void set_policy_service(policy::PolicyService* policy_service); |
- virtual scoped_refptr<It2MeHost> CreateIt2MeHost( |
- std::unique_ptr<ChromotingHostContext> context, |
- base::WeakPtr<It2MeHost::Observer> observer, |
- const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, |
- const std::string& directory_bot_jid); |
+ policy::PolicyService* get_policy_service() { return policy_service_; } |
Sergey Ulanov
2016/08/31 23:00:16
This also looks out of place here. Factories shoul
joedow
2016/09/02 21:58:59
Great suggestion
|
private: |
- policy::PolicyService* policy_service_; |
+ policy::PolicyService* policy_service_ = nullptr; |
DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); |
}; |