| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef REMOTING_BASE_SERVICE_URLS_H_ | 5 #ifndef REMOTING_BASE_SERVICE_URLS_H_ |
| 6 #define REMOTING_BASE_SERVICE_URLS_H_ | 6 #define REMOTING_BASE_SERVICE_URLS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 | 14 |
| 15 // This class contains the URLs to the services used by the host (except for | 15 // This class contains the URLs to the services used by the host (except for |
| 16 // Gaia, which has its own GaiaUrls class. In debug builds, it allows these URLs | 16 // Gaia, which has its own GaiaUrls class. In debug builds, it allows these URLs |
| 17 // to be overriden by command line switches, allowing the host process to be | 17 // to be overriden by command line switches, allowing the host process to be |
| 18 // pointed at alternate/test servers. | 18 // pointed at alternate/test servers. |
| 19 class ServiceUrls { | 19 class ServiceUrls { |
| 20 public: | 20 public: |
| 21 static ServiceUrls* GetInstance(); | 21 static ServiceUrls* GetInstance(); |
| 22 | 22 |
| 23 // Remoting directory REST API URLs. | 23 // Remoting directory REST API URLs. |
| 24 const std::string& directory_base_url() const; | 24 const std::string& directory_base_url() const { return directory_base_url_; } |
| 25 const std::string& directory_hosts_url() const; | 25 const std::string& directory_hosts_url() const { |
| 26 const std::string& gcd_base_url() const; | 26 return directory_hosts_url_; |
| 27 } |
| 28 const std::string& gcd_base_url() const { return gcd_base_url_; } |
| 27 | 29 |
| 28 // XMPP Server configuration. | 30 // XMPP Server configuration. |
| 29 const std::string& xmpp_server_address() const; | 31 const std::string& xmpp_server_address() const { |
| 30 const std::string& xmpp_server_address_for_me2me_host() const; | 32 return xmpp_server_address_; |
| 31 bool xmpp_server_use_tls() const; | 33 } |
| 34 const std::string& xmpp_server_address_for_me2me_host() const { |
| 35 return xmpp_server_address_for_me2me_host_; |
| 36 } |
| 37 bool xmpp_server_use_tls() const { return xmpp_server_use_tls_; } |
| 32 | 38 |
| 33 // Remoting directory bot JID (for registering hosts, logging, heartbeats). | 39 // Remoting directory bot JID (for registering hosts, logging, heartbeats). |
| 34 const std::string& directory_bot_jid() const; | 40 const std::string& directory_bot_jid() const { return directory_bot_jid_; } |
| 35 | 41 |
| 36 // JID for communicating with GCD. | 42 // JID for communicating with GCD. |
| 37 const std::string& gcd_jid() const; | 43 const std::string& gcd_jid() const { return gcd_jid_; } |
| 44 |
| 45 // ICE config URL. |
| 46 const std::string& ice_config_url() const { return ice_config_url_; } |
| 38 | 47 |
| 39 private: | 48 private: |
| 40 friend struct base::DefaultSingletonTraits<ServiceUrls>; | 49 friend struct base::DefaultSingletonTraits<ServiceUrls>; |
| 41 | 50 |
| 42 ServiceUrls(); | 51 ServiceUrls(); |
| 43 virtual ~ServiceUrls(); | 52 virtual ~ServiceUrls(); |
| 44 | 53 |
| 45 std::string directory_base_url_; | 54 std::string directory_base_url_; |
| 46 std::string directory_hosts_url_; | 55 std::string directory_hosts_url_; |
| 47 std::string gcd_base_url_; | 56 std::string gcd_base_url_; |
| 48 std::string xmpp_server_address_; | 57 std::string xmpp_server_address_; |
| 49 std::string xmpp_server_address_for_me2me_host_; | 58 std::string xmpp_server_address_for_me2me_host_; |
| 50 bool xmpp_server_use_tls_; | 59 bool xmpp_server_use_tls_; |
| 51 std::string directory_bot_jid_; | 60 std::string directory_bot_jid_; |
| 52 std::string gcd_jid_; | 61 std::string gcd_jid_; |
| 62 std::string ice_config_url_; |
| 53 | 63 |
| 54 DISALLOW_COPY_AND_ASSIGN(ServiceUrls); | 64 DISALLOW_COPY_AND_ASSIGN(ServiceUrls); |
| 55 }; | 65 }; |
| 56 | 66 |
| 57 } // namespace remoting | 67 } // namespace remoting |
| 58 | 68 |
| 59 #endif // REMOTING_BASE_SERVICE_URLS_H_ | 69 #endif // REMOTING_BASE_SERVICE_URLS_H_ |
| OLD | NEW |