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

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

Issue 10237012: Don't read Linux host configuration if binary is not on path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addres comment. 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/plugin/daemon_controller.h ('k') | no next file » | 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 5083785347e150e5f1da694afe4630a319c34507..52afb0c2bc285a85223a3c8d9d04f63bad114a88 100644
--- a/remoting/host/plugin/daemon_controller_linux.cc
+++ b/remoting/host/plugin/daemon_controller_linux.cc
@@ -192,17 +192,23 @@ FilePath DaemonControllerLinux::GetConfigPath() {
}
void DaemonControllerLinux::DoGetConfig(const GetConfigCallback& callback) {
- JsonHostConfig config(GetConfigPath());
- scoped_ptr<base::DictionaryValue> result;
- if (config.Read()) {
- result.reset(new base::DictionaryValue());
-
- std::string value;
- if (config.GetString(kHostIdConfigPath, &value))
- result->SetString(kHostIdConfigPath, value);
- if (config.GetString(kXmppLoginConfigPath, &value))
- result->SetString(kXmppLoginConfigPath, value);
+ scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue());
+
+ if (GetState() != remoting::DaemonController::STATE_NOT_IMPLEMENTED) {
+ JsonHostConfig config(GetConfigPath());
+ if (config.Read()) {
+ std::string value;
+ if (config.GetString(kHostIdConfigPath, &value)) {
+ result->SetString(kHostIdConfigPath, value);
+ }
+ if (config.GetString(kXmppLoginConfigPath, &value)) {
+ result->SetString(kXmppLoginConfigPath, value);
+ }
+ } else {
+ result.reset(); // Return NULL in case of error.
+ }
}
+
callback.Run(result.Pass());
}
« no previous file with comments | « remoting/host/plugin/daemon_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698