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

Side by Side Diff: remoting/host/in_memory_host_config.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/in_memory_host_config.h ('k') | remoting/host/json_host_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/values.h" 8 #include "base/values.h"
8 9
9 namespace remoting { 10 namespace remoting {
10 11
11 InMemoryHostConfig::InMemoryHostConfig() 12 InMemoryHostConfig::InMemoryHostConfig()
12 : values_(new DictionaryValue()) { 13 : values_(new DictionaryValue()) {
13 } 14 }
14 15
15 InMemoryHostConfig::~InMemoryHostConfig() {} 16 InMemoryHostConfig::~InMemoryHostConfig() {}
16 17
17 bool InMemoryHostConfig::GetString(const std::string& path, 18 bool InMemoryHostConfig::GetString(const std::string& path,
18 std::string* out_value) { 19 std::string* out_value) const {
19 base::AutoLock auto_lock(lock_); 20 DCHECK(CalledOnValidThread());
20 return values_->GetString(path, out_value); 21 return values_->GetString(path, out_value);
21 } 22 }
22 23
23 bool InMemoryHostConfig::GetBoolean(const std::string& path, bool* out_value) { 24 bool InMemoryHostConfig::GetBoolean(const std::string& path,
24 base::AutoLock auto_lock(lock_); 25 bool* out_value) const {
26 DCHECK(CalledOnValidThread());
25 return values_->GetBoolean(path, out_value); 27 return values_->GetBoolean(path, out_value);
26 } 28 }
27 29
28 void InMemoryHostConfig::Save() { 30 bool InMemoryHostConfig::Save() {
29 // Save is NOP for in-memory host config. 31 // Saving in-memory host config is not supported.
32 NOTREACHED();
33 return false;
30 } 34 }
31 35
32 void InMemoryHostConfig::SetString(const std::string& path, 36 void InMemoryHostConfig::SetString(const std::string& path,
33 const std::string& in_value) { 37 const std::string& in_value) {
34 base::AutoLock auto_lock(lock_); 38 DCHECK(CalledOnValidThread());
35 values_->SetString(path, in_value); 39 values_->SetString(path, in_value);
36 } 40 }
37 41
38 void InMemoryHostConfig::SetBoolean(const std::string& path, bool in_value) { 42 void InMemoryHostConfig::SetBoolean(const std::string& path, bool in_value) {
39 base::AutoLock auto_lock(lock_); 43 DCHECK(CalledOnValidThread());
40 values_->SetBoolean(path, in_value); 44 values_->SetBoolean(path, in_value);
41 } 45 }
42 46
43 } // namespace remoting 47 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/in_memory_host_config.h ('k') | remoting/host/json_host_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698