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

Unified Diff: remoting/host/composite_host_config.cc

Issue 10831184: Fix Me2Me host to properly reload config when it changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/composite_host_config.h ('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/composite_host_config.cc
diff --git a/remoting/host/composite_host_config.cc b/remoting/host/composite_host_config.cc
index cf130a9decf7271055cfac4fe7856e0554322a6e..01f456fa81d3319571a14c3d9b709eb21e297f0d 100644
--- a/remoting/host/composite_host_config.cc
+++ b/remoting/host/composite_host_config.cc
@@ -14,18 +14,22 @@ CompositeHostConfig::CompositeHostConfig() {
CompositeHostConfig::~CompositeHostConfig() {
}
-bool CompositeHostConfig::AddConfigPath(const FilePath& path) {
- scoped_ptr<JsonHostConfig> config(new JsonHostConfig(path));
- if (!config->Read()) {
- return false;
+void CompositeHostConfig::AddConfigPath(const FilePath& path) {
+ configs_.push_back(new JsonHostConfig(path));
+}
+
+bool CompositeHostConfig::Read() {
+ bool result = true;
+ for (ScopedVector<JsonHostConfig>::iterator it = configs_.begin();
+ it != configs_.end(); ++it) {
+ result = result && (*it)->Read();
}
- configs_.push_back(config.release());
- return true;
+ return result;
}
bool CompositeHostConfig::GetString(const std::string& path,
std::string* out_value) const {
- for (std::vector<HostConfig*>::const_iterator it = configs_.begin();
+ for (ScopedVector<JsonHostConfig>::const_iterator it = configs_.begin();
it != configs_.end(); ++it) {
if ((*it)->GetString(path, out_value))
return true;
@@ -35,7 +39,7 @@ bool CompositeHostConfig::GetString(const std::string& path,
bool CompositeHostConfig::GetBoolean(const std::string& path,
bool* out_value) const {
- for (std::vector<HostConfig*>::const_iterator it = configs_.begin();
+ for (ScopedVector<JsonHostConfig>::const_iterator it = configs_.begin();
it != configs_.end(); ++it) {
if ((*it)->GetBoolean(path, out_value))
return true;
« no previous file with comments | « remoting/host/composite_host_config.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698