Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: remoting/host/simple_host_process.cc

Issue 10873050: [Chromoting] Hook up host talkgadget policy checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move callback Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // This is an application of a minimal host process in a Chromoting 5 // This is an application of a minimal host process in a Chromoting
6 // system. It serves the purpose of gluing different pieces together 6 // system. It serves the purpose of gluing different pieces together
7 // to make a functional host process for testing. 7 // to make a functional host process for testing.
8 // 8 //
9 // It peforms the following functionality: 9 // It peforms the following functionality:
10 // 1. Connect to the GTalk network and register the machine as a host. 10 // 1. Connect to the GTalk network and register the machine as a host.
(...skipping 20 matching lines...) Expand all
31 #include "base/threading/thread.h" 31 #include "base/threading/thread.h"
32 #include "crypto/nss_util.h" 32 #include "crypto/nss_util.h"
33 #include "net/base/network_change_notifier.h" 33 #include "net/base/network_change_notifier.h"
34 #include "net/socket/ssl_server_socket.h" 34 #include "net/socket/ssl_server_socket.h"
35 #include "remoting/base/constants.h" 35 #include "remoting/base/constants.h"
36 #include "remoting/host/audio_capturer.h" 36 #include "remoting/host/audio_capturer.h"
37 #include "remoting/host/chromoting_host_context.h" 37 #include "remoting/host/chromoting_host_context.h"
38 #include "remoting/host/chromoting_host.h" 38 #include "remoting/host/chromoting_host.h"
39 #include "remoting/host/constants.h" 39 #include "remoting/host/constants.h"
40 #include "remoting/host/desktop_environment.h" 40 #include "remoting/host/desktop_environment.h"
41 #include "remoting/host/dns_blackhole_checker.h"
41 #include "remoting/host/event_executor.h" 42 #include "remoting/host/event_executor.h"
42 #include "remoting/host/heartbeat_sender.h" 43 #include "remoting/host/heartbeat_sender.h"
43 #include "remoting/host/host_key_pair.h" 44 #include "remoting/host/host_key_pair.h"
44 #include "remoting/host/host_secret.h" 45 #include "remoting/host/host_secret.h"
45 #include "remoting/host/it2me_host_user_interface.h" 46 #include "remoting/host/it2me_host_user_interface.h"
46 #include "remoting/host/json_host_config.h" 47 #include "remoting/host/json_host_config.h"
47 #include "remoting/host/log_to_server.h" 48 #include "remoting/host/log_to_server.h"
48 #include "remoting/host/network_settings.h" 49 #include "remoting/host/network_settings.h"
49 #include "remoting/host/register_support_host_request.h" 50 #include "remoting/host/register_support_host_request.h"
50 #include "remoting/host/session_manager_factory.h" 51 #include "remoting/host/session_manager_factory.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 std::string home_path; 214 std::string home_path;
214 env->GetVar(base::env_vars::kHome, &home_path); 215 env->GetVar(base::env_vars::kHome, &home_path);
215 return FilePath(home_path).Append(kDefaultConfigPath); 216 return FilePath(home_path).Append(kDefaultConfigPath);
216 #endif 217 #endif
217 } 218 }
218 219
219 void StartHost() { 220 void StartHost() {
220 signal_strategy_.reset(new XmppSignalStrategy( 221 signal_strategy_.reset(new XmppSignalStrategy(
221 context_.url_request_context_getter(), 222 context_.url_request_context_getter(),
222 xmpp_login_, xmpp_auth_token_, xmpp_auth_service_)); 223 xmpp_login_, xmpp_auth_token_, xmpp_auth_service_));
224 dns_blackhole_checker_.reset(new DnsBlackholeChecker(
225 &context_, kDefaultHostTalkGadgetPrefix));
223 signaling_connector_.reset(new SignalingConnector( 226 signaling_connector_.reset(new SignalingConnector(
224 signal_strategy_.get(), 227 signal_strategy_.get(), &context_, dns_blackhole_checker_.get(),
225 base::Bind(&SimpleHost::OnAuthFailed, base::Unretained(this)))); 228 base::Bind(&SimpleHost::OnAuthFailed, base::Unretained(this))));
226 229
227 if (fake_) { 230 if (fake_) {
228 scoped_ptr<VideoFrameCapturer> capturer(new VideoFrameCapturerFake()); 231 scoped_ptr<VideoFrameCapturer> capturer(new VideoFrameCapturerFake());
229 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create( 232 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create(
230 context_.desktop_task_runner(), 233 context_.desktop_task_runner(),
231 context_.ui_task_runner()); 234 context_.ui_task_runner());
232 scoped_ptr<AudioCapturer> audio_capturer(NULL); 235 scoped_ptr<AudioCapturer> audio_capturer(NULL);
233 desktop_environment_ = DesktopEnvironment::CreateFake( 236 desktop_environment_ = DesktopEnvironment::CreateFake(
234 &context_, 237 &context_,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 300 }
298 301
299 void OnShutdownFinished() { 302 void OnShutdownFinished() {
300 DCHECK(context_.network_task_runner()->BelongsToCurrentThread()); 303 DCHECK(context_.network_task_runner()->BelongsToCurrentThread());
301 304
302 // Destroy networking objects while we are on the network thread. 305 // Destroy networking objects while we are on the network thread.
303 host_ = NULL; 306 host_ = NULL;
304 log_to_server_.reset(); 307 log_to_server_.reset();
305 heartbeat_sender_.reset(); 308 heartbeat_sender_.reset();
306 signaling_connector_.reset(); 309 signaling_connector_.reset();
310 dns_blackhole_checker_.reset();
307 signal_strategy_.reset(); 311 signal_strategy_.reset();
308 312
309 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); 313 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
310 } 314 }
311 315
312 MessageLoop message_loop_; 316 MessageLoop message_loop_;
313 ChromotingHostContext context_; 317 ChromotingHostContext context_;
314 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; 318 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
315 319
316 FilePath config_path_; 320 FilePath config_path_;
317 bool fake_; 321 bool fake_;
318 bool is_it2me_; 322 bool is_it2me_;
319 NetworkSettings network_settings_; 323 NetworkSettings network_settings_;
320 scoped_ptr<CandidateSessionConfig> protocol_config_; 324 scoped_ptr<CandidateSessionConfig> protocol_config_;
321 325
322 std::string host_id_; 326 std::string host_id_;
323 HostKeyPair key_pair_; 327 HostKeyPair key_pair_;
324 protocol::SharedSecretHash host_secret_hash_; 328 protocol::SharedSecretHash host_secret_hash_;
325 std::string xmpp_login_; 329 std::string xmpp_login_;
326 std::string xmpp_auth_token_; 330 std::string xmpp_auth_token_;
327 std::string xmpp_auth_service_; 331 std::string xmpp_auth_service_;
328 332
329 scoped_ptr<XmppSignalStrategy> signal_strategy_; 333 scoped_ptr<XmppSignalStrategy> signal_strategy_;
334 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker_;
330 scoped_ptr<SignalingConnector> signaling_connector_; 335 scoped_ptr<SignalingConnector> signaling_connector_;
331 scoped_ptr<DesktopEnvironment> desktop_environment_; 336 scoped_ptr<DesktopEnvironment> desktop_environment_;
332 scoped_ptr<LogToServer> log_to_server_; 337 scoped_ptr<LogToServer> log_to_server_;
333 scoped_ptr<It2MeHostUserInterface> it2me_host_user_interface_; 338 scoped_ptr<It2MeHostUserInterface> it2me_host_user_interface_;
334 scoped_ptr<RegisterSupportHostRequest> register_request_; 339 scoped_ptr<RegisterSupportHostRequest> register_request_;
335 scoped_ptr<HeartbeatSender> heartbeat_sender_; 340 scoped_ptr<HeartbeatSender> heartbeat_sender_;
336 341
337 scoped_refptr<ChromotingHost> host_; 342 scoped_refptr<ChromotingHost> host_;
338 343
339 bool shutting_down_; 344 bool shutting_down_;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 max_port < 0 || max_port > 65535) { 437 max_port < 0 || max_port > 65535) {
433 LOG(ERROR) << "Invalid max-port value: " << max_port 438 LOG(ERROR) << "Invalid max-port value: " << max_port
434 << ". Expected integer in range [0, 65535]."; 439 << ". Expected integer in range [0, 65535].";
435 return 1; 440 return 1;
436 } 441 }
437 simple_host.network_settings()->max_port = max_port; 442 simple_host.network_settings()->max_port = max_port;
438 } 443 }
439 444
440 return simple_host.Run(); 445 return simple_host.Run();
441 } 446 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698