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 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "remoting/host/constants.h" | 26 #include "remoting/host/constants.h" |
27 #include "remoting/host/capturer.h" | 27 #include "remoting/host/capturer.h" |
28 #include "remoting/host/chromoting_host.h" | 28 #include "remoting/host/chromoting_host.h" |
29 #include "remoting/host/chromoting_host_context.h" | 29 #include "remoting/host/chromoting_host_context.h" |
30 #include "remoting/host/desktop_environment.h" | 30 #include "remoting/host/desktop_environment.h" |
31 #include "remoting/host/event_executor.h" | 31 #include "remoting/host/event_executor.h" |
32 #include "remoting/host/heartbeat_sender.h" | 32 #include "remoting/host/heartbeat_sender.h" |
33 #include "remoting/host/host_config.h" | 33 #include "remoting/host/host_config.h" |
34 #include "remoting/host/host_event_logger.h" | 34 #include "remoting/host/host_event_logger.h" |
35 #include "remoting/host/host_user_interface.h" | 35 #include "remoting/host/host_user_interface.h" |
36 #include "remoting/host/jingle_session_manager_factory.h" | |
36 #include "remoting/host/json_host_config.h" | 37 #include "remoting/host/json_host_config.h" |
37 #include "remoting/host/log_to_server.h" | 38 #include "remoting/host/log_to_server.h" |
39 #include "remoting/host/network_settings.h" | |
38 #include "remoting/host/policy_hack/nat_policy.h" | 40 #include "remoting/host/policy_hack/nat_policy.h" |
39 #include "remoting/host/signaling_connector.h" | 41 #include "remoting/host/signaling_connector.h" |
40 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 42 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
41 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 43 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
42 | 44 |
43 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
44 #include "base/mac/scoped_nsautorelease_pool.h" | 46 #include "base/mac/scoped_nsautorelease_pool.h" |
45 #include "remoting/host/sighup_listener_mac.h" | 47 #include "remoting/host/sighup_listener_mac.h" |
46 #endif | 48 #endif |
47 // N.B. OS_WIN is defined by including src/base headers. | 49 // N.B. OS_WIN is defined by including src/base headers. |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 NetworkSettings network_settings( | 376 NetworkSettings network_settings( |
375 allow_nat_traversal_ ? | 377 allow_nat_traversal_ ? |
376 NetworkSettings::NAT_TRAVERSAL_ENABLED : | 378 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
377 NetworkSettings::NAT_TRAVERSAL_DISABLED); | 379 NetworkSettings::NAT_TRAVERSAL_DISABLED); |
378 if (!allow_nat_traversal_) { | 380 if (!allow_nat_traversal_) { |
379 network_settings.min_port = kMinPortNumber; | 381 network_settings.min_port = kMinPortNumber; |
380 network_settings.max_port = kMaxPortNumber; | 382 network_settings.max_port = kMaxPortNumber; |
381 } | 383 } |
382 | 384 |
383 host_ = new ChromotingHost( | 385 host_ = new ChromotingHost( |
384 context_.get(), signal_strategy_.get(), desktop_environment_.get(), | 386 context_.get(), |
385 network_settings); | 387 signal_strategy_.get(), |
388 desktop_environment_.get(), | |
Sergey Ulanov
2012/06/13 01:57:19
keep these arguments on one line?
simonmorris
2012/06/13 16:26:33
Done.
| |
389 JingleSessionManagerFactory::CreateSessionManager( | |
390 network_settings, | |
391 context_->url_request_context_getter())); | |
386 | 392 |
387 heartbeat_sender_.reset(new HeartbeatSender( | 393 heartbeat_sender_.reset(new HeartbeatSender( |
388 this, host_id_, signal_strategy_.get(), &key_pair_)); | 394 this, host_id_, signal_strategy_.get(), &key_pair_)); |
389 | 395 |
390 log_to_server_.reset( | 396 log_to_server_.reset( |
391 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 397 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
392 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 398 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
393 | 399 |
394 #if defined(OS_MACOSX) || defined(OS_WIN) | 400 #if defined(OS_MACOSX) || defined(OS_WIN) |
395 host_user_interface_->Start( | 401 host_user_interface_->Start( |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
567 | 573 |
568 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. | 574 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. |
569 SetProcessDPIAware(); | 575 SetProcessDPIAware(); |
570 | 576 |
571 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 577 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
572 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 578 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
573 return main(0, NULL); | 579 return main(0, NULL); |
574 } | 580 } |
575 | 581 |
576 #endif // defined(OS_WIN) | 582 #endif // defined(OS_WIN) |
OLD | NEW |