Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / remoting / host / in_memory_host_config.h
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_
6 #define REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/non_thread_safe.h"
12 #include "remoting/host/host_config.h"
13
14 namespace base {
15 class DictionaryValue;
16 }  // namespace base
17
18 namespace remoting {
19
20 // In-memory host config. Used by unittests.
21 class InMemoryHostConfig : public MutableHostConfig,
22                            public base::NonThreadSafe {
23  public:
24   InMemoryHostConfig();
25   ~InMemoryHostConfig() override;
26
27   // MutableHostConfig interface.
28   bool GetString(const std::string& path,
29                  std::string* out_value) const override;
30   bool GetBoolean(const std::string& path, bool* out_value) const override;
31
32   void SetString(const std::string& path, const std::string& in_value) override;
33   void SetBoolean(const std::string& path, bool in_value) override;
34
35   bool CopyFrom(const base::DictionaryValue* dictionary) override;
36
37   bool Save() override;
38
39  protected:
40   scoped_ptr<base::DictionaryValue> values_;
41
42  private:
43   DISALLOW_COPY_AND_ASSIGN(InMemoryHostConfig);
44 };
45
46 }  // namespace remoting
47
48 #endif  // REMOTING_HOST_IN_MEMORY_HOST_CONFIG_H_