Index: remoting/base/service_urls.cc |
diff --git a/remoting/base/service_urls.cc b/remoting/base/service_urls.cc |
index e235958eb710d011a84f05c4f85fbe641c7484b7..3ba940b12775a15a0fb3ab26f3ce8db9d988b6ca 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 |