summaryrefslogtreecommitdiffstats
path: root/remoting/host/in_memory_host_config.h
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-07 19:20:06 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-07 19:20:06 +0000
commit30224c162fbe39aa325248d116e2f02427ac7c8c (patch)
tree5fdca261c47f1e86a764e2ce6f8a661ac076ff7d /remoting/host/in_memory_host_config.h
parentb5457c7d515524938eafd6f0040f5a9bca7ddbbe (diff)
downloadchromium_src-30224c162fbe39aa325248d116e2f02427ac7c8c.zip
chromium_src-30224c162fbe39aa325248d116e2f02427ac7c8c.tar.gz
chromium_src-30224c162fbe39aa325248d116e2f02427ac7c8c.tar.bz2
Cleanup and simplify HostConfig and JsonHostConfig.
These classes were previously overdesigned. Simplifying them. - Config doesn't need to be ref-counted. - Save() is synchronous now. - Config is NonThreadSafe now. BUG=120950 Review URL: http://codereview.chromium.org/10007048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/in_memory_host_config.h')
-rw-r--r--remoting/host/in_memory_host_config.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/remoting/host/in_memory_host_config.h b/remoting/host/in_memory_host_config.h
index 4043e83..82b9f6f 100644
--- a/remoting/host/in_memory_host_config.h
+++ b/remoting/host/in_memory_host_config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,37 +7,36 @@
#include <string>
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/synchronization/lock.h"
+#include "base/threading/non_thread_safe.h"
#include "remoting/host/host_config.h"
namespace base {
class DictionaryValue;
-}
+} // namespace base
namespace remoting {
// In-memory host config. Used by unittests.
-class InMemoryHostConfig : public MutableHostConfig {
+class InMemoryHostConfig : public MutableHostConfig,
+ public base::NonThreadSafe {
public:
InMemoryHostConfig();
virtual ~InMemoryHostConfig();
// MutableHostConfig interface.
virtual bool GetString(const std::string& path,
- std::string* out_value) OVERRIDE;
- virtual bool GetBoolean(const std::string& path, bool* out_value) OVERRIDE;
+ std::string* out_value) const OVERRIDE;
+ virtual bool GetBoolean(const std::string& path,
+ bool* out_value) const OVERRIDE;
virtual void SetString(const std::string& path,
const std::string& in_value) OVERRIDE;
virtual void SetBoolean(const std::string& path, bool in_value) OVERRIDE;
- virtual void Save() OVERRIDE;
+ virtual bool Save() OVERRIDE;
protected:
- // |lock_| must be locked whenever |values_| is used.
- base::Lock lock_;
scoped_ptr<base::DictionaryValue> values_;
private: