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

Unified Diff: remoting/host/plugin/daemon_controller_mac.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/json_host_config_unittest.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/plugin/daemon_controller_mac.cc
diff --git a/remoting/host/plugin/daemon_controller_mac.cc b/remoting/host/plugin/daemon_controller_mac.cc
index 5c2b9f9d0b5794b1641ea02898ab1646a76d78bb..be9d66bfe68bbed2a656654d3a373d2357e8a16b 100644
--- a/remoting/host/plugin/daemon_controller_mac.cc
+++ b/remoting/host/plugin/daemon_controller_mac.cc
@@ -136,19 +136,18 @@ void DaemonControllerMac::Stop(const CompletionCallback& done_callback) {
}
void DaemonControllerMac::DoGetConfig(const GetConfigCallback& callback) {
- JsonHostConfig host_config(FilePath(kHostConfigFile),
- base::MessageLoopProxy::current());
- host_config.Read();
-
- scoped_ptr<base::DictionaryValue> config(new base::DictionaryValue());
-
- const char* key = "host_id";
- std::string value;
- if (host_config.GetString(key, &value))
- config.get()->SetString(key, value);
- key = "xmpp_login";
- if (host_config.GetString(key, &value))
- config.get()->SetString(key, value);
+ FilePath config_path(kHostConfigFile);
+ JsonHostConfig host_config(config_path);
+ scoped_ptr<base::DictionaryValue> config;
+
+ if (host_config.Read()) {
+ config.reset(new base::DictionaryValue());
+ std::string value;
+ if (host_config.GetString(kHostIdConfigPath, &value))
+ config.get()->SetString(kHostIdConfigPath, value);
+ if (host_config.GetString(kXmppLoginConfigPath, &value))
+ config.get()->SetString(kXmppLoginConfigPath, value);
+ }
callback.Run(config.Pass());
}
« no previous file with comments | « remoting/host/json_host_config_unittest.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698