| 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 20 matching lines...) Expand all Loading... |
| 31 #include "remoting/host/chromoting_host.h" | 31 #include "remoting/host/chromoting_host.h" |
| 32 #include "remoting/host/chromoting_host_context.h" | 32 #include "remoting/host/chromoting_host_context.h" |
| 33 #include "remoting/host/desktop_environment.h" | 33 #include "remoting/host/desktop_environment.h" |
| 34 #include "remoting/host/event_executor.h" | 34 #include "remoting/host/event_executor.h" |
| 35 #include "remoting/host/heartbeat_sender.h" | 35 #include "remoting/host/heartbeat_sender.h" |
| 36 #include "remoting/host/host_config.h" | 36 #include "remoting/host/host_config.h" |
| 37 #include "remoting/host/host_event_logger.h" | 37 #include "remoting/host/host_event_logger.h" |
| 38 #include "remoting/host/host_user_interface.h" | 38 #include "remoting/host/host_user_interface.h" |
| 39 #include "remoting/host/json_host_config.h" | 39 #include "remoting/host/json_host_config.h" |
| 40 #include "remoting/host/log_to_server.h" | 40 #include "remoting/host/log_to_server.h" |
| 41 #include "remoting/host/network_settings.h" |
| 41 #include "remoting/host/policy_hack/nat_policy.h" | 42 #include "remoting/host/policy_hack/nat_policy.h" |
| 43 #include "remoting/host/session_manager_factory.h" |
| 42 #include "remoting/host/signaling_connector.h" | 44 #include "remoting/host/signaling_connector.h" |
| 43 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 45 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 44 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 46 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 45 | 47 |
| 46 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
| 47 #include "base/mac/scoped_nsautorelease_pool.h" | 49 #include "base/mac/scoped_nsautorelease_pool.h" |
| 48 #include "remoting/host/sighup_listener_mac.h" | 50 #include "remoting/host/sighup_listener_mac.h" |
| 49 #endif | 51 #endif |
| 50 // N.B. OS_WIN is defined by including src/base headers. | 52 // N.B. OS_WIN is defined by including src/base headers. |
| 51 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 allow_nat_traversal_ ? | 380 allow_nat_traversal_ ? |
| 379 NetworkSettings::NAT_TRAVERSAL_ENABLED : | 381 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
| 380 NetworkSettings::NAT_TRAVERSAL_DISABLED); | 382 NetworkSettings::NAT_TRAVERSAL_DISABLED); |
| 381 if (!allow_nat_traversal_) { | 383 if (!allow_nat_traversal_) { |
| 382 network_settings.min_port = kMinPortNumber; | 384 network_settings.min_port = kMinPortNumber; |
| 383 network_settings.max_port = kMaxPortNumber; | 385 network_settings.max_port = kMaxPortNumber; |
| 384 } | 386 } |
| 385 | 387 |
| 386 host_ = new ChromotingHost( | 388 host_ = new ChromotingHost( |
| 387 context_.get(), signal_strategy_.get(), desktop_environment_.get(), | 389 context_.get(), signal_strategy_.get(), desktop_environment_.get(), |
| 388 network_settings); | 390 CreateHostSessionManager(network_settings, |
| 391 context_->url_request_context_getter())); |
| 389 | 392 |
| 390 heartbeat_sender_.reset(new HeartbeatSender( | 393 heartbeat_sender_.reset(new HeartbeatSender( |
| 391 this, host_id_, signal_strategy_.get(), &key_pair_)); | 394 this, host_id_, signal_strategy_.get(), &key_pair_)); |
| 392 | 395 |
| 393 log_to_server_.reset( | 396 log_to_server_.reset( |
| 394 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 397 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
| 395 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 398 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
| 396 | 399 |
| 397 #if defined(OS_MACOSX) || defined(OS_WIN) | 400 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 398 host_user_interface_->Start( | 401 host_user_interface_->Start( |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 582 |
| 580 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. | 583 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. |
| 581 SetProcessDPIAware(); | 584 SetProcessDPIAware(); |
| 582 | 585 |
| 583 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 586 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 584 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 587 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 585 return main(0, NULL); | 588 return main(0, NULL); |
| 586 } | 589 } |
| 587 | 590 |
| 588 #endif // defined(OS_WIN) | 591 #endif // defined(OS_WIN) |
| OLD | NEW |