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

Side by Side Diff: chrome/browser/prefs/profile_pref_store_manager.cc

Issue 347793002: Expand the JsonPrefStore's interface to allow for an alternate filename to be specified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dont even attempt to delete the alternate file in unexpected situations. Created 6 years, 6 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
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | chrome/common/chrome_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/prefs/profile_pref_store_manager.h" 5 #include "chrome/browser/prefs/profile_pref_store_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 PrefHashFilter* raw_unprotected_pref_hash_filter = 151 PrefHashFilter* raw_unprotected_pref_hash_filter =
152 unprotected_pref_hash_filter.get(); 152 unprotected_pref_hash_filter.get();
153 PrefHashFilter* raw_protected_pref_hash_filter = 153 PrefHashFilter* raw_protected_pref_hash_filter =
154 protected_pref_hash_filter.get(); 154 protected_pref_hash_filter.get();
155 155
156 scoped_refptr<JsonPrefStore> unprotected_pref_store( 156 scoped_refptr<JsonPrefStore> unprotected_pref_store(
157 new JsonPrefStore(GetPrefFilePathFromProfilePath(profile_path_), 157 new JsonPrefStore(GetPrefFilePathFromProfilePath(profile_path_),
158 io_task_runner, 158 io_task_runner,
159 unprotected_pref_hash_filter.PassAs<PrefFilter>())); 159 unprotected_pref_hash_filter.PassAs<PrefFilter>()));
160 // TODO(gab): Remove kDeprecatedProtectedPreferencesFilename as an alternate
161 // file in M40+.
160 scoped_refptr<JsonPrefStore> protected_pref_store(new JsonPrefStore( 162 scoped_refptr<JsonPrefStore> protected_pref_store(new JsonPrefStore(
161 profile_path_.Append(chrome::kProtectedPreferencesFilename), 163 profile_path_.Append(chrome::kSecurePreferencesFilename),
164 profile_path_.Append(chrome::kProtectedPreferencesFilenameDeprecated),
162 io_task_runner, 165 io_task_runner,
163 protected_pref_hash_filter.PassAs<PrefFilter>())); 166 protected_pref_hash_filter.PassAs<PrefFilter>()));
164 167
165 SetupTrackedPreferencesMigration( 168 SetupTrackedPreferencesMigration(
166 unprotected_pref_names, 169 unprotected_pref_names,
167 protected_pref_names, 170 protected_pref_names,
168 base::Bind(&JsonPrefStore::RemoveValueSilently, 171 base::Bind(&JsonPrefStore::RemoveValueSilently,
169 unprotected_pref_store->AsWeakPtr()), 172 unprotected_pref_store->AsWeakPtr()),
170 base::Bind(&JsonPrefStore::RemoveValueSilently, 173 base::Bind(&JsonPrefStore::RemoveValueSilently,
171 protected_pref_store->AsWeakPtr()), 174 protected_pref_store->AsWeakPtr()),
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 scoped_ptr<PrefHashStoreImpl> ProfilePrefStoreManager::GetPrefHashStoreImpl() { 234 scoped_ptr<PrefHashStoreImpl> ProfilePrefStoreManager::GetPrefHashStoreImpl() {
232 DCHECK(kPlatformSupportsPreferenceTracking); 235 DCHECK(kPlatformSupportsPreferenceTracking);
233 236
234 return make_scoped_ptr(new PrefHashStoreImpl( 237 return make_scoped_ptr(new PrefHashStoreImpl(
235 seed_, 238 seed_,
236 device_id_, 239 device_id_,
237 scoped_ptr<HashStoreContents>(new PrefServiceHashStoreContents( 240 scoped_ptr<HashStoreContents>(new PrefServiceHashStoreContents(
238 profile_path_.AsUTF8Unsafe(), local_state_)), 241 profile_path_.AsUTF8Unsafe(), local_state_)),
239 true)); 242 true));
240 } 243 }
OLDNEW
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | chrome/common/chrome_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698