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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 std::string host_owner_email_; | 299 std::string host_owner_email_; |
300 bool use_service_account_; | 300 bool use_service_account_; |
301 bool enable_vp9_; | 301 bool enable_vp9_; |
302 int64_t frame_recorder_buffer_size_; | 302 int64_t frame_recorder_buffer_size_; |
303 | 303 |
304 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; | 304 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; |
305 std::string host_domain_; | 305 std::string host_domain_; |
306 bool host_username_match_required_; | 306 bool host_username_match_required_; |
307 bool allow_nat_traversal_; | 307 bool allow_nat_traversal_; |
308 bool allow_relay_; | 308 bool allow_relay_; |
309 int min_udp_port_; | 309 uint16 min_udp_port_; |
310 int max_udp_port_; | 310 uint16 max_udp_port_; |
311 std::string talkgadget_prefix_; | 311 std::string talkgadget_prefix_; |
312 bool allow_pairing_; | 312 bool allow_pairing_; |
313 | 313 |
314 bool curtain_required_; | 314 bool curtain_required_; |
315 ThirdPartyAuthConfig third_party_auth_config_; | 315 ThirdPartyAuthConfig third_party_auth_config_; |
316 bool enable_gnubby_auth_; | 316 bool enable_gnubby_auth_; |
317 | 317 |
318 // Boolean to change flow, where ncessary, if we're | 318 // Boolean to change flow, where ncessary, if we're |
319 // capturing a window instead of the entire desktop. | 319 // capturing a window instead of the entire desktop. |
320 bool enable_window_capture_; | 320 bool enable_window_capture_; |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 // Returns true if the host has to be restarted after this policy update. | 1060 // Returns true if the host has to be restarted after this policy update. |
1061 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1061 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1062 | 1062 |
1063 std::string udp_port_range; | 1063 std::string udp_port_range; |
1064 if (!policies->GetString(policy_hack::PolicyWatcher::kUdpPortRangePolicyName, | 1064 if (!policies->GetString(policy_hack::PolicyWatcher::kUdpPortRangePolicyName, |
1065 &udp_port_range)) { | 1065 &udp_port_range)) { |
1066 return false; | 1066 return false; |
1067 } | 1067 } |
1068 | 1068 |
1069 // Use default values if policy setting is empty or invalid. | 1069 // Use default values if policy setting is empty or invalid. |
1070 int min_udp_port = 0; | 1070 uint16 min_udp_port = 0; |
1071 int max_udp_port = 0; | 1071 uint16 max_udp_port = 0; |
1072 if (!udp_port_range.empty() && | 1072 if (!udp_port_range.empty() && |
1073 !NetworkSettings::ParsePortRange(udp_port_range, &min_udp_port, | 1073 !NetworkSettings::ParsePortRange(udp_port_range, &min_udp_port, |
1074 &max_udp_port)) { | 1074 &max_udp_port)) { |
1075 LOG(WARNING) << "Invalid port range policy: \"" << udp_port_range | 1075 LOG(WARNING) << "Invalid port range policy: \"" << udp_port_range |
1076 << "\". Using default values."; | 1076 << "\". Using default values."; |
1077 } | 1077 } |
1078 | 1078 |
1079 if (min_udp_port_ != min_udp_port || max_udp_port_ != max_udp_port) { | 1079 if (min_udp_port_ != min_udp_port || max_udp_port_ != max_udp_port) { |
1080 if (min_udp_port != 0 && max_udp_port != 0) { | 1080 if (min_udp_port != 0 && max_udp_port != 0) { |
1081 HOST_LOG << "Policy restricts UDP port range to [" << min_udp_port | 1081 HOST_LOG << "Policy restricts UDP port range to [" << min_udp_port |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 int exit_code = kSuccessExitCode; | 1476 int exit_code = kSuccessExitCode; |
1477 new HostProcess(context.Pass(), &exit_code); | 1477 new HostProcess(context.Pass(), &exit_code); |
1478 | 1478 |
1479 // Run the main (also UI) message loop until the host no longer needs it. | 1479 // Run the main (also UI) message loop until the host no longer needs it. |
1480 message_loop.Run(); | 1480 message_loop.Run(); |
1481 | 1481 |
1482 return exit_code; | 1482 return exit_code; |
1483 } | 1483 } |
1484 | 1484 |
1485 } // namespace remoting | 1485 } // namespace remoting |
OLD | NEW |