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

Side by Side Diff: remoting/host/in_memory_host_config.cc

Issue 10824286: Fix DaemonControllerLinux::SetConfigAndStart() to reload config automatically. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/in_memory_host_config.h" 5 #include "remoting/host/in_memory_host_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 9
10 namespace remoting { 10 namespace remoting {
(...skipping 26 matching lines...) Expand all
37 const std::string& in_value) { 37 const std::string& in_value) {
38 DCHECK(CalledOnValidThread()); 38 DCHECK(CalledOnValidThread());
39 values_->SetString(path, in_value); 39 values_->SetString(path, in_value);
40 } 40 }
41 41
42 void InMemoryHostConfig::SetBoolean(const std::string& path, bool in_value) { 42 void InMemoryHostConfig::SetBoolean(const std::string& path, bool in_value) {
43 DCHECK(CalledOnValidThread()); 43 DCHECK(CalledOnValidThread());
44 values_->SetBoolean(path, in_value); 44 values_->SetBoolean(path, in_value);
45 } 45 }
46 46
47 bool InMemoryHostConfig::CopyFrom(const base::DictionaryValue* dictionary) {
48 bool result = true;
49
50 for (DictionaryValue::key_iterator key(dictionary->begin_keys());
51 key != dictionary->end_keys(); ++key) {
52 std::string str_value;
53 bool bool_value;
54 if (dictionary->GetString(*key, &str_value)) {
55 SetString(*key, str_value);
56 } else if (dictionary->GetBoolean(*key, &bool_value)) {
Jamie 2012/08/13 23:44:31 The code this is based on didn't handle Boolean va
Sergey Ulanov 2012/08/14 18:00:37 We use boolean only for oauth_use_official_client_
57 SetBoolean(*key, bool_value);
58 } else {
59 result = false;
60 }
61 }
62
63 return result;
64 }
65
47 } // namespace remoting 66 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698