Chromium Code Reviews| 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_JSON_HOST_CONFIG_H_ | 5 #ifndef REMOTING_HOST_JSON_HOST_CONFIG_H_ |
| 6 #define REMOTING_HOST_JSON_HOST_CONFIG_H_ | 6 #define REMOTING_HOST_JSON_HOST_CONFIG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
|
Lambros
2012/04/06 22:26:46
nit: Move scoped_ptr.h from here into .cc file.
Sergey Ulanov
2012/04/06 22:32:53
Done.
| |
| 13 #include "remoting/host/in_memory_host_config.h" | 12 #include "remoting/host/in_memory_host_config.h" |
| 14 | 13 |
| 15 namespace base { | 14 namespace base { |
| 16 class MessageLoopProxy; | 15 class MessageLoopProxy; |
| 17 } // namespace base | 16 } // namespace base |
| 18 | 17 |
| 19 namespace remoting { | 18 namespace remoting { |
| 20 | 19 |
| 21 // JsonHostConfig implements MutableHostConfig for JSON file. | 20 // JsonHostConfig implements MutableHostConfig for JSON file. |
| 22 class JsonHostConfig : public InMemoryHostConfig { | 21 class JsonHostConfig : public InMemoryHostConfig { |
| 23 public: | 22 public: |
| 24 JsonHostConfig(const FilePath& pref_filename, | 23 JsonHostConfig(const FilePath& filename); |
| 25 base::MessageLoopProxy* file_message_loop_proxy); | |
| 26 virtual ~JsonHostConfig(); | 24 virtual ~JsonHostConfig(); |
| 27 | 25 |
| 28 virtual bool Read(); | 26 virtual bool Read(); |
| 29 | 27 |
| 30 // MutableHostConfig interface. | 28 // MutableHostConfig interface. |
| 31 virtual void Save() OVERRIDE; | 29 virtual bool Save() OVERRIDE; |
| 32 | 30 |
| 33 private: | 31 private: |
| 34 void DoWrite(); | |
| 35 | |
| 36 FilePath filename_; | 32 FilePath filename_; |
| 37 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | |
| 38 | 33 |
| 39 DISALLOW_COPY_AND_ASSIGN(JsonHostConfig); | 34 DISALLOW_COPY_AND_ASSIGN(JsonHostConfig); |
| 40 }; | 35 }; |
| 41 | 36 |
| 42 } // namespace remoting | 37 } // namespace remoting |
| 43 | 38 |
| 44 #endif // REMOTING_HOST_JSON_HOST_CONFIG_H_ | 39 #endif // REMOTING_HOST_JSON_HOST_CONFIG_H_ |
| OLD | NEW |