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

Side by Side Diff: remoting/base/service_urls.cc

Issue 2779373003: Moving service urls to base. (Closed)
Patch Set: Updating moved file c dates. Created 3 years, 8 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
« no previous file with comments | « remoting/base/service_urls.h ('k') | remoting/host/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "remoting/host/service_urls.h" 5 #include "remoting/base/service_urls.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "google_apis/google_api_keys.h" 9 #include "google_apis/google_api_keys.h"
10 #include "remoting/signaling/remoting_bot.h" 10 #include "remoting/base/remoting_bot.h"
11 11
12 // Configurable service data. 12 // Configurable service data.
13 const char kDirectoryBaseUrl[] = "https://www.googleapis.com/chromoting/v1"; 13 const char kDirectoryBaseUrl[] = "https://www.googleapis.com/chromoting/v1";
14 const char kGcdBaseUrl[] = "https://www.googleapis.com/clouddevices/v1"; 14 const char kGcdBaseUrl[] = "https://www.googleapis.com/clouddevices/v1";
15 const char kXmppServerAddress[] = "talk.google.com:443"; 15 const char kXmppServerAddress[] = "talk.google.com:443";
16 const char kXmppServerAddressForMe2MeHost[] = "talk.google.com:5222"; 16 const char kXmppServerAddressForMe2MeHost[] = "talk.google.com:5222";
17 const bool kXmppServerUseTls = true; 17 const bool kXmppServerUseTls = true;
18 const char kGcdJid[] = "clouddevices.gserviceaccount.com"; 18 const char kGcdJid[] = "clouddevices.gserviceaccount.com";
19 const char kNetworkTraversalApiUrlBase[] = 19 const char kNetworkTraversalApiUrlBase[] =
20 "https://networktraversal.googleapis.com/v1alpha/iceconfig?key="; 20 "https://networktraversal.googleapis.com/v1alpha/iceconfig?key=";
(...skipping 22 matching lines...) Expand all
43 xmpp_server_use_tls_(kXmppServerUseTls), 43 xmpp_server_use_tls_(kXmppServerUseTls),
44 directory_bot_jid_(kRemotingBotJid), 44 directory_bot_jid_(kRemotingBotJid),
45 gcd_jid_(kGcdJid), 45 gcd_jid_(kGcdJid),
46 ice_config_url_(kNetworkTraversalApiUrlBase + 46 ice_config_url_(kNetworkTraversalApiUrlBase +
47 google_apis::GetRemotingAPIKey()) { 47 google_apis::GetRemotingAPIKey()) {
48 #if !defined(NDEBUG) 48 #if !defined(NDEBUG)
49 // Allow debug builds to override urls via command line. 49 // Allow debug builds to override urls via command line.
50 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 50 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
51 CHECK(command_line); 51 CHECK(command_line);
52 if (command_line->HasSwitch(kDirectoryBaseUrlSwitch)) { 52 if (command_line->HasSwitch(kDirectoryBaseUrlSwitch)) {
53 directory_base_url_ = command_line->GetSwitchValueASCII( 53 directory_base_url_ =
54 kDirectoryBaseUrlSwitch); 54 command_line->GetSwitchValueASCII(kDirectoryBaseUrlSwitch);
55 } 55 }
56 if (command_line->HasSwitch(kGcdBaseUrlSwitch)) { 56 if (command_line->HasSwitch(kGcdBaseUrlSwitch)) {
57 gcd_base_url_ = command_line->GetSwitchValueASCII(kGcdBaseUrlSwitch); 57 gcd_base_url_ = command_line->GetSwitchValueASCII(kGcdBaseUrlSwitch);
58 } 58 }
59 if (command_line->HasSwitch(kXmppServerAddressSwitch)) { 59 if (command_line->HasSwitch(kXmppServerAddressSwitch)) {
60 xmpp_server_address_ = command_line->GetSwitchValueASCII( 60 xmpp_server_address_ =
61 kXmppServerAddressSwitch); 61 command_line->GetSwitchValueASCII(kXmppServerAddressSwitch);
62 xmpp_server_address_for_me2me_host_ = xmpp_server_address_; 62 xmpp_server_address_for_me2me_host_ = xmpp_server_address_;
63 } 63 }
64 if (command_line->HasSwitch(kXmppServerDisableTlsSwitch)) { 64 if (command_line->HasSwitch(kXmppServerDisableTlsSwitch)) {
65 xmpp_server_use_tls_ = false; 65 xmpp_server_use_tls_ = false;
66 } 66 }
67 if (command_line->HasSwitch(kDirectoryBotJidSwitch)) { 67 if (command_line->HasSwitch(kDirectoryBotJidSwitch)) {
68 directory_bot_jid_ = command_line->GetSwitchValueASCII( 68 directory_bot_jid_ =
69 kDirectoryBotJidSwitch); 69 command_line->GetSwitchValueASCII(kDirectoryBotJidSwitch);
70 } 70 }
71 if (command_line->HasSwitch(kGcdJidSwitch)) { 71 if (command_line->HasSwitch(kGcdJidSwitch)) {
72 gcd_jid_ = command_line->GetSwitchValueASCII(kGcdJidSwitch); 72 gcd_jid_ = command_line->GetSwitchValueASCII(kGcdJidSwitch);
73 } 73 }
74 if (command_line->HasSwitch(kIceConfigUrl)) { 74 if (command_line->HasSwitch(kIceConfigUrl)) {
75 ice_config_url_ = command_line->GetSwitchValueASCII(kIceConfigUrl); 75 ice_config_url_ = command_line->GetSwitchValueASCII(kIceConfigUrl);
76 } 76 }
77 #endif // !defined(NDEBUG) 77 #endif // !defined(NDEBUG)
78 78
79 directory_hosts_url_ = directory_base_url_ + kDirectoryHostsSuffix; 79 directory_hosts_url_ = directory_base_url_ + kDirectoryHostsSuffix;
80 } 80 }
81 81
82 ServiceUrls::~ServiceUrls() {} 82 ServiceUrls::~ServiceUrls() {}
83 83
84 ServiceUrls* remoting::ServiceUrls::GetInstance() { 84 ServiceUrls* remoting::ServiceUrls::GetInstance() {
85 return base::Singleton<ServiceUrls>::get(); 85 return base::Singleton<ServiceUrls>::get();
86 } 86 }
87 87
88 } // namespace remoting 88 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/service_urls.h ('k') | remoting/host/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698