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

Unified Diff: remoting/host/simple_host_process.cc

Issue 10007048: Cleanup and simplify HostConfig and JsonHostConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/simple_host_process.cc
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index 2818eeadb7d106028f9af9fc1f2da56a2cba25c2..f37d7a979077543847a97c3c11f3a73e1d2cd122 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -104,15 +104,14 @@ class SimpleHost {
int Run() {
FilePath config_path = GetConfigPath();
- scoped_refptr<JsonHostConfig> config = new JsonHostConfig(
- config_path, file_io_thread_.message_loop_proxy());
- if (!config->Read()) {
+ JsonHostConfig config(config_path);
+ if (!config.Read()) {
LOG(ERROR) << "Failed to read configuration file "
<< config_path.value();
return 1;
}
- if (!config->GetString(kHostIdConfigPath, &host_id_)) {
+ if (!config.GetString(kHostIdConfigPath, &host_id_)) {
LOG(ERROR) << "host_id is not defined in the config.";
return 1;
}
@@ -122,8 +121,8 @@ class SimpleHost {
}
std::string host_secret_hash_string;
- if (!config->GetString(kHostSecretHashConfigPath,
- &host_secret_hash_string)) {
+ if (!config.GetString(kHostSecretHashConfigPath,
+ &host_secret_hash_string)) {
host_secret_hash_string = "plain:";
}
@@ -133,12 +132,12 @@ class SimpleHost {
}
// Use an XMPP connection to the Talk network for session signalling.
- if (!config->GetString(kXmppLoginConfigPath, &xmpp_login_) ||
- !config->GetString(kXmppAuthTokenConfigPath, &xmpp_auth_token_)) {
+ if (!config.GetString(kXmppLoginConfigPath, &xmpp_login_) ||
+ !config.GetString(kXmppAuthTokenConfigPath, &xmpp_auth_token_)) {
LOG(ERROR) << "XMPP credentials are not defined in the config.";
return 1;
}
- if (!config->GetString(kXmppAuthServiceConfigPath, &xmpp_auth_service_)) {
+ if (!config.GetString(kXmppAuthServiceConfigPath, &xmpp_auth_service_)) {
// For the simple host, we assume we always use the ClientLogin token for
// chromiumsync because we do not have an HTTP stack with which we can
// easily request an OAuth2 access token even if we had a RefreshToken for
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698