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

Unified Diff: remoting/host/plugin/daemon_controller_linux.cc

Issue 10825124: Replace --explicit-config option in me2me_virtual_host.py with --silent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | remoting/tools/me2me_virtual_host.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/plugin/daemon_controller_linux.cc
diff --git a/remoting/host/plugin/daemon_controller_linux.cc b/remoting/host/plugin/daemon_controller_linux.cc
index 1bfdd7c5f65ad6f9ee020a705a3451b6d0a157ac..a7698653bce9842627cf4d8a7bb92f924c85c163 100644
--- a/remoting/host/plugin/daemon_controller_linux.cc
+++ b/remoting/host/plugin/daemon_controller_linux.cc
@@ -233,21 +233,35 @@ void DaemonControllerLinux::DoGetConfig(const GetConfigCallback& callback) {
void DaemonControllerLinux::DoSetConfigAndStart(
scoped_ptr<base::DictionaryValue> config,
- const CompletionCallback& done) {
+ const CompletionCallback& done_callback) {
+ JsonHostConfig config_file(GetConfigPath());
+ for (DictionaryValue::key_iterator key(config->begin_keys());
+ key != config->end_keys(); ++key) {
+ std::string value;
+ if (!config->GetString(*key, &value)) {
+ LOG(ERROR) << *key << " is not a string.";
+ done_callback.Run(RESULT_FAILED);
+ return;
+ }
+ config_file.SetString(*key, value);
+ }
+
+ bool success = config_file.Save();
+ if (!success) {
+ done_callback.Run(RESULT_FAILED);
+ return;
+ }
+
std::vector<std::string> args;
- args.push_back("--explicit-config");
- std::string config_json;
- base::JSONWriter::Write(config.get(), &config_json);
- args.push_back(config_json);
- std::vector<std::string> no_args;
- int exit_code = 0;
+ args.push_back("--silent");
AsyncResult result;
+ int exit_code;
if (RunScript(args, &exit_code)) {
result = (exit_code == 0) ? RESULT_OK : RESULT_FAILED;
} else {
result = RESULT_FAILED;
}
- done.Run(result);
+ done_callback.Run(result);
}
void DaemonControllerLinux::DoUpdateConfig(
@@ -264,6 +278,7 @@ void DaemonControllerLinux::DoUpdateConfig(
if (!config->GetString(*key, &value)) {
LOG(ERROR) << *key << " is not a string.";
done_callback.Run(RESULT_FAILED);
+ return;
}
config_file.SetString(*key, value);
}
« no previous file with comments | « no previous file | remoting/tools/me2me_virtual_host.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698