Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 10868031: Limit the ports used by IT2Me when NAT traversal is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add explanation to NetworkSettings default port defines Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/plugin/host_script_object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const char kDaemonIpcSwitchName[] = "chromoting-ipc"; 79 const char kDaemonIpcSwitchName[] = "chromoting-ipc";
80 80
81 // These are used for parsing the config-file locations from the command line, 81 // These are used for parsing the config-file locations from the command line,
82 // and for defining the default locations if the switches are not present. 82 // and for defining the default locations if the switches are not present.
83 const char kAuthConfigSwitchName[] = "auth-config"; 83 const char kAuthConfigSwitchName[] = "auth-config";
84 const char kHostConfigSwitchName[] = "host-config"; 84 const char kHostConfigSwitchName[] = "host-config";
85 85
86 const FilePath::CharType kDefaultHostConfigFile[] = 86 const FilePath::CharType kDefaultHostConfigFile[] =
87 FILE_PATH_LITERAL("host.json"); 87 FILE_PATH_LITERAL("host.json");
88 88
89 const int kMinPortNumber = 12400;
90 const int kMaxPortNumber = 12409;
91
92 const char kUnofficialOAuth2ClientId[] = 89 const char kUnofficialOAuth2ClientId[] =
93 "440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.apps.googleusercontent.com"; 90 "440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.apps.googleusercontent.com";
94 const char kUnofficialOAuth2ClientSecret[] = "W2ieEsG-R1gIA4MMurGrgMc_"; 91 const char kUnofficialOAuth2ClientSecret[] = "W2ieEsG-R1gIA4MMurGrgMc_";
95 92
96 const char kOfficialOAuth2ClientId[] = 93 const char kOfficialOAuth2ClientId[] =
97 "440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.apps.googleusercontent.com"; 94 "440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.apps.googleusercontent.com";
98 const char kOfficialOAuth2ClientSecret[] = "Bgur6DFiOMM1h8x-AQpuTQlK"; 95 const char kOfficialOAuth2ClientSecret[] = "Bgur6DFiOMM1h8x-AQpuTQlK";
99 96
100 } // namespace 97 } // namespace
101 98
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 if (!desktop_environment_.get()) { 488 if (!desktop_environment_.get()) {
492 desktop_environment_ = 489 desktop_environment_ =
493 DesktopEnvironment::CreateForService(context_.get()); 490 DesktopEnvironment::CreateForService(context_.get());
494 } 491 }
495 492
496 NetworkSettings network_settings( 493 NetworkSettings network_settings(
497 allow_nat_traversal_ ? 494 allow_nat_traversal_ ?
498 NetworkSettings::NAT_TRAVERSAL_ENABLED : 495 NetworkSettings::NAT_TRAVERSAL_ENABLED :
499 NetworkSettings::NAT_TRAVERSAL_DISABLED); 496 NetworkSettings::NAT_TRAVERSAL_DISABLED);
500 if (!allow_nat_traversal_) { 497 if (!allow_nat_traversal_) {
501 network_settings.min_port = kMinPortNumber; 498 network_settings.min_port = NetworkSettings::kDefaultMinPort;
502 network_settings.max_port = kMaxPortNumber; 499 network_settings.max_port = NetworkSettings::kDefaultMaxPort;
503 } 500 }
504 501
505 host_ = new ChromotingHost( 502 host_ = new ChromotingHost(
506 context_.get(), signal_strategy_.get(), desktop_environment_.get(), 503 context_.get(), signal_strategy_.get(), desktop_environment_.get(),
507 CreateHostSessionManager(network_settings, 504 CreateHostSessionManager(network_settings,
508 context_->url_request_context_getter())); 505 context_->url_request_context_getter()));
509 506
510 // TODO(simonmorris): Get the maximum session duration from a policy. 507 // TODO(simonmorris): Get the maximum session duration from a policy.
511 #if defined(OS_LINUX) 508 #if defined(OS_LINUX)
512 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); 509 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20));
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 user32.GetFunctionPointer("SetProcessDPIAware")); 728 user32.GetFunctionPointer("SetProcessDPIAware"));
732 set_process_dpi_aware(); 729 set_process_dpi_aware();
733 } 730 }
734 731
735 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting 732 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
736 // the command line from GetCommandLineW(), so we can safely pass NULL here. 733 // the command line from GetCommandLineW(), so we can safely pass NULL here.
737 return main(0, NULL); 734 return main(0, NULL);
738 } 735 }
739 736
740 #endif // defined(OS_WIN) 737 #endif // defined(OS_WIN)
OLDNEW
« no previous file with comments | « remoting/host/plugin/host_script_object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698