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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 base::Bind(&HostProcess::OnOAuthFailed, base::Unretained(this)), | 339 base::Bind(&HostProcess::OnOAuthFailed, base::Unretained(this)), |
340 context_->url_request_context_getter()); | 340 context_->url_request_context_getter()); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 if (!desktop_environment_.get()) { | 344 if (!desktop_environment_.get()) { |
345 desktop_environment_ = | 345 desktop_environment_ = |
346 DesktopEnvironment::CreateForService(context_.get()); | 346 DesktopEnvironment::CreateForService(context_.get()); |
347 } | 347 } |
348 | 348 |
349 NetworkSettings network_settings(allow_nat_traversal_); | 349 NetworkSettings network_settings( |
| 350 allow_nat_traversal_ ? |
| 351 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
| 352 NetworkSettings::NAT_TRAVERSAL_DISABLED); |
350 if (!allow_nat_traversal_) { | 353 if (!allow_nat_traversal_) { |
351 network_settings.min_port = kMinPortNumber; | 354 network_settings.min_port = kMinPortNumber; |
352 network_settings.max_port = kMaxPortNumber; | 355 network_settings.max_port = kMaxPortNumber; |
353 } | 356 } |
354 | 357 |
355 host_ = new ChromotingHost( | 358 host_ = new ChromotingHost( |
356 context_.get(), signal_strategy_.get(), desktop_environment_.get(), | 359 context_.get(), signal_strategy_.get(), desktop_environment_.get(), |
357 network_settings); | 360 network_settings); |
358 | 361 |
359 heartbeat_sender_.reset(new HeartbeatSender( | 362 heartbeat_sender_.reset(new HeartbeatSender( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 int CALLBACK WinMain(HINSTANCE instance, | 506 int CALLBACK WinMain(HINSTANCE instance, |
504 HINSTANCE previous_instance, | 507 HINSTANCE previous_instance, |
505 LPSTR command_line, | 508 LPSTR command_line, |
506 int show_command) { | 509 int show_command) { |
507 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 510 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
508 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 511 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
509 return main(0, NULL); | 512 return main(0, NULL); |
510 } | 513 } |
511 | 514 |
512 #endif // defined(OS_WIN) | 515 #endif // defined(OS_WIN) |
OLD | NEW |