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 <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <string> | 10 #include <string> |
8 | 11 |
9 #include "base/bind.h" | 12 #include "base/bind.h" |
10 #include "base/callback.h" | 13 #include "base/callback.h" |
11 #include "base/command_line.h" | 14 #include "base/command_line.h" |
12 #include "base/debug/alias.h" | 15 #include "base/debug/alias.h" |
13 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
14 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
| 18 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop/message_loop.h" | 20 #include "base/message_loop/message_loop.h" |
17 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
20 #include "base/strings/stringize_macros.h" | 24 #include "base/strings/stringize_macros.h" |
21 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
22 #include "build/build_config.h" | 26 #include "build/build_config.h" |
23 #include "ipc/ipc_channel.h" | 27 #include "ipc/ipc_channel.h" |
24 #include "ipc/ipc_channel_proxy.h" | 28 #include "ipc/ipc_channel_proxy.h" |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 } | 1474 } |
1471 | 1475 |
1472 void HostProcess::StartHost() { | 1476 void HostProcess::StartHost() { |
1473 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1477 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1474 DCHECK(!host_); | 1478 DCHECK(!host_); |
1475 | 1479 |
1476 SetState(HOST_STARTED); | 1480 SetState(HOST_STARTED); |
1477 | 1481 |
1478 InitializeSignaling(); | 1482 InitializeSignaling(); |
1479 | 1483 |
1480 uint32 network_flags = 0; | 1484 uint32_t network_flags = 0; |
1481 if (allow_nat_traversal_) { | 1485 if (allow_nat_traversal_) { |
1482 network_flags = NetworkSettings::NAT_TRAVERSAL_STUN | | 1486 network_flags = NetworkSettings::NAT_TRAVERSAL_STUN | |
1483 NetworkSettings::NAT_TRAVERSAL_OUTGOING; | 1487 NetworkSettings::NAT_TRAVERSAL_OUTGOING; |
1484 if (allow_relay_) | 1488 if (allow_relay_) |
1485 network_flags |= NetworkSettings::NAT_TRAVERSAL_RELAY; | 1489 network_flags |= NetworkSettings::NAT_TRAVERSAL_RELAY; |
1486 } | 1490 } |
1487 | 1491 |
1488 NetworkSettings network_settings(network_flags); | 1492 NetworkSettings network_settings(network_flags); |
1489 | 1493 |
1490 if (!udp_port_range_.is_null()) { | 1494 if (!udp_port_range_.is_null()) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1752 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
1749 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); | 1753 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); |
1750 | 1754 |
1751 // Run the main (also UI) message loop until the host no longer needs it. | 1755 // Run the main (also UI) message loop until the host no longer needs it. |
1752 message_loop.Run(); | 1756 message_loop.Run(); |
1753 | 1757 |
1754 return exit_code; | 1758 return exit_code; |
1755 } | 1759 } |
1756 | 1760 |
1757 } // namespace remoting | 1761 } // namespace remoting |
OLD | NEW |