diff options
author | sergeyu <sergeyu@chromium.org> | 2016-03-16 13:40:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-16 20:42:08 +0000 |
commit | e8e7cb43534bb63ce2972cc0a51f614cda15db3f (patch) | |
tree | 9984c03a77bc0d6502a9e14df95d913339249734 /remoting/base/service_urls.cc | |
parent | b5022da0db55451ec2f7f77230a385ca0ff4bd81 (diff) | |
download | chromium_src-e8e7cb43534bb63ce2972cc0a51f614cda15db3f.zip chromium_src-e8e7cb43534bb63ce2972cc0a51f614cda15db3f.tar.gz chromium_src-e8e7cb43534bb63ce2972cc0a51f614cda15db3f.tar.bz2 |
Enable TURN on the host when using WebRTC.
BUG=577954
Review URL: https://codereview.chromium.org/1800893002
Cr-Commit-Position: refs/heads/master@{#381520}
Diffstat (limited to 'remoting/base/service_urls.cc')
-rw-r--r-- | remoting/base/service_urls.cc | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/remoting/base/service_urls.cc b/remoting/base/service_urls.cc index e235958..3ba940b 100644 --- a/remoting/base/service_urls.cc +++ b/remoting/base/service_urls.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/logging.h" +#include "google_apis/google_api_keys.h" // Configurable service data. const char kDirectoryBaseUrl[] = "https://www.googleapis.com/chromoting/v1"; @@ -15,6 +16,8 @@ const char kXmppServerAddressForMe2MeHost[] = "talk.google.com:5222"; const bool kXmppServerUseTls = true; const char kDirectoryBotJid[] = "remoting@bot.talk.google.com"; const char kGcdJid[] = "clouddevices.gserviceaccount.com"; +const char kNetworkTraversalApiUrlBase[] = + "https://networktraversal.googleapis.com/v1alpha/iceconfig?key="; // Command line switches. #if !defined(NDEBUG) @@ -24,6 +27,7 @@ const char kXmppServerAddressSwitch[] = "xmpp-server-address"; const char kXmppServerDisableTlsSwitch[] = "disable-xmpp-server-tls"; const char kDirectoryBotJidSwitch[] = "directory-bot-jid"; const char kGcdJidSwitch[] = "gcd-jid"; +const char kIceConfigUrl[] = "ice_config_url"; #endif // !defined(NDEBUG) // Non-configurable service paths. @@ -38,7 +42,9 @@ ServiceUrls::ServiceUrls() xmpp_server_address_for_me2me_host_(kXmppServerAddressForMe2MeHost), xmpp_server_use_tls_(kXmppServerUseTls), directory_bot_jid_(kDirectoryBotJid), - gcd_jid_(kGcdJid) { + gcd_jid_(kGcdJid), + ice_config_url_(kNetworkTraversalApiUrlBase + + google_apis::GetRemotingAPIKey()) { #if !defined(NDEBUG) // Allow debug builds to override urls via command line. base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -65,48 +71,18 @@ ServiceUrls::ServiceUrls() if (command_line->HasSwitch(kGcdJidSwitch)) { gcd_jid_ = command_line->GetSwitchValueASCII(kGcdJidSwitch); } + if (command_line->HasSwitch(kIceConfigUrl)) { + ice_config_url_ = command_line->GetSwitchValueASCII(kIceConfigUrl); + } #endif // !defined(NDEBUG) directory_hosts_url_ = directory_base_url_ + kDirectoryHostsSuffix; } -ServiceUrls::~ServiceUrls() { -} +ServiceUrls::~ServiceUrls() {} ServiceUrls* remoting::ServiceUrls::GetInstance() { return base::Singleton<ServiceUrls>::get(); } -const std::string& ServiceUrls::directory_base_url() const { - return directory_base_url_; -} - -const std::string& ServiceUrls::directory_hosts_url() const { - return directory_hosts_url_; -} - -const std::string& ServiceUrls::gcd_base_url() const { - return gcd_base_url_; -} - -const std::string& ServiceUrls::xmpp_server_address() const { - return xmpp_server_address_; -} - -const std::string& ServiceUrls::xmpp_server_address_for_me2me_host() const { - return xmpp_server_address_for_me2me_host_; -} - -bool ServiceUrls::xmpp_server_use_tls() const { - return xmpp_server_use_tls_; -} - -const std::string& ServiceUrls::directory_bot_jid() const { - return directory_bot_jid_; -} - -const std::string& ServiceUrls::gcd_jid() const { - return directory_bot_jid_; -} - } // namespace remoting |