OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/service/service_process_prefs.h" | 5 #include "chrome/service/service_process_prefs.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 | 8 |
9 ServiceProcessPrefs::ServiceProcessPrefs( | 9 ServiceProcessPrefs::ServiceProcessPrefs( |
10 const FilePath& pref_filename, | 10 const FilePath& pref_filename, |
11 base::MessageLoopProxy* file_message_loop_proxy) | 11 base::MessageLoopProxy* file_message_loop_proxy) |
12 : prefs_(new JsonPrefStore(pref_filename, file_message_loop_proxy)) { | 12 : prefs_(new JsonPrefStore(pref_filename, file_message_loop_proxy)) { |
13 } | 13 } |
14 | 14 |
| 15 ServiceProcessPrefs::~ServiceProcessPrefs() {} |
| 16 |
15 void ServiceProcessPrefs::ReadPrefs() { | 17 void ServiceProcessPrefs::ReadPrefs() { |
16 prefs_->ReadPrefs(); | 18 prefs_->ReadPrefs(); |
17 } | 19 } |
18 | 20 |
19 void ServiceProcessPrefs::WritePrefs() { | 21 void ServiceProcessPrefs::WritePrefs() { |
20 prefs_->WritePrefs(); | 22 prefs_->WritePrefs(); |
21 } | 23 } |
22 | 24 |
23 void ServiceProcessPrefs::GetString(const std::string& key, | 25 void ServiceProcessPrefs::GetString(const std::string& key, |
24 std::string* result) { | 26 std::string* result) { |
(...skipping 20 matching lines...) Expand all Loading... |
45 void ServiceProcessPrefs::GetDictionary(const std::string& key, | 47 void ServiceProcessPrefs::GetDictionary(const std::string& key, |
46 DictionaryValue** result) { | 48 DictionaryValue** result) { |
47 Value* value; | 49 Value* value; |
48 if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK || | 50 if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK || |
49 !value->IsType(Value::TYPE_DICTIONARY)) { | 51 !value->IsType(Value::TYPE_DICTIONARY)) { |
50 return; | 52 return; |
51 } | 53 } |
52 | 54 |
53 *result = static_cast<DictionaryValue*>(value); | 55 *result = static_cast<DictionaryValue*>(value); |
54 } | 56 } |
OLD | NEW |