OLD | NEW |
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 #ifndef REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_ | 5 #ifndef REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_ |
6 #define REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_ | 6 #define REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "remoting/host/host_config.h" | 13 #include "remoting/host/host_config.h" |
14 | 14 |
| 15 class Task; |
| 16 |
| 17 namespace base { |
15 class DictionaryValue; | 18 class DictionaryValue; |
16 class Task; | 19 } |
17 | 20 |
18 namespace remoting { | 21 namespace remoting { |
19 | 22 |
20 // In-memory host config. Used by unittests. | 23 // In-memory host config. Used by unittests. |
21 class InMemoryHostConfig : public MutableHostConfig { | 24 class InMemoryHostConfig : public MutableHostConfig { |
22 public: | 25 public: |
23 InMemoryHostConfig(); | 26 InMemoryHostConfig(); |
24 virtual ~InMemoryHostConfig(); | 27 virtual ~InMemoryHostConfig(); |
25 | 28 |
26 // MutableHostConfig interface. | 29 // MutableHostConfig interface. |
27 virtual bool GetString(const std::string& path, std::string* out_value); | 30 virtual bool GetString(const std::string& path, std::string* out_value); |
28 virtual bool GetBoolean(const std::string& path, bool* out_value); | 31 virtual bool GetBoolean(const std::string& path, bool* out_value); |
29 | 32 |
30 virtual void SetString(const std::string& path, const std::string& in_value); | 33 virtual void SetString(const std::string& path, const std::string& in_value); |
31 virtual void SetBoolean(const std::string& path, bool in_value); | 34 virtual void SetBoolean(const std::string& path, bool in_value); |
32 | 35 |
33 virtual void Save(); | 36 virtual void Save(); |
34 | 37 |
35 protected: | 38 protected: |
36 // |lock_| must be locked whenever |values_| is used. | 39 // |lock_| must be locked whenever |values_| is used. |
37 base::Lock lock_; | 40 base::Lock lock_; |
38 scoped_ptr<DictionaryValue> values_; | 41 scoped_ptr<base::DictionaryValue> values_; |
39 | 42 |
40 private: | 43 private: |
41 DISALLOW_COPY_AND_ASSIGN(InMemoryHostConfig); | 44 DISALLOW_COPY_AND_ASSIGN(InMemoryHostConfig); |
42 }; | 45 }; |
43 | 46 |
44 } // namespace remoting | 47 } // namespace remoting |
45 | 48 |
46 #endif // REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_ | 49 #endif // REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_ |
OLD | NEW |