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_HOST_CHROMOTING_HOST_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_HOST_H_ |
6 #define REMOTING_HOST_CHROMOTING_HOST_H_ | 6 #define REMOTING_HOST_CHROMOTING_HOST_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ChromotingHost( | 72 ChromotingHost( |
73 SignalStrategy* signal_strategy, | 73 SignalStrategy* signal_strategy, |
74 DesktopEnvironmentFactory* desktop_environment_factory, | 74 DesktopEnvironmentFactory* desktop_environment_factory, |
75 scoped_ptr<protocol::SessionManager> session_manager, | 75 scoped_ptr<protocol::SessionManager> session_manager, |
76 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 76 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
77 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 77 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
78 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, | 78 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
79 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, | 79 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, |
80 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, | 80 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, |
81 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 81 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
82 virtual ~ChromotingHost(); | 82 ~ChromotingHost() override; |
83 | 83 |
84 // Asynchronously starts the host. | 84 // Asynchronously starts the host. |
85 // | 85 // |
86 // After this is invoked, the host process will connect to the talk | 86 // After this is invoked, the host process will connect to the talk |
87 // network and start listening for incoming connections. | 87 // network and start listening for incoming connections. |
88 // | 88 // |
89 // This method can only be called once during the lifetime of this object. | 89 // This method can only be called once during the lifetime of this object. |
90 void Start(const std::string& host_owner); | 90 void Start(const std::string& host_owner); |
91 | 91 |
92 // HostStatusMonitor interface. | 92 // HostStatusMonitor interface. |
93 virtual void AddStatusObserver(HostStatusObserver* observer) override; | 93 void AddStatusObserver(HostStatusObserver* observer) override; |
94 virtual void RemoveStatusObserver(HostStatusObserver* observer) override; | 94 void RemoveStatusObserver(HostStatusObserver* observer) override; |
95 | 95 |
96 // Registers a host extension. | 96 // Registers a host extension. |
97 void AddExtension(scoped_ptr<HostExtension> extension); | 97 void AddExtension(scoped_ptr<HostExtension> extension); |
98 | 98 |
99 // This method may be called only from | 99 // This method may be called only from |
100 // HostStatusObserver::OnClientAuthenticated() to reject the new | 100 // HostStatusObserver::OnClientAuthenticated() to reject the new |
101 // client. | 101 // client. |
102 void RejectAuthenticatingClient(); | 102 void RejectAuthenticatingClient(); |
103 | 103 |
104 // Sets the authenticator factory to use for incoming | 104 // Sets the authenticator factory to use for incoming |
105 // connections. Incoming connections are rejected until | 105 // connections. Incoming connections are rejected until |
106 // authenticator factory is set. Must be called on the network | 106 // authenticator factory is set. Must be called on the network |
107 // thread after the host is started. Must not be called more than | 107 // thread after the host is started. Must not be called more than |
108 // once per host instance because it may not be safe to delete | 108 // once per host instance because it may not be safe to delete |
109 // factory before all authenticators it created are deleted. | 109 // factory before all authenticators it created are deleted. |
110 void SetAuthenticatorFactory( | 110 void SetAuthenticatorFactory( |
111 scoped_ptr<protocol::AuthenticatorFactory> authenticator_factory); | 111 scoped_ptr<protocol::AuthenticatorFactory> authenticator_factory); |
112 | 112 |
113 // Enables/disables curtaining when one or more clients are connected. | 113 // Enables/disables curtaining when one or more clients are connected. |
114 // Takes immediate effect if clients are already connected. | 114 // Takes immediate effect if clients are already connected. |
115 void SetEnableCurtaining(bool enable); | 115 void SetEnableCurtaining(bool enable); |
116 | 116 |
117 // Sets the maximum duration of any session. By default, a session has no | 117 // Sets the maximum duration of any session. By default, a session has no |
118 // maximum duration. | 118 // maximum duration. |
119 void SetMaximumSessionDuration(const base::TimeDelta& max_session_duration); | 119 void SetMaximumSessionDuration(const base::TimeDelta& max_session_duration); |
120 | 120 |
121 //////////////////////////////////////////////////////////////////////////// | 121 //////////////////////////////////////////////////////////////////////////// |
122 // ClientSession::EventHandler implementation. | 122 // ClientSession::EventHandler implementation. |
123 virtual void OnSessionAuthenticating(ClientSession* client) override; | 123 void OnSessionAuthenticating(ClientSession* client) override; |
124 virtual bool OnSessionAuthenticated(ClientSession* client) override; | 124 bool OnSessionAuthenticated(ClientSession* client) override; |
125 virtual void OnSessionChannelsConnected(ClientSession* client) override; | 125 void OnSessionChannelsConnected(ClientSession* client) override; |
126 virtual void OnSessionAuthenticationFailed(ClientSession* client) override; | 126 void OnSessionAuthenticationFailed(ClientSession* client) override; |
127 virtual void OnSessionClosed(ClientSession* session) override; | 127 void OnSessionClosed(ClientSession* session) override; |
128 virtual void OnSessionRouteChange( | 128 void OnSessionRouteChange(ClientSession* session, |
129 ClientSession* session, | 129 const std::string& channel_name, |
130 const std::string& channel_name, | 130 const protocol::TransportRoute& route) override; |
131 const protocol::TransportRoute& route) override; | |
132 | 131 |
133 // SessionManager::Listener implementation. | 132 // SessionManager::Listener implementation. |
134 virtual void OnSessionManagerReady() override; | 133 void OnSessionManagerReady() override; |
135 virtual void OnIncomingSession( | 134 void OnIncomingSession( |
136 protocol::Session* session, | 135 protocol::Session* session, |
137 protocol::SessionManager::IncomingSessionResponse* response) override; | 136 protocol::SessionManager::IncomingSessionResponse* response) override; |
138 | 137 |
139 // Gets the candidate configuration for the protocol. | 138 // Gets the candidate configuration for the protocol. |
140 const protocol::CandidateSessionConfig* protocol_config() const { | 139 const protocol::CandidateSessionConfig* protocol_config() const { |
141 return protocol_config_.get(); | 140 return protocol_config_.get(); |
142 } | 141 } |
143 | 142 |
144 // Sets desired configuration for the protocol. Must be called before Start(). | 143 // Sets desired configuration for the protocol. Must be called before Start(). |
145 void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config); | 144 void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 HostExtensionList extensions_; | 216 HostExtensionList extensions_; |
218 | 217 |
219 base::WeakPtrFactory<ChromotingHost> weak_factory_; | 218 base::WeakPtrFactory<ChromotingHost> weak_factory_; |
220 | 219 |
221 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 220 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
222 }; | 221 }; |
223 | 222 |
224 } // namespace remoting | 223 } // namespace remoting |
225 | 224 |
226 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 225 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
OLD | NEW |