Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/service/service_process_prefs.cc

Issue 6250198: More out-of-lining of test code, along with a bunch of GMOCK objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix the gyp files this time Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698